[Java] configurable Javax/Jakarta package (#14310)

This commit is contained in:
Oleh Kurpiak 2022-12-30 16:33:55 +02:00 committed by GitHub
parent b71aecbe9e
commit 7c587ce061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
165 changed files with 516 additions and 583 deletions

View File

@ -94,7 +94,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useBeanValidation|Use BeanValidation API annotations| |true|
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|useOptional|Use Optional container for optional parameters| |false|
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports).| |true|
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports).| |false|
|useSpringController|Annotate the generated API as a Spring Controller| |false|
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|useTags|use tags for creating interface and controller classnames| |false|

View File

@ -87,7 +87,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useBeanValidation|Use BeanValidation API annotations| |true|
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|useOptional|Use Optional container for optional parameters| |false|
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports).| |true|
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports).| |false|
|useSpringController|Annotate the generated API as a Spring Controller| |false|
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|useTags|use tags for creating interface and controller classnames| |false|

View File

@ -6462,7 +6462,7 @@ public class DefaultCodegen implements CodegenConfig {
return result;
}
public void writePropertyBack(String propertyKey, boolean value) {
public void writePropertyBack(String propertyKey, Object value) {
additionalProperties.put(propertyKey, value);
}

View File

@ -83,6 +83,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String TEST_OUTPUT = "testOutput";
public static final String IMPLICIT_HEADERS = "implicitHeaders";
public static final String IMPLICIT_HEADERS_REGEX = "implicitHeadersRegex";
public static final String JAVAX_PACKAGE = "javaxPackage";
public static final String CAMEL_CASE_DOLLAR_SIGN = "camelCaseDollarSign";
@ -671,6 +672,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (additionalProperties.containsKey(TEST_OUTPUT)) {
setOutputTestFolder(additionalProperties.get(TEST_OUTPUT).toString());
}
applyJavaxPackage();
}
@Override
@ -722,6 +725,14 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
}
protected void applyJavaxPackage() {
writePropertyBack(JAVAX_PACKAGE, "javax");
}
protected void applyJakartaPackage() {
writePropertyBack(JAVAX_PACKAGE, "jakarta");
}
@Override
public String escapeReservedWord(String name) {
if (this.reservedWordsMappings().containsKey(name)) {

View File

@ -575,7 +575,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
// The flag below should be set for all Java libraries, but the templates need to be ported
// one by one for each library.
supportsAdditionalPropertiesWithComposedSchema = true;
applyJakartaPackage();
} else if (NATIVE.equals(getLibrary())) {
supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java"));
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));

View File

@ -105,7 +105,6 @@ public class SpringCodegen extends AbstractJavaCodegen
public static final String RETURN_SUCCESS_CODE = "returnSuccessCode";
public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException";
public static final String USE_SPRING_BOOT3 = "useSpringBoot3";
public static final String USE_JAKARTA_EE = "useJakartaEe";
public static final String REQUEST_MAPPING_OPTION = "requestMappingMode";
public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController";
public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface";
@ -243,7 +242,7 @@ public class SpringCodegen extends AbstractJavaCodegen
useSwaggerUI));
cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT3,
"Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports).",
useSwaggerUI));
useSpringBoot3));
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
supportedLibraries.put(SPRING_CLOUD_LIBRARY,
@ -474,9 +473,7 @@ public class SpringCodegen extends AbstractJavaCodegen
if (AnnotationLibrary.SWAGGER1.equals(getAnnotationLibrary())) {
throw new IllegalArgumentException(AnnotationLibrary.SWAGGER1.getPropertyName() + " is not supported with Spring Boot > 3.x");
}
writePropertyBack(USE_JAKARTA_EE, true);
} else {
writePropertyBack(USE_JAKARTA_EE, false);
applyJakartaPackage();
}
writePropertyBack(USE_SPRING_BOOT3, isUseSpringBoot3());

View File

@ -21,9 +21,9 @@ import com.sun.jersey.api.client.WebResource.Builder;
import com.sun.jersey.multipart.FormDataMultiPart;
import com.sun.jersey.multipart.file.FileDataBodyPart;
import javax.ws.rs.core.Cookie;
import javax.ws.rs.core.Response.Status.Family;
import javax.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.core.Cookie;
import {{javaxPackage}}.ws.rs.core.Response.Status.Family;
import {{javaxPackage}}.ws.rs.core.MediaType;
import java.util.Collection;
import java.util.Collections;

View File

