[java resteasy] fix string comparison (#134)

* Fix StringUtils.isEmpty(..)
* Update all JaxRS samples
This commit is contained in:
Jérémie Bresson 2018-05-23 08:38:18 +02:00 committed by GitHub
parent 27426f7b52
commit 3f81378d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 91 additions and 9 deletions

View File

@ -17,20 +17,21 @@
package org.openapitools.codegen.languages; package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.Operation;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import org.openapitools.codegen.languages.features.JbossFeature;
import org.openapitools.codegen.languages.features.SwaggerFeatures;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import org.openapitools.codegen.languages.features.JbossFeature;
import org.openapitools.codegen.languages.features.SwaggerFeatures;
import io.swagger.v3.oas.models.*;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen
implements JbossFeature, BeanValidationFeatures, SwaggerFeatures { implements JbossFeature, BeanValidationFeatures, SwaggerFeatures {
@ -126,7 +127,7 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen
basePath = basePath.substring(0, pos); basePath = basePath.substring(0, pos);
} }
if (StringUtils.isEmpty("")) { if (StringUtils.isEmpty(basePath)) {
basePath = "default"; basePath = "default";
} else { } else {
if (co.path.startsWith("/" + basePath)) { if (co.path.startsWith("/" + basePath)) {

View File

@ -12,7 +12,9 @@ import io.swagger.annotations.*;
public class Category { public class Category {
private Long id = null; private Long id = null;
private String name = null; private String name = null;
/** /**

View File

@ -12,8 +12,11 @@ import io.swagger.annotations.*;
public class ModelApiResponse { public class ModelApiResponse {
private Integer code = null; private Integer code = null;
private String type = null; private String type = null;
private String message = null; private String message = null;
/** /**

View File

@ -14,9 +14,13 @@ import io.swagger.annotations.*;
public class Order { public class Order {
private Long id = null; private Long id = null;
private Long petId = null; private Long petId = null;
private Integer quantity = null; private Integer quantity = null;
private OffsetDateTime shipDate = null; private OffsetDateTime shipDate = null;
/** /**
@ -41,7 +45,9 @@ public class Order {
} }
} }
private StatusEnum status = null; private StatusEnum status = null;
private Boolean complete = false; private Boolean complete = false;
/** /**

View File

@ -16,10 +16,15 @@ import io.swagger.annotations.*;
public class Pet { public class Pet {
private Long id = null; private Long id = null;
private Category category = null; private Category category = null;
private String name = null; private String name = null;
private List<String> photoUrls = new ArrayList<>(); private List<String> photoUrls = new ArrayList<>();
private List<Tag> tags = new ArrayList<>(); private List<Tag> tags = new ArrayList<>();
/** /**
@ -44,6 +49,7 @@ public class Pet {
} }
} }
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -12,7 +12,9 @@ import io.swagger.annotations.*;
public class Tag { public class Tag {
private Long id = null; private Long id = null;
private String name = null; private String name = null;
/** /**

View File

@ -12,13 +12,21 @@ import io.swagger.annotations.*;
public class User { public class User {
private Long id = null; private Long id = null;
private String username = null; private String username = null;
private String firstName = null; private String firstName = null;
private String lastName = null; private String lastName = null;
private String email = null; private String email = null;
private String password = null; private String password = null;
private String phone = null; private String phone = null;
private Integer userStatus = null; private Integer userStatus = null;
/** /**

View File

@ -12,7 +12,9 @@ import io.swagger.annotations.*;
public class Category { public class Category {
private Long id = null; private Long id = null;
private String name = null; private String name = null;
/** /**

View File

@ -12,8 +12,11 @@ import io.swagger.annotations.*;
public class ModelApiResponse { public class ModelApiResponse {
private Integer code = null; private Integer code = null;
private String type = null; private String type = null;
private String message = null; private String message = null;
/** /**

View File

@ -14,9 +14,13 @@ import io.swagger.annotations.*;
public class Order { public class Order {
private Long id = null; private Long id = null;
private Long petId = null; private Long petId = null;
private Integer quantity = null; private Integer quantity = null;
private DateTime shipDate = null; private DateTime shipDate = null;
/** /**
@ -41,7 +45,9 @@ public class Order {
} }
} }
private StatusEnum status = null; private StatusEnum status = null;
private Boolean complete = false; private Boolean complete = false;
/** /**

View File

@ -16,10 +16,15 @@ import io.swagger.annotations.*;
public class Pet { public class Pet {
private Long id = null; private Long id = null;
private Category category = null; private Category category = null;
private String name = null; private String name = null;
private List<String> photoUrls = new ArrayList<String>(); private List<String> photoUrls = new ArrayList<String>();
private List<Tag> tags = new ArrayList<Tag>(); private List<Tag> tags = new ArrayList<Tag>();
/** /**
@ -44,6 +49,7 @@ public class Pet {
} }
} }
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -12,7 +12,9 @@ import io.swagger.annotations.*;
public class Tag { public class Tag {
private Long id = null; private Long id = null;
private String name = null; private String name = null;
/** /**

View File

@ -12,13 +12,21 @@ import io.swagger.annotations.*;
public class User { public class User {
private Long id = null; private Long id = null;
private String username = null; private String username = null;
private String firstName = null; private String firstName = null;
private String lastName = null; private String lastName = null;
private String email = null; private String email = null;
private String password = null; private String password = null;
private String phone = null; private String phone = null;
private Integer userStatus = null; private Integer userStatus = null;
/** /**

View File

@ -12,7 +12,9 @@ import io.swagger.annotations.*;
public class Category { public class Category {
private Long id = null; private Long id = null;
private String name = null; private String name = null;
/** /**

View File

@ -12,8 +12,11 @@ import io.swagger.annotations.*;
public class ModelApiResponse { public class ModelApiResponse {
private Integer code = null; private Integer code = null;
private String type = null; private String type = null;
private String message = null; private String message = null;
/** /**

View File

@ -14,9 +14,13 @@ import io.swagger.annotations.*;
public class Order { public class Order {
private Long id = null; private Long id = null;
private Long petId = null; private Long petId = null;
private Integer quantity = null; private Integer quantity = null;
private Date shipDate = null; private Date shipDate = null;
/** /**
@ -41,7 +45,9 @@ public class Order {
} }
} }
private StatusEnum status = null; private StatusEnum status = null;
private Boolean complete = false; private Boolean complete = false;
/** /**

View File

@ -16,10 +16,15 @@ import io.swagger.annotations.*;
public class Pet { public class Pet {
private Long id = null; private Long id = null;
private Category category = null; private Category category = null;
private String name = null; private String name = null;
private List<String> photoUrls = new ArrayList<String>(); private List<String> photoUrls = new ArrayList<String>();
private List<Tag> tags = new ArrayList<Tag>(); private List<Tag> tags = new ArrayList<Tag>();
/** /**
@ -44,6 +49,7 @@ public class Pet {
} }
} }
private StatusEnum status = null; private StatusEnum status = null;
/** /**

View File

@ -12,7 +12,9 @@ import io.swagger.annotations.*;
public class Tag { public class Tag {
private Long id = null; private Long id = null;
private String name = null; private String name = null;
/** /**

View File

@ -12,13 +12,21 @@ import io.swagger.annotations.*;
public class User { public class User {
private Long id = null; private Long id = null;
private String username = null; private String username = null;
private String firstName = null; private String firstName = null;
private String lastName = null; private String lastName = null;
private String email = null; private String email = null;
private String password = null; private String password = null;
private String phone = null; private String phone = null;
private Integer userStatus = null; private Integer userStatus = null;
/** /**