@ -2,8 +2,8 @@ package {{invokerPackage}};
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ValidationException;
import {{javaxPackage}}.validation.ConstraintViolation;
import {{javaxPackage}}.validation.ValidationException;
public class BeanValidationException extends ValidationException {
/**

View File

@ -1 +1 @@
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -14,7 +14,7 @@ import com.google.api.client.http.HttpMethods;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.json.Json;
import javax.ws.rs.core.UriBuilder;
import {{javaxPackage}}.ws.rs.core.UriBuilder;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;

View File

@ -6,7 +6,7 @@ import {{invokerPackage}}.ApiException;
import java.util.Objects;
import java.lang.reflect.Type;
import java.util.Map;
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
import com.fasterxml.jackson.annotation.JsonValue;

View File

@ -1,15 +1,15 @@
package {{invokerPackage}};
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.client.Client;
import {{javaxPackage}}.ws.rs.client.ClientBuilder;
import {{javaxPackage}}.ws.rs.client.Entity;
import {{javaxPackage}}.ws.rs.client.Invocation;
import {{javaxPackage}}.ws.rs.client.WebTarget;
import {{javaxPackage}}.ws.rs.core.Form;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
{{#hasOAuthMethods}}
import com.github.scribejava.core.model.OAuth2AccessToken;
@ -27,9 +27,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import {{javaxPackage}}.net.ssl.SSLContext;
import {{javaxPackage}}.net.ssl.TrustManager;
import {{javaxPackage}}.net.ssl.X509TrustManager;
import java.security.cert.X509Certificate;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
@ -251,7 +251,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Getter for the field <code>httpClient</code>.</p>
*
* @return a {@link javax.ws.rs.client.Client} object.
* @return a {@link {{javaxPackage}}.ws.rs.client.Client} object.
*/
public Client getHttpClient() {
return httpClient;
@ -260,7 +260,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Setter for the field <code>httpClient</code>.</p>
*
* @param httpClient a {@link javax.ws.rs.client.Client} object.
* @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object.
* @return a {@link org.openapitools.client.ApiClient} object.
*/
public ApiClient setHttpClient(Client httpClient) {
@ -1098,7 +1098,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Prepare the file for download from the response.</p>
*
* @param response a {@link javax.ws.rs.core.Response} object.
* @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object.
* @return a {@link java.io.File} object.
* @throws java.io.IOException if any.
*/
@ -1387,7 +1387,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* To completely disable certificate validation (at your own risk), you can
* override this method and invoke disableCertificateValidation(clientBuilder).
*
* @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object.
* @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object.
*/
protected void customizeClientBuilder(ClientBuilder clientBuilder) {
// No-op extension point
@ -1399,7 +1399,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* Please note that trusting all certificates is extremely risky.
* This may be useful in a development environment with self-signed certificates.
*
* @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object.
* @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object.
* @throws java.security.KeyManagementException if any.
* @throws java.security.NoSuchAlgorithmException if any.
*/
@ -1426,7 +1426,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Build the response headers.</p>
*
* @param response a {@link javax.ws.rs.core.Response} object.
* @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object.
* @return a {@link java.util.Map} of response headers.
*/
protected Map<String, List<String>> buildResponseHeaders(Response response) {

View File

@ -19,8 +19,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.ext.ContextResolver;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.ext.ContextResolver;
{{>generatedAnnotation}}
public class JSON implements ContextResolver<ObjectMapper> {

View File

@ -1,5 +1,5 @@
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

View File

@ -6,7 +6,7 @@ import {{invokerPackage}}.ApiResponse;
import {{invokerPackage}}.Configuration;
import {{invokerPackage}}.Pair;
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
{{#imports}}import {{import}};
{{/imports}}

View File

@ -10,7 +10,7 @@ import com.github.scribejava.core.exceptions.OAuthException;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.oauth.OAuth20Service;
import javax.ws.rs.core.UriBuilder;
import {{javaxPackage}}.ws.rs.core.UriBuilder;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;

View File

@ -36,15 +36,15 @@ import com.fasterxml.jackson.annotation.JsonCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jackson}}
{{#withXml}}
import javax.xml.bind.annotation.*;
import {{javaxPackage}}.xml.bind.annotation.*;
{{/withXml}}
{{#parcelableModel}}
import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;

View File

@ -1,5 +1,5 @@
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

View File

@ -206,14 +206,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/deprecated}}
{{#required}}
{{#isNullable}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
@{{javaxPackage}}.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/required}}
{{#useBeanValidation}}
{{>beanValidation}}

View File

@ -6,7 +6,7 @@ import {{invokerPackage}}.ApiException;
import java.util.Objects;
import java.lang.reflect.Type;
import java.util.Map;
import jakarta.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
import com.fasterxml.jackson.annotation.JsonValue;

View File

@ -1,15 +1,15 @@
package {{invokerPackage}};
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Form;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.client.Client;
import {{javaxPackage}}.ws.rs.client.ClientBuilder;
import {{javaxPackage}}.ws.rs.client.Entity;
import {{javaxPackage}}.ws.rs.client.Invocation;
import {{javaxPackage}}.ws.rs.client.WebTarget;
import {{javaxPackage}}.ws.rs.core.Form;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
{{#hasOAuthMethods}}
import com.github.scribejava.core.model.OAuth2AccessToken;
@ -251,7 +251,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Getter for the field <code>httpClient</code>.</p>
*
* @return a {@link jakarta.ws.rs.client.Client} object.
* @return a {@link {{javaxPackage}}.ws.rs.client.Client} object.
*/
public Client getHttpClient() {
return httpClient;
@ -260,7 +260,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Setter for the field <code>httpClient</code>.</p>
*
* @param httpClient a {@link jakarta.ws.rs.client.Client} object.
* @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object.
* @return a {@link org.openapitools.client.ApiClient} object.
*/
public ApiClient setHttpClient(Client httpClient) {
@ -1098,7 +1098,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Prepare the file for download from the response.</p>
*
* @param response a {@link jakarta.ws.rs.core.Response} object.
* @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object.
* @return a {@link java.io.File} object.
* @throws java.io.IOException if any.
*/
@ -1382,7 +1382,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* To completely disable certificate validation (at your own risk), you can
* override this method and invoke disableCertificateValidation(clientBuilder).
*
* @param clientBuilder a {@link jakarta.ws.rs.client.ClientBuilder} object.
* @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object.
*/
protected void customizeClientBuilder(ClientBuilder clientBuilder) {
// No-op extension point
@ -1394,7 +1394,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* Please note that trusting all certificates is extremely risky.
* This may be useful in a development environment with self-signed certificates.
*
* @param clientBuilder a {@link jakarta.ws.rs.client.ClientBuilder} object.
* @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object.
* @throws java.security.KeyManagementException if any.
* @throws java.security.NoSuchAlgorithmException if any.
*/
@ -1421,7 +1421,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
/**
* <p>Build the response headers.</p>
*
* @param response a {@link jakarta.ws.rs.core.Response} object.
* @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object.
* @return a {@link java.util.Map} of response headers.
*/
protected Map<String, List<String>> buildResponseHeaders(Response response) {

View File

@ -19,8 +19,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.ext.ContextResolver;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.ext.ContextResolver;
{{>generatedAnnotation}}
public class JSON implements ContextResolver<ObjectMapper> {

View File

@ -1,5 +1,5 @@
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

View File

@ -6,7 +6,7 @@ import {{invokerPackage}}.ApiResponse;
import {{invokerPackage}}.Configuration;
import {{invokerPackage}}.Pair;
import jakarta.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
{{#imports}}import {{import}};
{{/imports}}

View File

@ -10,7 +10,7 @@ import com.github.scribejava.core.exceptions.OAuthException;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.oauth.OAuth20Service;
import jakarta.ws.rs.core.UriBuilder;
import {{javaxPackage}}.ws.rs.core.UriBuilder;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;

View File

@ -1 +1 @@
@jakarta.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -36,15 +36,15 @@ import com.fasterxml.jackson.annotation.JsonCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jackson}}
{{#withXml}}
import javax.xml.bind.annotation.*;
import {{javaxPackage}}.xml.bind.annotation.*;
{{/withXml}}
{{#parcelableModel}}
import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;

View File

@ -1,5 +1,5 @@
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.Response;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

View File

@ -206,14 +206,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/deprecated}}
{{#required}}
{{#isNullable}}
@jakarta.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@jakarta.annotation.Nonnull
@{{javaxPackage}}.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@jakarta.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/required}}
{{#useBeanValidation}}
{{>beanValidation}}

View File

@ -17,8 +17,8 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
{{/disableMultipart}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;

View File

@ -1 +1 @@
@javax.annotation.processing.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.processing.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -36,15 +36,15 @@ import com.fasterxml.jackson.annotation.JsonCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jackson}}
{{#withXml}}
import javax.xml.bind.annotation.*;
import {{javaxPackage}}.xml.bind.annotation.*;
{{/withXml}}
{{#parcelableModel}}
import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;

View File

@ -206,14 +206,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/deprecated}}
{{#required}}
{{#isNullable}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
@{{javaxPackage}}.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/required}}
{{#useBeanValidation}}
{{>beanValidation}}

View File

@ -6,7 +6,7 @@ import {{invokerPackage}}.ApiException;
import java.util.Objects;
import java.lang.reflect.Type;
import java.util.Map;
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
//import com.fasterxml.jackson.annotation.JsonValue;

View File

@ -1,4 +1,4 @@
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
import java.io.IOException;
import java.lang.reflect.Type;

View File

@ -26,13 +26,13 @@ import io.swagger.v3.oas.models.parameters.Parameter;
import java.io.IOException;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
{{#performBeanValidation}}
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.ValidatorFactory;
import javax.validation.executable.ExecutableValidator;
import {{javaxPackage}}.validation.ConstraintViolation;
import {{javaxPackage}}.validation.Validation;
import {{javaxPackage}}.validation.ValidatorFactory;
import {{javaxPackage}}.validation.executable.ExecutableValidator;
import java.util.Set;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
@ -51,7 +51,7 @@ import java.util.Map;
import java.io.InputStream;
{{/supportStreaming}}
{{/fullJavaUtil}}
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
{{#operations}}
public class {{classname}} {

View File

@ -9,7 +9,7 @@ import java.util.Map.Entry;
import java.util.TreeMap;
{{/caseInsensitiveResponseHeaders}}
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
/**
* <p>ApiException class.</p>

View File

@ -25,21 +25,21 @@ import com.fasterxml.jackson.annotation.JsonCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jackson}}
{{#withXml}}
import javax.xml.bind.annotation.*;
import {{javaxPackage}}.xml.bind.annotation.*;
{{/withXml}}
{{#jsonb}}
import java.lang.reflect.Type;
import javax.json.bind.annotation.JsonbTypeDeserializer;
import javax.json.bind.annotation.JsonbTypeSerializer;
import javax.json.bind.serializer.DeserializationContext;
import javax.json.bind.serializer.JsonbDeserializer;
import javax.json.bind.serializer.JsonbSerializer;
import javax.json.bind.serializer.SerializationContext;
import javax.json.stream.JsonGenerator;
import javax.json.stream.JsonParser;
import javax.json.bind.annotation.JsonbProperty;
import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer;
import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer;
import {{javaxPackage}}.json.bind.serializer.DeserializationContext;
import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer;
import {{javaxPackage}}.json.bind.serializer.JsonbSerializer;
import {{javaxPackage}}.json.bind.serializer.SerializationContext;
import {{javaxPackage}}.json.stream.JsonGenerator;
import {{javaxPackage}}.json.stream.JsonParser;
import {{javaxPackage}}.json.bind.annotation.JsonbProperty;
{{#vendorExtensions.x-has-readonly-properties}}
import javax.json.bind.annotation.JsonbCreator;
import {{javaxPackage}}.json.bind.annotation.JsonbCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jsonb}}
{{#parcelableModel}}
@ -47,8 +47,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;

View File

@ -1,4 +1,4 @@
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
import java.io.IOException;
import java.lang.reflect.Type;

View File

@ -223,14 +223,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/deprecated}}
{{#required}}
{{#isNullable}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
@{{javaxPackage}}.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/required}}
{{#jsonb}}
@JsonbProperty("{{baseName}}")

View File

@ -27,16 +27,16 @@ import java.util.regex.Pattern;
import java.time.OffsetDateTime;
{{/jsr310}}
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.client.Client;
import {{javaxPackage}}.ws.rs.client.ClientBuilder;
import {{javaxPackage}}.ws.rs.client.Entity;
import {{javaxPackage}}.ws.rs.client.Invocation;
import {{javaxPackage}}.ws.rs.client.WebTarget;
import {{javaxPackage}}.ws.rs.core.Form;
import {{javaxPackage}}.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
import org.jboss.logging.Logger;
import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration;

View File

@ -9,7 +9,7 @@ import com.fasterxml.jackson.datatype.jsr310.*;
import java.text.DateFormat;
import javax.ws.rs.ext.ContextResolver;
import {{javaxPackage}}.ws.rs.ext.ContextResolver;
{{>generatedAnnotation}}
public class JSON implements ContextResolver<ObjectMapper> {

View File

@ -5,7 +5,7 @@ import {{invokerPackage}}.ApiClient;
import {{invokerPackage}}.Configuration;
import {{invokerPackage}}.Pair;
import javax.ws.rs.core.GenericType;
import {{javaxPackage}}.ws.rs.core.GenericType;
{{#imports}}import {{import}};
{{/imports}}

View File

@ -62,7 +62,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
import javax.annotation.Nullable;
import {{javaxPackage}}.annotation.Nullable;
{{#jsr310}}
import java.time.OffsetDateTime;

View File

@ -25,23 +25,23 @@ import com.fasterxml.jackson.annotation.JsonCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jackson}}
{{#withXml}}
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.*;
import {{javaxPackage}}.xml.bind.annotation.*;
import {{javaxPackage}}.xml.bind.annotation.adapters.*;
import io.github.threetenjaxb.core.*;
{{/withXml}}
{{#jsonb}}
import java.lang.reflect.Type;
import javax.json.bind.annotation.JsonbTypeDeserializer;
import javax.json.bind.annotation.JsonbTypeSerializer;
import javax.json.bind.serializer.DeserializationContext;
import javax.json.bind.serializer.JsonbDeserializer;
import javax.json.bind.serializer.JsonbSerializer;
import javax.json.bind.serializer.SerializationContext;
import javax.json.stream.JsonGenerator;
import javax.json.stream.JsonParser;
import javax.json.bind.annotation.JsonbProperty;
import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer;
import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer;
import {{javaxPackage}}.json.bind.serializer.DeserializationContext;
import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer;
import {{javaxPackage}}.json.bind.serializer.JsonbSerializer;
import {{javaxPackage}}.json.bind.serializer.SerializationContext;
import {{javaxPackage}}.json.stream.JsonGenerator;
import {{javaxPackage}}.json.stream.JsonParser;
import {{javaxPackage}}.json.bind.annotation.JsonbProperty;
{{#vendorExtensions.x-has-readonly-properties}}
import javax.json.bind.annotation.JsonbCreator;
import {{javaxPackage}}.json.bind.annotation.JsonbCreator;
{{/vendorExtensions.x-has-readonly-properties}}
{{/jsonb}}
{{#parcelableModel}}
@ -49,8 +49,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;

View File

@ -204,14 +204,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/deprecated}}
{{#required}}
{{#isNullable}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
@{{javaxPackage}}.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
@{{javaxPackage}}.annotation.Nullable
{{/required}}
{{#jsonb}}
@JsonbProperty("{{baseName}}")

View File

@ -2,7 +2,7 @@ package {{invokerPackage}};
import io.swagger.inflector.models.RequestContext;
import io.swagger.inflector.models.ResponseContext;
import javax.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.core.Response.Status;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import java.io.File;

View File

@ -1 +1 @@
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -2,11 +2,11 @@ package {{apiPackage}};
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import {{javaxPackage}}.servlet.*;
import {{javaxPackage}}.servlet.http.HttpServletResponse;
{{>generatedAnnotation}}
public class ApiOriginFilter implements javax.servlet.Filter {
public class ApiOriginFilter implements {{javaxPackage}}.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;

View File

@ -1,11 +1,11 @@
package {{apiPackage}};
{{#withXml}}
import javax.xml.bind.annotation.XmlTransient;
import {{javaxPackage}}.xml.bind.annotation.XmlTransient;
{{/withXml}}
{{#withXml}}
@javax.xml.bind.annotation.XmlRootElement
@{{javaxPackage}}.xml.bind.annotation.XmlRootElement
{{/withXml}}
{{>generatedAnnotation}}
public class ApiResponseMessage {

View File

@ -4,13 +4,13 @@ import com.sun.jersey.core.spi.component.ComponentContext;
import com.sun.jersey.spi.inject.Injectable;
import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.QueryParam;
import {{javaxPackage}}.ws.rs.WebApplicationException;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.core.UriInfo;
import {{javaxPackage}}.ws.rs.ext.Provider;
import org.joda.time.DateTime;
import java.util.List;

View File

@ -4,13 +4,13 @@ import com.sun.jersey.core.spi.component.ComponentContext;
import com.sun.jersey.spi.inject.Injectable;
import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.QueryParam;
import {{javaxPackage}}.ws.rs.WebApplicationException;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.core.UriInfo;
import {{javaxPackage}}.ws.rs.ext.Provider;
import org.joda.time.LocalDate;
import java.util.List;

View File

@ -21,14 +21,14 @@ import java.io.InputStream;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
import javax.servlet.ServletConfig;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
import {{javaxPackage}}.servlet.ServletConfig;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.*;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
@Path("{{commonPath}}")
@ -62,7 +62,7 @@ public class {{classname}} {
}
{{#operation}}
@javax.ws.rs.{{httpMethod}}
@{{javaxPackage}}.ws.rs.{{httpMethod}}
{{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}}
{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}
{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}

View File

@ -15,10 +15,10 @@ import {{package}}.NotFoundException;
import java.io.InputStream;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
{{>generatedAnnotation}}
{{#operations}}

View File

@ -14,10 +14,10 @@ import java.io.InputStream;
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
{{>generatedAnnotation}}
{{#operations}}

View File

@ -5,10 +5,10 @@ import io.swagger.models.*;
import io.swagger.models.auth.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import {{javaxPackage}}.servlet.http.HttpServlet;
import {{javaxPackage}}.servlet.ServletContext;
import {{javaxPackage}}.servlet.ServletConfig;
import {{javaxPackage}}.servlet.ServletException;
public class Bootstrap extends HttpServlet {
@Override

View File

@ -1,7 +1,7 @@
package {{invokerPackage}};
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import {{javaxPackage}}.ws.rs.ApplicationPath;
import {{javaxPackage}}.ws.rs.core.Application;
@ApplicationPath("{{{contextPath}}}")
public class RestApplication extends Application {

View File

@ -4,12 +4,12 @@ package {{package}};
{{/imports}}
import {{package}}.{{classname}}Service;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import {{javaxPackage}}.ws.rs.*;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
import {{javaxPackage}}.enterprise.context.RequestScoped;
import {{javaxPackage}}.inject.Inject;
import io.swagger.annotations.*;
import java.io.InputStream;
@ -21,7 +21,7 @@ import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import java.util.Map;
import java.util.List;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
@Path("{{commonPath}}")
@RequestScoped

View File

@ -13,8 +13,8 @@ import java.util.List;
import java.io.InputStream;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
{{>generatedAnnotation}}
{{#operations}}

View File

@ -12,9 +12,9 @@ import java.util.List;
import java.io.InputStream;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.enterprise.context.RequestScoped;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
@RequestScoped
{{>generatedAnnotation}}

View File

@ -1,7 +1,7 @@
{{#withXml}}
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import {{javaxPackage}}.xml.bind.annotation.XmlType;
import {{javaxPackage}}.xml.bind.annotation.XmlEnum;
import {{javaxPackage}}.xml.bind.annotation.XmlEnumValue;
{{/withXml}}
{{>enumClass}}

View File

@ -1 +1 @@
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -6,7 +6,7 @@ package {{package}};
import java.io.Serializable;
{{/serializableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
{{#models}}
{{#model}}{{#description}}

View File

@ -2,7 +2,7 @@ import io.swagger.annotations.*;
import java.util.Objects;
{{#withXml}}
import javax.xml.bind.annotation.*;
import {{javaxPackage}}.xml.bind.annotation.*;
{{/withXml}}
{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}

View File

@ -5,8 +5,8 @@ import java.lang.reflect.Method;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.Path;
import {{javaxPackage}}.ws.rs.HttpMethod;
import {{javaxPackage}}.ws.rs.Path;
import org.apache.cxf.jaxrs.ext.ResourceComparator;
import org.apache.cxf.jaxrs.model.ClassResourceInfo;
@ -60,7 +60,7 @@ public class CXFInterfaceComparator implements ResourceComparator {
Method[] methods = cri.getServiceClass().getInterfaces()[0].getMethods();
// Java reflexion. Check all the methods of an interface.
for (Method method : methods) {
Path pathAnnotation = method.getAnnotation(javax.ws.rs.Path.class);
Path pathAnnotation = method.getAnnotation({{javaxPackage}}.ws.rs.Path.class);
if (pathAnnotation != null && pathAnnotation.value() != null) {
String pathValue = pathAnnotation.value();
String methodHttpVerb = getMethodHttpVerb(method);
@ -79,17 +79,17 @@ public class CXFInterfaceComparator implements ResourceComparator {
}
private static String getMethodHttpVerb(Method method) {
if (method.getAnnotation(javax.ws.rs.POST.class) != null) {
if (method.getAnnotation({{javaxPackage}}.ws.rs.POST.class) != null) {
return HttpMethod.POST;
} else if (method.getAnnotation(javax.ws.rs.GET.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.GET.class) != null) {
return HttpMethod.GET;
} else if (method.getAnnotation(javax.ws.rs.PUT.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.PUT.class) != null) {
return HttpMethod.PUT;
} else if (method.getAnnotation(javax.ws.rs.OPTIONS.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.OPTIONS.class) != null) {
return HttpMethod.OPTIONS;
} else if (method.getAnnotation(javax.ws.rs.DELETE.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.DELETE.class) != null) {
return HttpMethod.DELETE;
} else if (method.getAnnotation(javax.ws.rs.HEAD.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.HEAD.class) != null) {
return HttpMethod.HEAD;
}
assert false;

View File

@ -7,9 +7,9 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.*;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
@ -18,8 +18,8 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#appName}}

View File

@ -17,8 +17,8 @@ import org.openapitools.codegen.utils.JsonCache;
import org.openapitools.codegen.utils.JsonCache.CacheException;
{{/loadTestDataFromFile}}
{{/generateOperationBody}}
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.*;
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.model.wadl.Description;
import org.apache.cxf.jaxrs.model.wadl.DocTarget;

View File

@ -8,8 +8,8 @@ import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.ClientConfiguration;
import org.apache.cxf.jaxrs.client.WebClient;
@ -47,10 +47,10 @@ import java.io.File;
{{^fullJavaUtil}}
import java.util.Set;
{{/fullJavaUtil}}
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import {{javaxPackage}}.validation.ConstraintViolation;
import {{javaxPackage}}.validation.Validation;
import {{javaxPackage}}.validation.Validator;
import {{javaxPackage}}.validation.ValidatorFactory;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.junit.BeforeClass;

View File

@ -1 +1 @@
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -6,8 +6,8 @@ package {{package}};
import java.io.Serializable;
{{/serializableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#models}}

View File

@ -1,12 +1,12 @@
import io.swagger.annotations.ApiModelProperty;
{{#withXml}}
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import {{javaxPackage}}.xml.bind.annotation.XmlElement;
import {{javaxPackage}}.xml.bind.annotation.XmlRootElement;
import {{javaxPackage}}.xml.bind.annotation.XmlAccessType;
import {{javaxPackage}}.xml.bind.annotation.XmlAccessorType;
import {{javaxPackage}}.xml.bind.annotation.XmlType;
import {{javaxPackage}}.xml.bind.annotation.XmlEnum;
import {{javaxPackage}}.xml.bind.annotation.XmlEnumValue;
{{/withXml}}
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -5,8 +5,8 @@ import java.lang.reflect.Method;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.Path;
import {{javaxPackage}}.ws.rs.HttpMethod;
import {{javaxPackage}}.ws.rs.Path;
import org.apache.cxf.jaxrs.ext.ResourceComparator;
import org.apache.cxf.jaxrs.model.ClassResourceInfo;
@ -60,7 +60,7 @@ public class CXFInterfaceComparator implements ResourceComparator {
Method[] methods = cri.getServiceClass().getInterfaces()[0].getMethods();
// Java reflexion. Check all the methods of an interface.
for (Method method : methods) {
Path pathAnnotation = method.getAnnotation(javax.ws.rs.Path.class);
Path pathAnnotation = method.getAnnotation({{javaxPackage}}.ws.rs.Path.class);
if (pathAnnotation != null && pathAnnotation.value() != null) {
String pathValue = pathAnnotation.value();
String methodHttpVerb = getMethodHttpVerb(method);
@ -79,17 +79,17 @@ public class CXFInterfaceComparator implements ResourceComparator {
}
private static String getMethodHttpVerb(Method method) {
if (method.getAnnotation(javax.ws.rs.POST.class) != null) {
if (method.getAnnotation({{javaxPackage}}.ws.rs.POST.class) != null) {
return HttpMethod.POST;
} else if (method.getAnnotation(javax.ws.rs.GET.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.GET.class) != null) {
return HttpMethod.GET;
} else if (method.getAnnotation(javax.ws.rs.PUT.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.PUT.class) != null) {
return HttpMethod.PUT;
} else if (method.getAnnotation(javax.ws.rs.OPTIONS.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.OPTIONS.class) != null) {
return HttpMethod.OPTIONS;
} else if (method.getAnnotation(javax.ws.rs.DELETE.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.DELETE.class) != null) {
return HttpMethod.DELETE;
} else if (method.getAnnotation(javax.ws.rs.HEAD.class) != null) {
} else if (method.getAnnotation({{javaxPackage}}.ws.rs.HEAD.class) != null) {
return HttpMethod.HEAD;
}
assert false;

View File

@ -7,9 +7,9 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.*;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
@ -18,8 +18,8 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#appName}}

View File

@ -8,8 +8,8 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.*;
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.model.wadl.Description;
import org.apache.cxf.jaxrs.model.wadl.DocTarget;

View File

@ -8,7 +8,7 @@ import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.ClientConfiguration;
import org.apache.cxf.jaxrs.client.WebClient;

View File

@ -1 +1 @@
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -6,8 +6,8 @@ package {{package}};
import java.io.Serializable;
{{/serializableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#models}}

View File

@ -1,13 +1,13 @@
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;
{{#withXml}}
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import {{javaxPackage}}.xml.bind.annotation.XmlElement;
import {{javaxPackage}}.xml.bind.annotation.XmlRootElement;
import {{javaxPackage}}.xml.bind.annotation.XmlAccessType;
import {{javaxPackage}}.xml.bind.annotation.XmlAccessorType;
import {{javaxPackage}}.xml.bind.annotation.XmlType;
import {{javaxPackage}}.xml.bind.annotation.XmlEnum;
import {{javaxPackage}}.xml.bind.annotation.XmlEnumValue;
{{/withXml}}
import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -1 +1 @@
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})

View File

@ -8,9 +8,9 @@ import com.fasterxml.jackson.datatype.jsr310.*;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.Produces;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.ext.Provider;
@Provider
@Produces({MediaType.APPLICATION_JSON})

View File

@ -4,13 +4,13 @@ import com.sun.jersey.core.spi.component.ComponentContext;
import com.sun.jersey.spi.inject.Injectable;
import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.QueryParam;
import {{javaxPackage}}.ws.rs.WebApplicationException;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.core.UriInfo;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.time.LocalDate;
import java.util.List;

View File

@ -4,13 +4,13 @@ import com.sun.jersey.core.spi.component.ComponentContext;
import com.sun.jersey.spi.inject.Injectable;
import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.QueryParam;
import {{javaxPackage}}.ws.rs.WebApplicationException;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.Response.Status;
import {{javaxPackage}}.ws.rs.core.UriInfo;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.time.OffsetDateTime;
import java.util.List;

View File

@ -19,13 +19,13 @@ import java.io.InputStream;
import com.sun.jersey.multipart.FormDataParam;
import com.sun.jersey.multipart.FormDataBodyPart;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.*;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
@Path("{{commonPath}}")

View File

@ -16,10 +16,10 @@ import java.io.InputStream;
import com.sun.jersey.multipart.FormDataParam;
import com.sun.jersey.multipart.FormDataBodyPart;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
{{>generatedAnnotation}}
{{#operations}}

View File

@ -16,10 +16,10 @@ import java.io.InputStream;
import com.sun.jersey.multipart.FormDataParam;
import com.sun.jersey.multipart.FormDataBodyPart;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import {{javaxPackage}}.validation.constraints.*;
{{/useBeanValidation}}
{{>generatedAnnotation}}
{{#operations}}

View File

@ -1,8 +1,8 @@
package {{apiPackage}};
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ParamConverter;
import {{javaxPackage}}.ws.rs.ext.ParamConverterProvider;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.time.LocalDate;

View File

@ -1,8 +1,8 @@
package {{apiPackage}};
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ParamConverter;
import {{javaxPackage}}.ws.rs.ext.ParamConverterProvider;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.time.OffsetDateTime;

View File

@ -12,8 +12,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.io.Serializable;
{{/serializableModel}}
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#models}}

View File

@ -2,11 +2,11 @@ package {{apiPackage}};
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import {{javaxPackage}}.servlet.*;
import {{javaxPackage}}.servlet.http.HttpServletResponse;
{{>generatedAnnotation}}
public class ApiOriginFilter implements javax.servlet.Filter {
public class ApiOriginFilter implements {{javaxPackage}}.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;

View File

@ -1,8 +1,8 @@
package {{apiPackage}};
import javax.xml.bind.annotation.XmlTransient;
import {{javaxPackage}}.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement
@{{javaxPackage}}.xml.bind.annotation.XmlRootElement
{{>generatedAnnotation}}
public class ApiResponseMessage {
public static final int ERROR = 1;

View File

@ -3,8 +3,8 @@ package {{invokerPackage}};
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ContextResolver;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.io.IOException;
@Provider

View File

@ -1,13 +1,13 @@
package {{apiPackage}};
import org.joda.time.DateTime;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ParamConverter;
import {{javaxPackage}}.ws.rs.ext.ParamConverterProvider;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.WebApplicationException;
import {{javaxPackage}}.ws.rs.core.Response;
@Provider

View File

@ -1,13 +1,13 @@
package {{apiPackage}};
import org.joda.time.LocalDate;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ParamConverter;
import {{javaxPackage}}.ws.rs.ext.ParamConverterProvider;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.WebApplicationException;
import {{javaxPackage}}.ws.rs.core.Response;
@Provider

View File

@ -1,9 +1,9 @@
package {{apiPackage}};
import java.time.LocalDate;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ParamConverter;
import {{javaxPackage}}.ws.rs.ext.ParamConverterProvider;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

View File

@ -1,9 +1,9 @@
package {{apiPackage}};
import java.time.OffsetDateTime;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.ext.ParamConverter;
import {{javaxPackage}}.ws.rs.ext.ParamConverterProvider;
import {{javaxPackage}}.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

View File

@ -1,7 +1,7 @@
package {{invokerPackage}};
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import {{javaxPackage}}.ws.rs.ApplicationPath;
import {{javaxPackage}}.ws.rs.core.Application;
@ApplicationPath("{{{contextPath}}}")
public class RestApplication extends Application {

View File

@ -15,15 +15,15 @@ import {{package}}.NotFoundException;
import java.io.InputStream;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.*;
import javax.inject.Inject;
import {{javaxPackage}}.ws.rs.core.Context;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.*;
import {{javaxPackage}}.inject.Inject;
{{#useBeanValidation}}
import javax.validation.constraints.*;
import javax.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
{{/isMultipart}}{{/operation}}{{/operations}}

View File

@ -13,8 +13,8 @@ import {{package}}.NotFoundException;
import java.io.InputStream;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
{{>generatedAnnotation}}
{{#operations}}

View File

@ -13,9 +13,9 @@ import {{package}}.NotFoundException;
import java.io.InputStream;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import {{javaxPackage}}.enterprise.context.RequestScoped;
import {{javaxPackage}}.ws.rs.core.Response;
import {{javaxPackage}}.ws.rs.core.SecurityContext;
@RequestScoped
{{>generatedAnnotation}}

View File

@ -1,9 +1,9 @@
package {{invokerPackage}};
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import {{javaxPackage}}.ws.rs.Produces;
import {{javaxPackage}}.ws.rs.core.MediaType;
import {{javaxPackage}}.ws.rs.ext.ContextResolver;
import {{javaxPackage}}.ws.rs.ext.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Some files were not shown because too many files have changed in this diff Show More