Add microprofile OpenApi annotations to JavaRxSpec (quarkus library). Add OpenID support (core) (#15407)

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

* Issue #795: Add microprofile OpenAPI annotations for quarkus library in JaxRsSpec

---------

Co-authored-by: Nuno Borges <Nuno.Borges@ctw.bmwgroup.com>
This commit is contained in:
Nuno Miguel Micaelo Borges 2023-05-09 17:55:41 +01:00 committed by GitHub
parent c251202869
commit 4e27041bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 14032 additions and 31 deletions

View File

@ -38,6 +38,7 @@ jobs:
- samples/server/petstore/jaxrs-cxf-annotated-base-path
- samples/server/petstore/jaxrs-cxf-cdi
- samples/server/petstore/jaxrs-cxf-non-spring-app
- samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3

View File

@ -0,0 +1,13 @@
generatorName: jaxrs-spec
outputDir: samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
additionalProperties:
artifactId: jaxrs-spec-petstore-server
serializableModel: "true"
hideGenerationTimestamp: "true"
implicitHeadersRegex: (api_key|enum_header_string)
generateBuilders: "true"
useMicroProfileOpenAPIAnnotations: "true"
library: "quarkus"
dateLibrary: "java8-localdatetime"

View File

@ -78,6 +78,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false|
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|
|useTags|use tags for creating interface and controller classnames| |false|

View File

@ -78,6 +78,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false|
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|
|useTags|use tags for creating interface and controller classnames| |false|

View File

@ -259,6 +259,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
this.isBooleanSchemaFalse = isBooleanSchemaFalse;
}
public String getOpenApiType() { return openApiType; }
public String getBaseName() {
return baseName;
}

View File

@ -25,9 +25,10 @@ import java.util.Objects;
public class CodegenSecurity {
public String name;
public String description;
public String type;
public String scheme;
public Boolean isBasic, isOAuth, isApiKey;
public Boolean isBasic, isOAuth, isApiKey, isOpenId;
// is Basic is true for all http authentication type.
// Those are to differentiate basic and bearer authentication
// isHttpSignature is to support HTTP signature authorization scheme.
@ -42,12 +43,15 @@ public class CodegenSecurity {
public String flow, authorizationUrl, tokenUrl, refreshUrl;
public List<Map<String, Object>> scopes;
public Boolean isCode, isPassword, isApplication, isImplicit;
// OpenId specific
public String openIdConnectUrl;
// Return a copy of the security object, filtering out any scopes from the passed-in list.
public CodegenSecurity filterByScopeNames(List<String> filterScopes) {
CodegenSecurity filteredSecurity = new CodegenSecurity();
// Copy all fields except the scopes.
filteredSecurity.name = name;
filteredSecurity.description = description;
filteredSecurity.type = type;
filteredSecurity.isBasic = isBasic;
filteredSecurity.isBasicBasic = isBasicBasic;
@ -67,6 +71,7 @@ public class CodegenSecurity {
filteredSecurity.tokenUrl = tokenUrl;
filteredSecurity.authorizationUrl = authorizationUrl;
filteredSecurity.refreshUrl = refreshUrl;
filteredSecurity.openIdConnectUrl = openIdConnectUrl;
// It is not possible to deep copy the extensions, as we have no idea what types they are.
// So the filtered method *will* refer to the original extensions, if any.
filteredSecurity.vendorExtensions = new HashMap<String, Object>(vendorExtensions);
@ -93,6 +98,7 @@ public class CodegenSecurity {
if (o == null || getClass() != o.getClass()) return false;
CodegenSecurity that = (CodegenSecurity) o;
return Objects.equals(name, that.name) &&
Objects.equals(description, that.description) &&
Objects.equals(type, that.type) &&
Objects.equals(scheme, that.scheme) &&
Objects.equals(isBasic, that.isBasic) &&
@ -115,22 +121,25 @@ public class CodegenSecurity {
Objects.equals(isCode, that.isCode) &&
Objects.equals(isPassword, that.isPassword) &&
Objects.equals(isApplication, that.isApplication) &&
Objects.equals(isImplicit, that.isImplicit);
Objects.equals(isImplicit, that.isImplicit) &&
Objects.equals(openIdConnectUrl, that.openIdConnectUrl);
}
@Override
public int hashCode() {
return Objects.hash(name, type, scheme, isBasic, isOAuth, isApiKey,
return Objects.hash(name, description, type, scheme, isBasic, isOAuth, isApiKey,
isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions,
keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow,
authorizationUrl, tokenUrl, refreshUrl, scopes, isCode, isPassword, isApplication, isImplicit);
authorizationUrl, tokenUrl, refreshUrl, scopes, isCode, isPassword, isApplication, isImplicit,
openIdConnectUrl);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("CodegenSecurity{");
sb.append("name='").append(name).append('\'');
sb.append("description='").append(description).append('\'');
sb.append(", type='").append(type).append('\'');
sb.append(", scheme='").append(scheme).append('\'');
sb.append(", isBasic=").append(isBasic);
@ -154,6 +163,7 @@ public class CodegenSecurity {
sb.append(", isPassword=").append(isPassword);
sb.append(", isApplication=").append(isApplication);
sb.append(", isImplicit=").append(isImplicit);
sb.append(", openIdConnectUrl=").append(openIdConnectUrl);
sb.append('}');
return sb.toString();
}

View File

@ -5321,6 +5321,11 @@ public class DefaultCodegen implements CodegenConfig {
once(LOGGER).warn("Unknown scheme `{}` found in the HTTP security definition.", securityScheme.getScheme());
}
codegenSecurities.add(cs);
} else if (SecurityScheme.Type.OPENIDCONNECT.equals(securityScheme.getType())) {
final CodegenSecurity cs = defaultCodegenSecurity(key, securityScheme);
cs.isOpenId = true;
cs.openIdConnectUrl = securityScheme.getOpenIdConnectUrl();
codegenSecurities.add(cs);
} else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) {
final OAuthFlows flows = securityScheme.getFlows();
boolean isFlowEmpty = true;
@ -5374,8 +5379,9 @@ public class DefaultCodegen implements CodegenConfig {
private CodegenSecurity defaultCodegenSecurity(String key, SecurityScheme securityScheme) {
final CodegenSecurity cs = CodegenModelFactory.newInstance(CodegenModelType.SECURITY);
cs.name = key;
cs.description = securityScheme.getDescription();
cs.type = securityScheme.getType().toString();
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false;
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = false;
cs.isHttpSignature = false;
cs.isBasicBasic = cs.isBasicBearer = false;
cs.scheme = securityScheme.getScheme();

View File

@ -608,6 +608,20 @@ public class DefaultGenerator implements Generator {
operation.put("basePathWithoutHost", removeTrailingSlash(config.encodePath(url.getPath())));
operation.put("contextPath", contextPath);
operation.put("baseName", tag);
Optional.ofNullable(openAPI.getTags()).orElseGet(Collections::emptyList).stream()
.map(Tag::getName)
.filter(Objects::nonNull)
.filter(tag::equalsIgnoreCase)
.findFirst()
.ifPresent(tagName -> operation.put("operationTagName", config.escapeText(tagName)));
operation.put("operationTagDescription", "");
Optional.ofNullable(openAPI.getTags()).orElseGet(Collections::emptyList).stream()
.filter(t -> tag.equalsIgnoreCase(t.getName()))
.map(Tag::getDescription)
.filter(Objects::nonNull)
.findFirst()
.ifPresent(description -> operation.put("operationTagDescription", config.escapeText(description)));
Optional.ofNullable(config.additionalProperties().get("appVersion")).ifPresent(version -> operation.put("version", version));
operation.put("apiPackage", config.apiPackage());
operation.put("modelPackage", config.modelPackage());
operation.putAll(config.additionalProperties());
@ -616,6 +630,8 @@ public class DefaultGenerator implements Generator {
operation.put("importPath", config.toApiImport(tag));
operation.put("classFilename", config.toApiFilename(tag));
operation.put("strictSpecBehavior", config.isStrictSpecBehavior());
Optional.ofNullable(openAPI.getInfo()).map(Info::getLicense).ifPresent(license -> operation.put("license", license));
Optional.ofNullable(openAPI.getInfo()).map(Info::getContact).ifPresent(contact -> operation.put("contact", contact));
if (allModels == null || allModels.isEmpty()) {
operation.put("hasModel", false);

View File

@ -44,6 +44,22 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
* Mustache template for the JAX-RS Codegen.
*/
protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS";
protected static final String X_MICROPROFILE_OPEN_API_RETURN_SCHEMA_CONTAINER = "x-microprofile-open-api-return-schema-container";
protected static final String X_MICROPROFILE_OPEN_API_RETURN_UNIQUE_ITEMS = "x-microprofile-open-api-return-unique-items";
protected static final String X_MICROPROFILE_OPEN_API_SCHEMA_TYPE = "x-microprofile-open-api-schema-type";
protected static final String SCHEMA_TYPE_ARRAY = "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY";
protected static final Map<String,String> ARRAY_OF_MICROPROFILE_OPEN_API_SCHEMA_TYPES;
static {
final Map<String, String> schemaTypes = new HashMap<>();
schemaTypes.put("integer", "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.INTEGER");
schemaTypes.put("number", "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.NUMBER");
schemaTypes.put("boolean", "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.BOOLEAN");
schemaTypes.put("string", "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.STRING");
schemaTypes.put("object", "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.OBJECT");
schemaTypes.put("array", "org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY");
ARRAY_OF_MICROPROFILE_OPEN_API_SCHEMA_TYPES = Collections.unmodifiableMap(schemaTypes);
}
protected String implFolder = "src/main/java";
protected String testResourcesFolder = "src/test/resources";
protected String title = "OpenAPI Server";
@ -233,11 +249,18 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
if ("array".equals(resp.containerType)) {
resp.containerType = "List";
resp.vendorExtensions.put(X_MICROPROFILE_OPEN_API_RETURN_SCHEMA_CONTAINER, SCHEMA_TYPE_ARRAY);
} else if ("set".equals(resp.containerType)) {
resp.containerType = "Set";
resp.vendorExtensions.put(X_MICROPROFILE_OPEN_API_RETURN_SCHEMA_CONTAINER, SCHEMA_TYPE_ARRAY);
resp.vendorExtensions.put(X_MICROPROFILE_OPEN_API_RETURN_UNIQUE_ITEMS, true);
} else if ("map".equals(resp.containerType)) {
resp.containerType = "Map";
}
if (resp.getResponseHeaders() != null) {
handleHeaders(resp.getResponseHeaders());
}
}
}
@ -271,6 +294,17 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
return objs;
}
private static void handleHeaders(List<CodegenParameter> headers) {
for (CodegenParameter header : headers) {
if (header.getSchema() != null && header.getSchema().getOpenApiType() != null) {
final String schemaType = ARRAY_OF_MICROPROFILE_OPEN_API_SCHEMA_TYPES.get(header.getSchema().getOpenApiType());
if (schemaType != null) {
header.vendorExtensions.put(X_MICROPROFILE_OPEN_API_SCHEMA_TYPE, schemaType);
}
}
}
}
@Override
public String toApiName(final String name) {
String computed = name;

View File

@ -33,6 +33,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
public static final String RETURN_RESPONSE = "returnResponse";
public static final String GENERATE_POM = "generatePom";
public static final String USE_SWAGGER_ANNOTATIONS = "useSwaggerAnnotations";
public static final String USE_MICROPROFILE_OPENAPI_ANNOTATIONS = "useMicroProfileOpenAPIAnnotations";
public static final String OPEN_API_SPEC_FILE_LOCATION = "openApiSpecFileLocation";
public static final String GENERATE_BUILDERS = "generateBuilders";
@ -47,6 +48,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
private boolean generatePom = true;
private boolean generateBuilders = false;
private boolean useSwaggerAnnotations = true;
private boolean useMicroProfileOpenAPIAnnotations = false;
protected boolean useGzipFeature = false;
private boolean useJackson = false;
@ -105,6 +107,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly)));
cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse)));
cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations));
cliOptions.add(CliOption.newBoolean(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, "Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.", useMicroProfileOpenAPIAnnotations));
cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string."));
cliOptions.add(CliOption.newBoolean(SUPPORT_ASYNC, "Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).", supportAsync));
}
@ -147,6 +150,14 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
}
writePropertyBack(USE_SWAGGER_ANNOTATIONS, useSwaggerAnnotations);
if (QUARKUS_LIBRARY.equals(library)) {
if (additionalProperties.containsKey(USE_MICROPROFILE_OPENAPI_ANNOTATIONS)) {
useMicroProfileOpenAPIAnnotations = Boolean.parseBoolean(additionalProperties.get(USE_MICROPROFILE_OPENAPI_ANNOTATIONS).toString());
}
writePropertyBack(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, useMicroProfileOpenAPIAnnotations);
}
if (additionalProperties.containsKey(GENERATE_BUILDERS)) {
generateBuilders = Boolean.parseBoolean(additionalProperties.get(GENERATE_BUILDERS).toString());
}

View File

@ -2,7 +2,15 @@ package {{invokerPackage}};
import {{javaxPackage}}.ws.rs.ApplicationPath;
import {{javaxPackage}}.ws.rs.core.Application;
{{#useMicroProfileOpenAPIAnnotations}}{{#openAPI}}{{#info}}
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
version="{{{appVersion}}}"
{{#appName}},title = "{{{.}}}"{{/appName}}
{{#appDescription}},description = "{{{.}}}"{{/appDescription}}
{{#license}},license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "{{{licenseInfo}}}", url = "{{{licenseUrl}}}"){{/license}}
{{#contact}},contact = @org.eclipse.microprofile.openapi.annotations.info.Contact(name = "{{{infoName}}}", email = "{{{infoEmail}}}"){{/contact}}
)){{/info}}{{/openAPI}}{{/useMicroProfileOpenAPIAnnotations}}
@ApplicationPath(RestResourceRoot.APPLICATION_PATH)
public class RestApplication extends Application {

View File

@ -1 +1 @@
{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}}
{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}{{#description}} @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="{{.}}"){{/description}}{{/useMicroProfileOpenAPIAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}}

View File

@ -1 +1 @@
{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isHeaderParam}}
{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}{{#description}} @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="{{.}}"){{/description}}{{/useMicroProfileOpenAPIAnnotations}} {{{dataType}}} {{paramName}}{{/isHeaderParam}}

View File

@ -13,6 +13,7 @@ import org.jboss.resteasy.annotations.GZIP;
{{#useSwaggerAnnotations}}
import io.swagger.annotations.*;
{{/useSwaggerAnnotations}}
{{#supportAsync}}
import java.util.concurrent.CompletionStage;
import java.util.concurrent.CompletableFuture;
@ -24,8 +25,73 @@ import java.util.List;
{{#useBeanValidation}}import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;{{/useBeanValidation}}
@Path("{{commonPath}}"){{#useSwaggerAnnotations}}
@Api(description = "the {{{baseName}}} API"){{/useSwaggerAnnotations}}{{#hasConsumes}}
{{#useMicroProfileOpenAPIAnnotations}}@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "{{{operationTagName}}}", version="{{{version}}}", description="{{{operationTagDescription}}}"{{#license}},
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "{{{licenseInfo}}}", url = "{{{licenseUrl}}}"){{/license}}{{#contact}},
contact = @org.eclipse.microprofile.openapi.annotations.info.Contact(name = "{{{infoName}}}", email = "{{{infoEmail}}}"){{/contact}}
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="{{{operationTagName}}}", description="{{{operationTagDescription}}}")
){{#hasAuthMethods}}
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="{{{operationTagName}}}", description="{{{operationTagDescription}}}")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
{{#authMethods}}{{#isOAuth}}@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "{{name}}",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "{{description}}",{{#isImplicit}}
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "{{authorizationUrl}}",
tokenUrl = "{{tokenUrl}}",
refreshUrl = "{{refreshUrl}}",
scopes = {
{{#scopes}}@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
{{/scopes}} })) {{/isImplicit}}{{#isCode}}
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
authorizationCode = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "{{authorizationUrl}}",
tokenUrl = "{{tokenUrl}}",
refreshUrl = "{{refreshUrl}}",
scopes = {
{{#scopes}}@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
{{/scopes}} })) {{/isCode}}{{#isPassword}}
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
password = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "{{authorizationUrl}}",
tokenUrl = "{{tokenUrl}}",
refreshUrl = "{{refreshUrl}}",
scopes = {
{{#scopes}}@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
{{/scopes}} })) {{/isPassword}}{{#isApplication}}
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
clientCredentials = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "{{authorizationUrl}}",
tokenUrl = "{{tokenUrl}}",
refreshUrl = "{{refreshUrl}}",
scopes = {
{{#scopes}}@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
{{/scopes}} })){{/isApplication}}
){{^-last}}, {{/-last}}{{/isOAuth}}{{#isApiKey}}@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "{{name}}",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "{{description}}",
apiKeyName = "{{keyParamName}}",
{{#isKeyInHeader}}in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER{{/isKeyInHeader}}{{#isKeyInQuery}}in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY{{/isKeyInQuery}}{{#isKeyInCookie}}in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.COOKIE{{/isKeyInCookie}}
){{^-last}}, {{/-last}}{{/isApiKey}}{{#isBasicBasic}}@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "{{name}}",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "{{description}}",
scheme = "basic"
){{^-last}}, {{/-last}}{{/isBasicBasic}}{{#isBasicBearer}}@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "{{name}}",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "{{description}}",
scheme = "bearer", bearerFormat = "{{bearerFormat}}"
){{^-last}}, {{/-last}}{{/isBasicBearer}}{{#isOpenId}}@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "{{name}}",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OPENIDCONNECT,
description = "{{description}}",
openIdConnectUrl = "{{openIdConnectUrl}}"
){{^-last}}, {{/-last}}{{/isOpenId}}{{/authMethods}}
}){{/hasAuthMethods}}{{/useMicroProfileOpenAPIAnnotations}}{{#useSwaggerAnnotations}}
@Api(description = "the {{{baseName}}} API"){{/useSwaggerAnnotations}}
@Path("{{commonPath}}"){{#hasConsumes}}
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}
{{>generatedAnnotation}}

View File

@ -19,5 +19,26 @@
})
{{/implicitHeadersParams.0}}
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
{{#hasAuthMethods}}@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value = {
{{#authMethods}}{{#isOAuth}}@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(
name = "{{name}}",
scopes = { {{#scopes}} "{{scope}}"{{^-last}},{{/-last}} {{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}}{{^isOAuth}} @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "{{name}}"){{^-last}},{{/-last}}{{/isOAuth}}
{{/authMethods}} }){{/hasAuthMethods}}
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "{{{operationId}}}", summary = "{{{summary}}}", description = "{{{notes}}}")
{{#vendorExtensions.x-tags}}@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="{{tag}}"){{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}}{{#hasProduces}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { {{#responses}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "{{{code}}}", description = "{{{message}}}", {{#responseHeaders.0}}headers = { {{#responseHeaders}}
@org.eclipse.microprofile.openapi.annotations.headers.Header(name = "{{{baseName}}}", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = {{{vendorExtensions.x-microprofile-open-api-schema-type}}}), description = "{{{description}}}"){{^-last}},{{/-last}}{{/responseHeaders}}
},{{/responseHeaders.0}} content = { {{#produces}}
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType = "{{{mediaType}}}"{{^vendorExtensions.x-java-is-response-void}}, schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}}){{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/produces}}
}){{^-last}},{{/-last}}{{/responses}}
}){{/hasProduces}}{{^hasProduces}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { {{#responses}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "{{{code}}}", description = "{{{message}}}", {{#responseHeaders.0}}headers = { {{#responseHeaders}}
@org.eclipse.microprofile.openapi.annotations.headers.Header(name = "{{{baseName}}}", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = {{{vendorExtensions.x-microprofile-open-api-schema-type}}}), description = "{{{description}}}"){{^-last}},{{/-last}}{{/responseHeaders}}
},{{/responseHeaders.0}} content = {
{{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}}
}){{^-last}},{{/-last}}{{/responses}}
}){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}}
{{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}});

View File

@ -20,7 +20,26 @@
{{/implicitHeadersParams.0}}
@ApiResponses(value = { {{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}
}){{/useSwaggerAnnotations}}
}){{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
{{#hasAuthMethods}}@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
{{#authMethods}}{{#isOAuth}}@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "{{name}}", scopes = { {{#scopes}} "{{scope}}"{{^-last}},{{/-last}} {{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}}{{^isOAuth}} @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "{{name}}"){{^-last}},{{/-last}}{{/isOAuth}}
{{/authMethods}} }){{/hasAuthMethods}}
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "{{{operationId}}}", summary = "{{{summary}}}", description = "{{{notes}}}")
{{#vendorExtensions.x-tags}}@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="{{tag}}"){{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}}{{#hasProduces}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { {{#responses}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "{{{code}}}", description = "{{{message}}}", {{#responseHeaders.0}}headers = { {{#responseHeaders}}
@org.eclipse.microprofile.openapi.annotations.headers.Header(name = "{{{baseName}}}", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = {{{vendorExtensions.x-microprofile-open-api-schema-type}}}), description = "{{{description}}}"){{^-last}},{{/-last}}{{/responseHeaders}}
},{{/responseHeaders.0}} content = { {{#produces}}
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="{{{mediaType}}}"{{^vendorExtensions.x-java-is-response-void}}, schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}}){{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/produces}}
}){{^-last}},{{/-last}}{{/responses}}
}){{/hasProduces}}{{^hasProduces}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { {{#responses}}
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "{{{code}}}", description = "{{{message}}}", {{#responseHeaders.0}}headers = { {{#responseHeaders}}
@org.eclipse.microprofile.openapi.annotations.headers.Header(name = "{{{baseName}}}", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = {{{vendorExtensions.x-microprofile-open-api-schema-type}}}), description = "{{{description}}}"){{^-last}},{{/-last}}{{/responseHeaders}}
},{{/responseHeaders.0}} content = {
{{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}}
}){{^-last}},{{/-last}}{{/responses}}
}){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}}
public {{#supportAsync}}CompletionStage<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) {
return {{#supportAsync}}CompletableFuture.supplyAsync(() -> {{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}};
}

View File

@ -22,11 +22,28 @@
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
{{#useJakartaEe}}
<quarkus-plugin.version>3.0.1.Final</quarkus-plugin.version>
<quarkus.platform.version>3.0.1.Final</quarkus.platform.version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<quarkus-plugin.version>1.1.1.Final</quarkus-plugin.version>
<quarkus.platform.version>1.1.1.Final</quarkus.platform.version>
{{/useJakartaEe}}
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.1.1.Final</quarkus.platform.version>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
{{#useJakartaEe}}
<jakarta.ws.rs-version>3.1.0</jakarta.ws.rs-version>
<jakarta.annotation-api-version>2.1.1</jakarta.annotation-api-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<javax.ws.rs-version>2.1.1</javax.ws.rs-version>
<javax.annotation-api-version>1.3.2</javax.annotation-api-version>
{{/useJakartaEe}}
{{#useSwaggerAnnotations}}
<io.swagger.annotations.version>1.6.10</io.swagger.annotations.version>
{{/useSwaggerAnnotations}}
</properties>
<dependencyManagement>
<dependencies>
@ -58,6 +75,40 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
{{#useJakartaEe}}
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${jakarta.ws.rs-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation-api-version}</version>
</dependency>
{{/useJakartaEe}}
{{^useJakartaEe}}
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation-api-version}</version>
</dependency>
{{/useJakartaEe}}
{{#useSwaggerAnnotations}}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${io.swagger.annotations.version}</version>
<scope>provided</scope>
</dependency>
{{/useSwaggerAnnotations}}
</dependencies>
<build>
<plugins>

View File

@ -1 +1 @@
{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}{{#description}} @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="{{.}}"){{/description}}{{/useMicroProfileOpenAPIAnnotations}} {{{dataType}}} {{paramName}}{{/isPathParam}}

View File

@ -10,7 +10,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{#description}}/**
* {{.}}
**/{{/description}}
{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}}
{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#title}}title="{{{.}}}", {{/title}}{{#description}}description="{{{.}}}"{{/description}}{{^description}}description=""{{/description}}){{/useMicroProfileOpenAPIAnnotations}}
@JsonTypeName("{{name}}")
{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}
{{#vendorExtensions.x-class-extra-annotation}}
@ -68,7 +69,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
}
{{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}}{{#useSwaggerAnnotations}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}description = "{{{description}}}"){{/useMicroProfileOpenAPIAnnotations}}
@JsonProperty("{{baseName}}")
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{>beanValidatedType}} {{getter}}() {
return {{name}};

View File

@ -1 +1 @@
{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isQueryParam}}
{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}{{#description}} @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="{{.}}"){{/description}}{{/useMicroProfileOpenAPIAnnotations}} {{{dataType}}} {{paramName}}{{/isQueryParam}}

View File

@ -4170,8 +4170,13 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
List<ILoggingEvent> logsList = listAppender.list;
// JUnit assertions
assertEquals(16, logsList.size());
@ -4213,10 +4218,15 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
List<ILoggingEvent> logsList = listAppender.list;
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
// JUnit assertions
assertEquals(9, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 9, logsList.size());
assertEquals("Validation 'minItems' has no effect on schema 'object'. Ignoring!", logsList.get(0)
.getMessage());
assertEquals("Validation 'maxItems' has no effect on schema 'object'. Ignoring!", logsList.get(1)
@ -4257,10 +4267,15 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
List<ILoggingEvent> logsList = listAppender.list;
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
// JUnit assertions
assertEquals(8, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()),8, logsList.size());
assertEquals("Validation 'minItems' has no effect on schema 'string'. Ignoring!", logsList.get(0)
.getMessage());
assertEquals("Validation 'maxItems' has no effect on schema 'string'. Ignoring!", logsList.get(1)
@ -4299,10 +4314,15 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
List<ILoggingEvent> logsList = listAppender.list;
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
// JUnit assertions
assertEquals(8, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()),8, logsList.size());
assertEquals("Validation 'minItems' has no effect on schema 'integer'. Ignoring!", logsList.get(0)
.getMessage());
assertEquals("Validation 'maxItems' has no effect on schema 'integer'. Ignoring!", logsList.get(1)
@ -4341,10 +4361,15 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
List<ILoggingEvent> logsList = listAppender.list;
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
// JUnit assertions
assertEquals(0, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()),0, logsList.size());
}
@Test
@ -4364,10 +4389,15 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
List<ILoggingEvent> logsList = listAppender.list;
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
// JUnit assertions
assertEquals(11, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 11, logsList.size());
assertEquals("Validation 'minItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(0)
.getMessage());
assertEquals("Validation 'maxItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(1)
@ -4412,10 +4442,15 @@ public class DefaultCodegenTest {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);
List<ILoggingEvent> logsList = listAppender.list;
listAppender.stop();
testLogger.detachAppender(listAppender);
List<ILoggingEvent> logsList = new ArrayList<>(listAppender.list).stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());
// JUnit assertions
assertEquals(0, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 0, logsList.size());
}
public static class FromParameter {

View File

@ -795,4 +795,96 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
.containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"requiredYesReadonlyNo\""))
.containsWithName("NotNull");
}
@Test
public void generateSpecInterfaceWithMicroprofileOpenApiAnnotations() throws Exception {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/petstore.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated
codegen.additionalProperties().put(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, true); //And only interfaces are generated
codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in several API files
codegen.additionalProperties().put(RETURN_RESPONSE, true); // Retrieve HTTP Response
codegen.additionalProperties().put(USE_JAKARTA_EE, true); // Use Jakarta
codegen.setLibrary(QUARKUS_LIBRARY); // Set Quarkus
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated interfaces contains CompletionStage
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"),
"@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(\n" +
" info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" +
" title = \"pet\", version=\"1.0.0\", description=\"Everything about your Pets\",");
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/StoreApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/StoreApi.java"),
"@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(\n" +
" info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" +
" title = \"store\", version=\"1.0.0\", description=\"Access to Petstore orders\",");
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/UserApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/UserApi.java"),
"@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(\n" +
" info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" +
" title = \"user\", version=\"1.0.0\", description=\"Operations about user\",");
}
@Test
public void generateSpecNonInterfaceWithMicroprofileOpenApiAnnotations() throws Exception {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/petstore.yaml", null, new ParseOptions()).getOpenAPI();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(INTERFACE_ONLY, false); //And only interfaces are generated
codegen.additionalProperties().put(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, true); //And only interfaces are generated
codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in several API files
codegen.additionalProperties().put(RETURN_RESPONSE, true); // Retrieve HTTP Response
codegen.additionalProperties().put(USE_JAKARTA_EE, true); // Use Jakarta
codegen.setLibrary(QUARKUS_LIBRARY); // Set Quarkus
final ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen); //using JavaJAXRSSpecServerCodegen
final DefaultGenerator generator = new DefaultGenerator();
final List<File> files = generator.opts(input).generate(); //When generating files
//Then the java files are compilable
validateJavaSourceFiles(files);
//And the generated interfaces contains CompletionStage
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"),
"@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(\n" +
" info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" +
" title = \"pet\", version=\"1.0.0\", description=\"Everything about your Pets\",");
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/StoreApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/StoreApi.java"),
"@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(\n" +
" info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" +
" title = \"store\", version=\"1.0.0\", description=\"Access to Petstore orders\",");
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/UserApi.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/UserApi.java"),
"@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(\n" +
" info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" +
" title = \"user\", version=\"1.0.0\", description=\"Operations about user\",");
}
}

View File

@ -1498,7 +1498,7 @@
<scala-maven-plugin.version>4.6.1</scala-maven-plugin.version>
<slf4j.version>1.7.36</slf4j.version>
<spotbugs-plugin.version>3.1.12.2</spotbugs-plugin.version>
<maven-surefire-plugin.version>3.0.0-M6</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
<openrewrite.version>7.22.0</openrewrite.version>
<swagger-parser-groupid.version>io.swagger.parser.v3</swagger-parser-groupid.version>
<swagger-parser.version>2.1.6</swagger-parser.version>

View File

@ -0,0 +1,4 @@
*
!target/*-runner
!target/*-runner.jar
!target/lib/*

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,63 @@
.dockerignore
README.md
pom.xml
src/gen/java/org/openapitools/api/AnotherFakeApi.java
src/gen/java/org/openapitools/api/FakeApi.java
src/gen/java/org/openapitools/api/FakeClassnameTestApi.java
src/gen/java/org/openapitools/api/PetApi.java
src/gen/java/org/openapitools/api/RestApplication.java
src/gen/java/org/openapitools/api/RestResourceRoot.java
src/gen/java/org/openapitools/api/StoreApi.java
src/gen/java/org/openapitools/api/UserApi.java
src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java
src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java
src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java
src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java
src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java
src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java
src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java
src/gen/java/org/openapitools/model/AdditionalPropertiesString.java
src/gen/java/org/openapitools/model/Animal.java
src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java
src/gen/java/org/openapitools/model/ArrayTest.java
src/gen/java/org/openapitools/model/BigCat.java
src/gen/java/org/openapitools/model/BigCatAllOf.java
src/gen/java/org/openapitools/model/Capitalization.java
src/gen/java/org/openapitools/model/Cat.java
src/gen/java/org/openapitools/model/CatAllOf.java
src/gen/java/org/openapitools/model/Category.java
src/gen/java/org/openapitools/model/ClassModel.java
src/gen/java/org/openapitools/model/Client.java
src/gen/java/org/openapitools/model/Dog.java
src/gen/java/org/openapitools/model/DogAllOf.java
src/gen/java/org/openapitools/model/EnumArrays.java
src/gen/java/org/openapitools/model/EnumClass.java
src/gen/java/org/openapitools/model/EnumTest.java
src/gen/java/org/openapitools/model/FileSchemaTestClass.java
src/gen/java/org/openapitools/model/FormatTest.java
src/gen/java/org/openapitools/model/HasOnlyReadOnly.java
src/gen/java/org/openapitools/model/MapTest.java
src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
src/gen/java/org/openapitools/model/Model200Response.java
src/gen/java/org/openapitools/model/ModelApiResponse.java
src/gen/java/org/openapitools/model/ModelFile.java
src/gen/java/org/openapitools/model/ModelList.java
src/gen/java/org/openapitools/model/ModelReturn.java
src/gen/java/org/openapitools/model/Name.java
src/gen/java/org/openapitools/model/NumberOnly.java
src/gen/java/org/openapitools/model/Order.java
src/gen/java/org/openapitools/model/OuterComposite.java
src/gen/java/org/openapitools/model/OuterEnum.java
src/gen/java/org/openapitools/model/Pet.java
src/gen/java/org/openapitools/model/ReadOnlyFirst.java
src/gen/java/org/openapitools/model/SpecialModelName.java
src/gen/java/org/openapitools/model/Tag.java
src/gen/java/org/openapitools/model/TypeHolderDefault.java
src/gen/java/org/openapitools/model/TypeHolderExample.java
src/gen/java/org/openapitools/model/User.java
src/gen/java/org/openapitools/model/XmlItem.java
src/main/docker/Dockerfile.jvm
src/main/docker/Dockerfile.native
src/main/openapi/openapi.yaml
src/main/resources/application.properties

View File

@ -0,0 +1,33 @@
# JAX-RS server with OpenAPI using Quarkus
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and
the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition.
The pom file is configured to use [Quarkus](https://quarkus.io/) as application server.
To start the server in dev mode, run this maven command:
```bash
mvn compile quarkus:dev
```
You can then call your server endpoints under:
```
http://localhost:8080/
```
In dev-mode, you can open Swagger-UI at:
```
http://localhost:8080/swagger-ui/
```
Read more in the [Quarkus OpenAPI guide](https://quarkus.io/guides/openapi-swaggerui-guide).

View File

@ -0,0 +1,157 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>jaxrs-spec-petstore-server</artifactId>
<name>jaxrs-spec-petstore-server</name>
<version>1.0.0</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.1.1.Final</quarkus-plugin.version>
<quarkus.platform.version>1.1.1.Final</quarkus.platform.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
<javax.ws.rs-version>2.1.1</javax.ws.rs-version>
<javax.annotation-api-version>1.3.2</javax.annotation-api-version>
<io.swagger.annotations.version>1.6.10</io.swagger.annotations.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation-api-version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${io.swagger.annotations.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemProperties>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemProperties>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,81 @@
package org.openapitools.api;
import org.openapitools.model.Client;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "", version="1.0.0", description="",
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="")
)
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "petstore_auth",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "",
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog",
tokenUrl = "",
refreshUrl = "",
scopes = {
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"),
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets")
}))
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key_query",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key_query",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "http_basic_test",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "",
scheme = "basic"
)
})
@Api(description = "the another-fake API")
@Path("/another-fake/dummy")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AnotherFakeApi {
@PATCH
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "call123testSpecialTags", summary = "To test special tags", description = "To test special tags and operation ID starting with number")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="$another-fake?")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class))
})
})
public Response call123testSpecialTags(@Valid @NotNull Client body) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -0,0 +1,375 @@
package org.openapitools.api;
import java.math.BigDecimal;
import org.openapitools.model.Client;
import java.io.File;
import org.openapitools.model.FileSchemaTestClass;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Map;
import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.OuterComposite;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "", version="1.0.0", description="",
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="")
)
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "petstore_auth",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "",
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog",
tokenUrl = "",
refreshUrl = "",
scopes = {
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"),
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets")
}))
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key_query",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key_query",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "http_basic_test",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "",
scheme = "basic"
)
})
@Api(description = "the fake API")
@Path("/fake")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class FakeApi {
@POST
@Path("/create_xml_item")
@Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" })
@ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createXmlItem", summary = "creates an XmlItem", description = "this route creates an XmlItem")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response createXmlItem(@Valid @NotNull XmlItem xmlItem) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/outer/boolean")
@Produces({ "*/*" })
@ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output boolean", response = Boolean.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterBooleanSerialize", summary = "", description = "Test serialization of outer boolean types")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output boolean", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Boolean.class))
})
})
public Response fakeOuterBooleanSerialize(@Valid Boolean body) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/outer/composite")
@Produces({ "*/*" })
@ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterCompositeSerialize", summary = "", description = "Test serialization of object with outer number type")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output composite", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = OuterComposite.class))
})
})
public Response fakeOuterCompositeSerialize(@Valid OuterComposite body) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/outer/number")
@Produces({ "*/*" })
@ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output number", response = BigDecimal.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterNumberSerialize", summary = "", description = "Test serialization of outer number types")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output number", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = BigDecimal.class))
})
})
public Response fakeOuterNumberSerialize(@Valid BigDecimal body) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/outer/string")
@Produces({ "*/*" })
@ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output string", response = String.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterStringSerialize", summary = "", description = "Test serialization of outer string types")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output string", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = String.class))
})
})
public Response fakeOuterStringSerialize(@Valid String body) {
return Response.ok().entity("magic!").build();
}
@PUT
@Path("/body-with-file-schema")
@Consumes({ "application/json" })
@ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithFileSchema", summary = "", description = "For this test, the body for this request much reference a schema named `File`.")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = {
})
})
public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass body) {
return Response.ok().entity("magic!").build();
}
@PUT
@Path("/body-with-query-params")
@Consumes({ "application/json" })
@ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithQueryParams", summary = "", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = {
})
})
public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User body) {
return Response.ok().entity("magic!").build();
}
@PATCH
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testClientModel", summary = "To test \"client\" model", description = "To test \"client\" model")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class))
})
})
public Response testClientModel(@Valid @NotNull Client body) {
return Response.ok().entity("magic!").build();
}
@POST
@Consumes({ "application/x-www-form-urlencoded" })
@ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = {
@Authorization(value = "http_basic_test")
}, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
@ApiResponse(code = 404, message = "User not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "http_basic_test")
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username supplied", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = {
})
})
public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") LocalDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) {
return Response.ok().entity("magic!").build();
}
@GET
@Consumes({ "application/x-www-form-urlencoded" })
@ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" })
@io.swagger.annotations.ApiImplicitParams({
@io.swagger.annotations.ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header")
})
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid request", response = Void.class),
@ApiResponse(code = 404, message = "Not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testEnumParameters", summary = "To test enum parameters", description = "To test enum parameters")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid request", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Not found", content = {
})
})
public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Header parameter enum test (string array)") List<String> enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string array)") List<String> enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List<String> enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) {
return Response.ok().entity("magic!").build();
}
@DELETE
@ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Something wrong", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Something wrong", content = {
})
})
public Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Integer in group parameters") Long int64Group) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/inline-additionalProperties")
@Consumes({ "application/json" })
@ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response testInlineAdditionalProperties(@Valid @NotNull Map<String, String> param) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/jsonFormData")
@Consumes({ "application/x-www-form-urlencoded" })
@ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testJsonFormData", summary = "test json serialization of form data", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) {
return Response.ok().entity("magic!").build();
}
@PUT
@Path("/test-query-parameters")
@ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testQueryParameterCollectionFormat", summary = "", description = "To test the collection format in query parameters")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = {
})
})
public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List<String> pipe,@QueryParam("ioutil") @NotNull List<String> ioutil,@QueryParam("http") @NotNull List<String> http,@QueryParam("url") @NotNull List<String> url,@QueryParam("context") @NotNull List<String> context) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/{petId}/uploadImageWithRequiredFile")
@Consumes({ "multipart/form-data" })
@Produces({ "application/json" })
@ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class))
})
})
public Response uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -0,0 +1,86 @@
package org.openapitools.api;
import org.openapitools.model.Client;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "", version="1.0.0", description="",
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="")
)
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "petstore_auth",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "",
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog",
tokenUrl = "",
refreshUrl = "",
scopes = {
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"),
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets")
}))
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key_query",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key_query",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "http_basic_test",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "",
scheme = "basic"
)
})
@Api(description = "the fake_classname_test API")
@Path("/fake_classname_test")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class FakeClassnameTestApi {
@PATCH
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = {
@Authorization(value = "api_key_query")
}, tags={ "fake_classname_tags 123#$%^" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key_query")
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testClassname", summary = "To test class name in snake case", description = "To test class name in snake case")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake_classname_tags 123#$%^")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class))
})
})
public Response testClassname(@Valid @NotNull Client body) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -0,0 +1,308 @@
package org.openapitools.api;
import java.io.File;
import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import java.util.Set;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "pet", version="1.0.0", description="Everything about your Pets",
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet", description="Everything about your Pets")
)
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet", description="Everything about your Pets")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "petstore_auth",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "",
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog",
tokenUrl = "",
refreshUrl = "",
scopes = {
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"),
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets")
}))
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key_query",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key_query",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "http_basic_test",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "",
scheme = "basic"
)
})
@Api(description = "the pet API")
@Path("/pet")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class PetApi {
@POST
@Consumes({ "application/json", "application/xml" })
@ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
@ApiResponse(code = 405, message = "Invalid input", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "addPet", summary = "Add a new pet to the store", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "405", description = "Invalid input", content = {
})
})
public Response addPet(@Valid @NotNull Pet body) {
return Response.ok().entity("magic!").build();
}
@DELETE
@Path("/{petId}")
@ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@io.swagger.annotations.ApiImplicitParams({
@io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header")
})
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deletePet", summary = "Deletes a pet", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid pet value", content = {
})
})
public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Pet id to delete") Long petId) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/findByStatus")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "findPetsByStatus", summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY )),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY ))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid status value", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Status values that need to be considered for filter") List<String> status) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/findByTags")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"),
@ApiResponse(code = 400, message = "Invalid tag value", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "findPetsByTags", summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY , uniqueItems = true )),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY , uniqueItems = true ))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid tag value", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Tags to filter by") Set<String> tags) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/{petId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
@Authorization(value = "api_key")
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ApiResponse(code = 404, message = "Pet not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key")
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getPetById", summary = "Find pet by ID", description = "Returns a single pet")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class)),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Pet not found", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) {
return Response.ok().entity("magic!").build();
}
@PUT
@Consumes({ "application/json", "application/xml" })
@ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
@ApiResponse(code = 405, message = "Validation exception", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updatePet", summary = "Update an existing pet", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Pet not found", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "405", description = "Validation exception", content = {
})
})
public Response updatePet(@Valid @NotNull Pet body) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/{petId}")
@Consumes({ "application/x-www-form-urlencoded" })
@ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "405", description = "Invalid input", content = {
})
})
public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/{petId}/uploadImage")
@Consumes({ "multipart/form-data" })
@Produces({ "application/json" })
@ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets") })
}, tags={ "pet" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" })
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "uploadFile", summary = "uploads an image", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class))
})
})
public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -0,0 +1,17 @@
package org.openapitools.api;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
version="1.0.0"
,title = "OpenAPI Petstore"
,description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\"
,license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
))
@ApplicationPath(RestResourceRoot.APPLICATION_PATH)
public class RestApplication extends Application {
}

View File

@ -0,0 +1,5 @@
package org.openapitools.api;
public class RestResourceRoot {
public static final String APPLICATION_PATH = "/v2";
}

View File

@ -0,0 +1,164 @@
package org.openapitools.api;
import java.util.Map;
import org.openapitools.model.Order;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "store", version="1.0.0", description="Access to Petstore orders",
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store", description="Access to Petstore orders")
)
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store", description="Access to Petstore orders")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "petstore_auth",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "",
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog",
tokenUrl = "",
refreshUrl = "",
scopes = {
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"),
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets")
}))
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key_query",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key_query",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "http_basic_test",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "",
scheme = "basic"
)
})
@Api(description = "the store API")
@Path("/store")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class StoreApi {
@DELETE
@Path("/order/{order_id}")
@ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ApiResponse(code = 404, message = "Order not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deleteOrder", summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Order not found", content = {
})
})
public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of the order that needs to be deleted") String orderId) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/inventory")
@Produces({ "application/json" })
@ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
@Authorization(value = "api_key")
}, tags={ "store" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
})
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key")
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getInventory", summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Map.class))
})
})
public Response getInventory() {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/order/{order_id}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", response = Order.class, tags={ "store" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ApiResponse(code = 404, message = "Order not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getOrderById", summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class)),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Order not found", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @ApiParam("ID of pet that needs to be fetched") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be fetched") Long orderId) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/order")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "placeOrder", summary = "Place an order for a pet", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class)),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid Order", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response placeOrder(@Valid @NotNull Order body) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -0,0 +1,237 @@
package org.openapitools.api;
import java.util.List;
import java.time.LocalDateTime;
import org.openapitools.model.User;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import io.swagger.annotations.*;
import java.io.InputStream;
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;
@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition(
info = @org.eclipse.microprofile.openapi.annotations.info.Info(
title = "user", version="1.0.0", description="Operations about user",
license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user", description="Operations about user")
)
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user", description="Operations about user")
@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = {
@org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "petstore_auth",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2,
description = "",
flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows(
implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog",
tokenUrl = "",
refreshUrl = "",
scopes = {
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"),
@org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets")
}))
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "api_key_query",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY,
description = "",
apiKeyName = "api_key_query",
in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY
), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme(
securitySchemeName = "http_basic_test",
type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP,
description = "",
scheme = "basic"
)
})
@Api(description = "the user API")
@Path("/user")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class UserApi {
@POST
@ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUser", summary = "Create user", description = "This can only be done by the logged in user.")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response createUser(@Valid @NotNull User body) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/createWithArray")
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response createUsersWithArrayInput(@Valid @NotNull List<User> body) {
return Response.ok().entity("magic!").build();
}
@POST
@Path("/createWithList")
@ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response createUsersWithListInput(@Valid @NotNull List<User> body) {
return Response.ok().entity("magic!").build();
}
@DELETE
@Path("/{username}")
@ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
@ApiResponse(code = 404, message = "User not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deleteUser", summary = "Delete user", description = "This can only be done by the logged in user.")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username supplied", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = {
})
})
public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be deleted") String username) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = User.class),
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
@ApiResponse(code = 404, message = "User not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getUserByName", summary = "Get user by user name", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = User.class)),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = User.class))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username supplied", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing.") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be fetched. Use user1 for testing.") String username) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/login")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "loginUser", summary = "Logs user into the system", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", headers = {
@org.eclipse.microprofile.openapi.annotations.headers.Header(name = "X-Rate-Limit", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.INTEGER), description = "calls per hour allowed by the user"),
@org.eclipse.microprofile.openapi.annotations.headers.Header(name = "X-Expires-After", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.STRING), description = "date in UTC when token expires")
}, content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = String.class)),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = String.class))
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username/password supplied", content = {
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"),
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
})
})
public Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The password for login in clear text") String password) {
return Response.ok().entity("magic!").build();
}
@GET
@Path("/logout")
@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "logoutUser", summary = "Logs out current logged in user session", description = "")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = {
})
})
public Response logoutUser() {
return Response.ok().entity("magic!").build();
}
@PUT
@Path("/{username}")
@ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
@ApiResponse(code = 404, message = "User not found", response = Void.class)
})
@org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updateUser", summary = "Updated user", description = "This can only be done by the logged in user.")
@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user")
@org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = {
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid user supplied", content = {
}),
@org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = {
})
})
public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="name that need to be deleted") String username,@Valid @NotNull User body) {
return Response.ok().entity("magic!").build();
}
}

View File

@ -0,0 +1,88 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesAnyType")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesAnyType extends HashMap<String, Object> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesAnyType name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
return Objects.equals(this.name, additionalPropertiesAnyType.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesAnyType {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,89 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesArray")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesArray extends HashMap<String, List> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesArray name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
return Objects.equals(this.name, additionalPropertiesArray.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesArray {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,88 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesBoolean")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesBoolean name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
return Objects.equals(this.name, additionalPropertiesBoolean.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesBoolean {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,542 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesClass")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesClass implements Serializable {
private @Valid Map<String, String> mapString = new HashMap<>();
private @Valid Map<String, BigDecimal> mapNumber = new HashMap<>();
private @Valid Map<String, Integer> mapInteger = new HashMap<>();
private @Valid Map<String, Boolean> mapBoolean = new HashMap<>();
private @Valid Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
private @Valid Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
private @Valid Map<String, Map<String, String>> mapMapString = new HashMap<>();
private @Valid Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
private @Valid Object anytype1;
private @Valid Object anytype2;
private @Valid Object anytype3;
protected AdditionalPropertiesClass(AdditionalPropertiesClassBuilder<?, ?> b) {
this.mapString = b.mapString;
this.mapNumber = b.mapNumber;
this.mapInteger = b.mapInteger;
this.mapBoolean = b.mapBoolean;
this.mapArrayInteger = b.mapArrayInteger;
this.mapArrayAnytype = b.mapArrayAnytype;
this.mapMapString = b.mapMapString;
this.mapMapAnytype = b.mapMapAnytype;
this.anytype1 = b.anytype1;
this.anytype2 = b.anytype2;
this.anytype3 = b.anytype3;
}
public AdditionalPropertiesClass() {
}
/**
**/
public AdditionalPropertiesClass mapString(Map<String, String> mapString) {
this.mapString = mapString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_string")
public Map<String, String> getMapString() {
return mapString;
}
@JsonProperty("map_string")
public void setMapString(Map<String, String> mapString) {
this.mapString = mapString;
}
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = new HashMap<>();
}
this.mapString.put(key, mapStringItem);
return this;
}
public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) {
if (mapStringItem != null && this.mapString != null) {
this.mapString.remove(mapStringItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_number")
public Map<String, BigDecimal> getMapNumber() {
return mapNumber;
}
@JsonProperty("map_number")
public void setMapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
}
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = new HashMap<>();
}
this.mapNumber.put(key, mapNumberItem);
return this;
}
public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) {
if (mapNumberItem != null && this.mapNumber != null) {
this.mapNumber.remove(mapNumberItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_integer")
public Map<String, Integer> getMapInteger() {
return mapInteger;
}
@JsonProperty("map_integer")
public void setMapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
}
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = new HashMap<>();
}
this.mapInteger.put(key, mapIntegerItem);
return this;
}
public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) {
if (mapIntegerItem != null && this.mapInteger != null) {
this.mapInteger.remove(mapIntegerItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_boolean")
public Map<String, Boolean> getMapBoolean() {
return mapBoolean;
}
@JsonProperty("map_boolean")
public void setMapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
}
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = new HashMap<>();
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
}
public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) {
if (mapBooleanItem != null && this.mapBoolean != null) {
this.mapBoolean.remove(mapBooleanItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_array_integer")
public Map<String, List<Integer>> getMapArrayInteger() {
return mapArrayInteger;
}
@JsonProperty("map_array_integer")
public void setMapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
}
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = new HashMap<>();
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
}
public AdditionalPropertiesClass removeMapArrayIntegerItem(List<Integer> mapArrayIntegerItem) {
if (mapArrayIntegerItem != null && this.mapArrayInteger != null) {
this.mapArrayInteger.remove(mapArrayIntegerItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_array_anytype")
public Map<String, List<Object>> getMapArrayAnytype() {
return mapArrayAnytype;
}
@JsonProperty("map_array_anytype")
public void setMapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
}
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = new HashMap<>();
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
}
public AdditionalPropertiesClass removeMapArrayAnytypeItem(List<Object> mapArrayAnytypeItem) {
if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) {
this.mapArrayAnytype.remove(mapArrayAnytypeItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_map_string")
public Map<String, Map<String, String>> getMapMapString() {
return mapMapString;
}
@JsonProperty("map_map_string")
public void setMapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
}
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = new HashMap<>();
}
this.mapMapString.put(key, mapMapStringItem);
return this;
}
public AdditionalPropertiesClass removeMapMapStringItem(Map<String, String> mapMapStringItem) {
if (mapMapStringItem != null && this.mapMapString != null) {
this.mapMapString.remove(mapMapStringItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass mapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_map_anytype")
public Map<String, Map<String, Object>> getMapMapAnytype() {
return mapMapAnytype;
}
@JsonProperty("map_map_anytype")
public void setMapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
}
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = new HashMap<>();
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;
}
public AdditionalPropertiesClass removeMapMapAnytypeItem(Map<String, Object> mapMapAnytypeItem) {
if (mapMapAnytypeItem != null && this.mapMapAnytype != null) {
this.mapMapAnytype.remove(mapMapAnytypeItem);
}
return this;
}
/**
**/
public AdditionalPropertiesClass anytype1(Object anytype1) {
this.anytype1 = anytype1;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("anytype_1")
public Object getAnytype1() {
return anytype1;
}
@JsonProperty("anytype_1")
public void setAnytype1(Object anytype1) {
this.anytype1 = anytype1;
}
/**
**/
public AdditionalPropertiesClass anytype2(Object anytype2) {
this.anytype2 = anytype2;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("anytype_2")
public Object getAnytype2() {
return anytype2;
}
@JsonProperty("anytype_2")
public void setAnytype2(Object anytype2) {
this.anytype2 = anytype2;
}
/**
**/
public AdditionalPropertiesClass anytype3(Object anytype3) {
this.anytype3 = anytype3;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("anytype_3")
public Object getAnytype3() {
return anytype3;
}
@JsonProperty("anytype_3")
public void setAnytype3(Object anytype3) {
this.anytype3 = anytype3;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapString, additionalPropertiesClass.mapString) &&
Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) &&
Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) &&
Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) &&
Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) &&
Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) &&
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n");
sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n");
sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n");
sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n");
sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n");
sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n");
sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n");
sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n");
sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n");
sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n");
sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static AdditionalPropertiesClassBuilder<?, ?> builder() {
return new AdditionalPropertiesClassBuilderImpl();
}
private static final class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder<AdditionalPropertiesClass, AdditionalPropertiesClassBuilderImpl> {
@Override
protected AdditionalPropertiesClassBuilderImpl self() {
return this;
}
@Override
public AdditionalPropertiesClass build() {
return new AdditionalPropertiesClass(this);
}
}
public static abstract class AdditionalPropertiesClassBuilder<C extends AdditionalPropertiesClass, B extends AdditionalPropertiesClassBuilder<C, B>> {
private Map<String, String> mapString = new HashMap<>();
private Map<String, BigDecimal> mapNumber = new HashMap<>();
private Map<String, Integer> mapInteger = new HashMap<>();
private Map<String, Boolean> mapBoolean = new HashMap<>();
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
private Object anytype1;
private Object anytype2;
private Object anytype3;
protected abstract B self();
public abstract C build();
public B mapString(Map<String, String> mapString) {
this.mapString = mapString;
return self();
}
public B mapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
return self();
}
public B mapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
return self();
}
public B mapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
return self();
}
public B mapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
return self();
}
public B mapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
return self();
}
public B mapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
return self();
}
public B mapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
return self();
}
public B anytype1(Object anytype1) {
this.anytype1 = anytype1;
return self();
}
public B anytype2(Object anytype2) {
this.anytype2 = anytype2;
return self();
}
public B anytype3(Object anytype3) {
this.anytype3 = anytype3;
return self();
}
}
}

View File

@ -0,0 +1,88 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesInteger")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesInteger extends HashMap<String, Integer> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesInteger name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
return Objects.equals(this.name, additionalPropertiesInteger.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesInteger {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,89 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesNumber")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesNumber name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
return Objects.equals(this.name, additionalPropertiesNumber.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesNumber {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,88 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesObject")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesObject extends HashMap<String, Map> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesObject name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
return Objects.equals(this.name, additionalPropertiesObject.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesObject {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,88 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("AdditionalPropertiesString")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class AdditionalPropertiesString extends HashMap<String, String> implements Serializable {
private @Valid String name;
/**
**/
public AdditionalPropertiesString name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
return Objects.equals(this.name, additionalPropertiesString.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesString {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,159 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = BigCat.class, name = "BigCat"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
})
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Animal")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Animal implements Serializable {
private @Valid String className;
private @Valid String color = "red";
protected Animal(AnimalBuilder<?, ?> b) {
this.className = b.className;
this.color = b.color;
}
public Animal() {
}
/**
**/
public Animal className(String className) {
this.className = className;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("className")
@NotNull
public String getClassName() {
return className;
}
@JsonProperty("className")
public void setClassName(String className) {
this.className = className;
}
/**
**/
public Animal color(String color) {
this.color = color;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("color")
public String getColor() {
return color;
}
@JsonProperty("color")
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Animal animal = (Animal) o;
return Objects.equals(this.className, animal.className) &&
Objects.equals(this.color, animal.color);
}
@Override
public int hashCode() {
return Objects.hash(className, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Animal {\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static AnimalBuilder<?, ?> builder() {
return new AnimalBuilderImpl();
}
private static final class AnimalBuilderImpl extends AnimalBuilder<Animal, AnimalBuilderImpl> {
@Override
protected AnimalBuilderImpl self() {
return this;
}
@Override
public Animal build() {
return new Animal(this);
}
}
public static abstract class AnimalBuilder<C extends Animal, B extends AnimalBuilder<C, B>> {
private String className;
private String color = "red";
protected abstract B self();
public abstract C build();
public B className(String className) {
this.className = className;
return self();
}
public B color(String color) {
this.color = color;
return self();
}
}
}

View File

@ -0,0 +1,139 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("ArrayOfArrayOfNumberOnly")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ArrayOfArrayOfNumberOnly implements Serializable {
private @Valid List<List<BigDecimal>> arrayArrayNumber;
protected ArrayOfArrayOfNumberOnly(ArrayOfArrayOfNumberOnlyBuilder<?, ?> b) {
this.arrayArrayNumber = b.arrayArrayNumber;
}
public ArrayOfArrayOfNumberOnly() {
}
/**
**/
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("ArrayArrayNumber")
public List<List<BigDecimal>> getArrayArrayNumber() {
return arrayArrayNumber;
}
@JsonProperty("ArrayArrayNumber")
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
}
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
if (this.arrayArrayNumber == null) {
this.arrayArrayNumber = new ArrayList<>();
}
this.arrayArrayNumber.add(arrayArrayNumberItem);
return this;
}
public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) {
this.arrayArrayNumber.remove(arrayArrayNumberItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
}
@Override
public int hashCode() {
return Objects.hash(arrayArrayNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayOfArrayOfNumberOnly {\n");
sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ArrayOfArrayOfNumberOnlyBuilder<?, ?> builder() {
return new ArrayOfArrayOfNumberOnlyBuilderImpl();
}
private static final class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder<ArrayOfArrayOfNumberOnly, ArrayOfArrayOfNumberOnlyBuilderImpl> {
@Override
protected ArrayOfArrayOfNumberOnlyBuilderImpl self() {
return this;
}
@Override
public ArrayOfArrayOfNumberOnly build() {
return new ArrayOfArrayOfNumberOnly(this);
}
}
public static abstract class ArrayOfArrayOfNumberOnlyBuilder<C extends ArrayOfArrayOfNumberOnly, B extends ArrayOfArrayOfNumberOnlyBuilder<C, B>> {
private List<List<BigDecimal>> arrayArrayNumber;
protected abstract B self();
public abstract C build();
public B arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
return self();
}
}
}

View File

@ -0,0 +1,139 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("ArrayOfNumberOnly")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ArrayOfNumberOnly implements Serializable {
private @Valid List<BigDecimal> arrayNumber;
protected ArrayOfNumberOnly(ArrayOfNumberOnlyBuilder<?, ?> b) {
this.arrayNumber = b.arrayNumber;
}
public ArrayOfNumberOnly() {
}
/**
**/
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("ArrayNumber")
public List<BigDecimal> getArrayNumber() {
return arrayNumber;
}
@JsonProperty("ArrayNumber")
public void setArrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
}
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
if (this.arrayNumber == null) {
this.arrayNumber = new ArrayList<>();
}
this.arrayNumber.add(arrayNumberItem);
return this;
}
public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) {
if (arrayNumberItem != null && this.arrayNumber != null) {
this.arrayNumber.remove(arrayNumberItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
}
@Override
public int hashCode() {
return Objects.hash(arrayNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayOfNumberOnly {\n");
sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ArrayOfNumberOnlyBuilder<?, ?> builder() {
return new ArrayOfNumberOnlyBuilderImpl();
}
private static final class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder<ArrayOfNumberOnly, ArrayOfNumberOnlyBuilderImpl> {
@Override
protected ArrayOfNumberOnlyBuilderImpl self() {
return this;
}
@Override
public ArrayOfNumberOnly build() {
return new ArrayOfNumberOnly(this);
}
}
public static abstract class ArrayOfNumberOnlyBuilder<C extends ArrayOfNumberOnly, B extends ArrayOfNumberOnlyBuilder<C, B>> {
private List<BigDecimal> arrayNumber;
protected abstract B self();
public abstract C build();
public B arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
return self();
}
}
}

View File

@ -0,0 +1,229 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.model.ReadOnlyFirst;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("ArrayTest")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ArrayTest implements Serializable {
private @Valid List<String> arrayOfString;
private @Valid List<List<Long>> arrayArrayOfInteger;
private @Valid List<List<ReadOnlyFirst>> arrayArrayOfModel;
protected ArrayTest(ArrayTestBuilder<?, ?> b) {
this.arrayOfString = b.arrayOfString;
this.arrayArrayOfInteger = b.arrayArrayOfInteger;
this.arrayArrayOfModel = b.arrayArrayOfModel;
}
public ArrayTest() {
}
/**
**/
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("array_of_string")
public List<String> getArrayOfString() {
return arrayOfString;
}
@JsonProperty("array_of_string")
public void setArrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
}
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
if (this.arrayOfString == null) {
this.arrayOfString = new ArrayList<>();
}
this.arrayOfString.add(arrayOfStringItem);
return this;
}
public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) {
if (arrayOfStringItem != null && this.arrayOfString != null) {
this.arrayOfString.remove(arrayOfStringItem);
}
return this;
}
/**
**/
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("array_array_of_integer")
public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
@JsonProperty("array_array_of_integer")
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
if (this.arrayArrayOfInteger == null) {
this.arrayArrayOfInteger = new ArrayList<>();
}
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
return this;
}
public ArrayTest removeArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) {
this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem);
}
return this;
}
/**
**/
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("array_array_of_model")
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
@JsonProperty("array_array_of_model")
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
}
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
if (this.arrayArrayOfModel == null) {
this.arrayArrayOfModel = new ArrayList<>();
}
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
return this;
}
public ArrayTest removeArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) {
this.arrayArrayOfModel.remove(arrayArrayOfModelItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayTest arrayTest = (ArrayTest) o;
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
}
@Override
public int hashCode() {
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayTest {\n");
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ArrayTestBuilder<?, ?> builder() {
return new ArrayTestBuilderImpl();
}
private static final class ArrayTestBuilderImpl extends ArrayTestBuilder<ArrayTest, ArrayTestBuilderImpl> {
@Override
protected ArrayTestBuilderImpl self() {
return this;
}
@Override
public ArrayTest build() {
return new ArrayTest(this);
}
}
public static abstract class ArrayTestBuilder<C extends ArrayTest, B extends ArrayTestBuilder<C, B>> {
private List<String> arrayOfString;
private List<List<Long>> arrayArrayOfInteger;
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
protected abstract B self();
public abstract C build();
public B arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
return self();
}
public B arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return self();
}
public B arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return self();
}
}
}

View File

@ -0,0 +1,167 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Cat;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("BigCat")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class BigCat extends Cat implements Serializable {
public enum KindEnum {
LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars"));
private String value;
KindEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static KindEnum fromString(String s) {
for (KindEnum b : KindEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static KindEnum fromValue(String value) {
for (KindEnum b : KindEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid KindEnum kind;
protected BigCat(BigCatBuilder<?, ?> b) {
super(b);
this.kind = b.kind;
}
public BigCat() {
}
/**
**/
public BigCat kind(KindEnum kind) {
this.kind = kind;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("kind")
public KindEnum getKind() {
return kind;
}
@JsonProperty("kind")
public void setKind(KindEnum kind) {
this.kind = kind;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BigCat bigCat = (BigCat) o;
return Objects.equals(this.kind, bigCat.kind) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(kind, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BigCat {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" kind: ").append(toIndentedString(kind)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static BigCatBuilder<?, ?> builder() {
return new BigCatBuilderImpl();
}
private static final class BigCatBuilderImpl extends BigCatBuilder<BigCat, BigCatBuilderImpl> {
@Override
protected BigCatBuilderImpl self() {
return this;
}
@Override
public BigCat build() {
return new BigCat(this);
}
}
public static abstract class BigCatBuilder<C extends BigCat, B extends BigCatBuilder<C, B>> extends CatBuilder<C, B> {
private KindEnum kind;
public B kind(KindEnum kind) {
this.kind = kind;
return self();
}
}
}

View File

@ -0,0 +1,168 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("BigCat_allOf")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class BigCatAllOf implements Serializable {
public enum KindEnum {
LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars"));
private String value;
KindEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static KindEnum fromString(String s) {
for (KindEnum b : KindEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static KindEnum fromValue(String value) {
for (KindEnum b : KindEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid KindEnum kind;
protected BigCatAllOf(BigCatAllOfBuilder<?, ?> b) {
this.kind = b.kind;
}
public BigCatAllOf() {
}
/**
**/
public BigCatAllOf kind(KindEnum kind) {
this.kind = kind;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("kind")
public KindEnum getKind() {
return kind;
}
@JsonProperty("kind")
public void setKind(KindEnum kind) {
this.kind = kind;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BigCatAllOf bigCatAllOf = (BigCatAllOf) o;
return Objects.equals(this.kind, bigCatAllOf.kind);
}
@Override
public int hashCode() {
return Objects.hash(kind);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BigCatAllOf {\n");
sb.append(" kind: ").append(toIndentedString(kind)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static BigCatAllOfBuilder<?, ?> builder() {
return new BigCatAllOfBuilderImpl();
}
private static final class BigCatAllOfBuilderImpl extends BigCatAllOfBuilder<BigCatAllOf, BigCatAllOfBuilderImpl> {
@Override
protected BigCatAllOfBuilderImpl self() {
return this;
}
@Override
public BigCatAllOf build() {
return new BigCatAllOf(this);
}
}
public static abstract class BigCatAllOfBuilder<C extends BigCatAllOf, B extends BigCatAllOfBuilder<C, B>> {
private KindEnum kind;
protected abstract B self();
public abstract C build();
public B kind(KindEnum kind) {
this.kind = kind;
return self();
}
}
}

View File

@ -0,0 +1,266 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Capitalization")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Capitalization implements Serializable {
private @Valid String smallCamel;
private @Valid String capitalCamel;
private @Valid String smallSnake;
private @Valid String capitalSnake;
private @Valid String scAETHFlowPoints;
private @Valid String ATT_NAME;
protected Capitalization(CapitalizationBuilder<?, ?> b) {
this.smallCamel = b.smallCamel;
this.capitalCamel = b.capitalCamel;
this.smallSnake = b.smallSnake;
this.capitalSnake = b.capitalSnake;
this.scAETHFlowPoints = b.scAETHFlowPoints;
this.ATT_NAME = b.ATT_NAME;
}
public Capitalization() {
}
/**
**/
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("smallCamel")
public String getSmallCamel() {
return smallCamel;
}
@JsonProperty("smallCamel")
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
/**
**/
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("CapitalCamel")
public String getCapitalCamel() {
return capitalCamel;
}
@JsonProperty("CapitalCamel")
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
/**
**/
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("small_Snake")
public String getSmallSnake() {
return smallSnake;
}
@JsonProperty("small_Snake")
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
/**
**/
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("Capital_Snake")
public String getCapitalSnake() {
return capitalSnake;
}
@JsonProperty("Capital_Snake")
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
/**
**/
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("SCA_ETH_Flow_Points")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
@JsonProperty("SCA_ETH_Flow_Points")
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
/**
* Name of the pet
**/
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
@ApiModelProperty(value = "Name of the pet ")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Name of the pet ")
@JsonProperty("ATT_NAME")
public String getATTNAME() {
return ATT_NAME;
}
@JsonProperty("ATT_NAME")
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Capitalization capitalization = (Capitalization) o;
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
}
@Override
public int hashCode() {
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Capitalization {\n");
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static CapitalizationBuilder<?, ?> builder() {
return new CapitalizationBuilderImpl();
}
private static final class CapitalizationBuilderImpl extends CapitalizationBuilder<Capitalization, CapitalizationBuilderImpl> {
@Override
protected CapitalizationBuilderImpl self() {
return this;
}
@Override
public Capitalization build() {
return new Capitalization(this);
}
}
public static abstract class CapitalizationBuilder<C extends Capitalization, B extends CapitalizationBuilder<C, B>> {
private String smallCamel;
private String capitalCamel;
private String smallSnake;
private String capitalSnake;
private String scAETHFlowPoints;
private String ATT_NAME;
protected abstract B self();
public abstract C build();
public B smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return self();
}
public B capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return self();
}
public B smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return self();
}
public B capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return self();
}
public B scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return self();
}
public B ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return self();
}
}
}

View File

@ -0,0 +1,120 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Animal;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Cat")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Cat extends Animal implements Serializable {
private @Valid Boolean declawed;
protected Cat(CatBuilder<?, ?> b) {
super(b);
this.declawed = b.declawed;
}
public Cat() {
}
/**
**/
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("declawed")
public Boolean getDeclawed() {
return declawed;
}
@JsonProperty("declawed")
public void setDeclawed(Boolean declawed) {
this.declawed = declawed;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Cat cat = (Cat) o;
return Objects.equals(this.declawed, cat.declawed) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(declawed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Cat {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static CatBuilder<?, ?> builder() {
return new CatBuilderImpl();
}
private static final class CatBuilderImpl extends CatBuilder<Cat, CatBuilderImpl> {
@Override
protected CatBuilderImpl self() {
return this;
}
@Override
public Cat build() {
return new Cat(this);
}
}
public static abstract class CatBuilder<C extends Cat, B extends CatBuilder<C, B>> extends AnimalBuilder<C, B> {
private Boolean declawed;
public B declawed(Boolean declawed) {
this.declawed = declawed;
return self();
}
}
}

View File

@ -0,0 +1,121 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Cat_allOf")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class CatAllOf implements Serializable {
private @Valid Boolean declawed;
protected CatAllOf(CatAllOfBuilder<?, ?> b) {
this.declawed = b.declawed;
}
public CatAllOf() {
}
/**
**/
public CatAllOf declawed(Boolean declawed) {
this.declawed = declawed;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("declawed")
public Boolean getDeclawed() {
return declawed;
}
@JsonProperty("declawed")
public void setDeclawed(Boolean declawed) {
this.declawed = declawed;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CatAllOf catAllOf = (CatAllOf) o;
return Objects.equals(this.declawed, catAllOf.declawed);
}
@Override
public int hashCode() {
return Objects.hash(declawed);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CatAllOf {\n");
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static CatAllOfBuilder<?, ?> builder() {
return new CatAllOfBuilderImpl();
}
private static final class CatAllOfBuilderImpl extends CatAllOfBuilder<CatAllOf, CatAllOfBuilderImpl> {
@Override
protected CatAllOfBuilderImpl self() {
return this;
}
@Override
public CatAllOf build() {
return new CatAllOf(this);
}
}
public static abstract class CatAllOfBuilder<C extends CatAllOf, B extends CatAllOfBuilder<C, B>> {
private Boolean declawed;
protected abstract B self();
public abstract C build();
public B declawed(Boolean declawed) {
this.declawed = declawed;
return self();
}
}
}

View File

@ -0,0 +1,150 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Category")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Category implements Serializable {
private @Valid Long id;
private @Valid String name = "default-name";
protected Category(CategoryBuilder<?, ?> b) {
this.id = b.id;
this.name = b.name;
}
public Category() {
}
/**
**/
public Category id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("id")
public Long getId() {
return id;
}
@JsonProperty("id")
public void setId(Long id) {
this.id = id;
}
/**
**/
public Category name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("name")
@NotNull
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static CategoryBuilder<?, ?> builder() {
return new CategoryBuilderImpl();
}
private static final class CategoryBuilderImpl extends CategoryBuilder<Category, CategoryBuilderImpl> {
@Override
protected CategoryBuilderImpl self() {
return this;
}
@Override
public Category build() {
return new Category(this);
}
}
public static abstract class CategoryBuilder<C extends Category, B extends CategoryBuilder<C, B>> {
private Long id;
private String name = "default-name";
protected abstract B self();
public abstract C build();
public B id(Long id) {
this.id = id;
return self();
}
public B name(String name) {
this.name = name;
return self();
}
}
}

View File

@ -0,0 +1,122 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Model for testing model with \&quot;_class\&quot; property
**/
@ApiModel(description = "Model for testing model with \"_class\" property")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model with \"_class\" property")
@JsonTypeName("ClassModel")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ClassModel implements Serializable {
private @Valid String propertyClass;
protected ClassModel(ClassModelBuilder<?, ?> b) {
this.propertyClass = b.propertyClass;
}
public ClassModel() {
}
/**
**/
public ClassModel propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("_class")
public String getPropertyClass() {
return propertyClass;
}
@JsonProperty("_class")
public void setPropertyClass(String propertyClass) {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClassModel classModel = (ClassModel) o;
return Objects.equals(this.propertyClass, classModel.propertyClass);
}
@Override
public int hashCode() {
return Objects.hash(propertyClass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ClassModel {\n");
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ClassModelBuilder<?, ?> builder() {
return new ClassModelBuilderImpl();
}
private static final class ClassModelBuilderImpl extends ClassModelBuilder<ClassModel, ClassModelBuilderImpl> {
@Override
protected ClassModelBuilderImpl self() {
return this;
}
@Override
public ClassModel build() {
return new ClassModel(this);
}
}
public static abstract class ClassModelBuilder<C extends ClassModel, B extends ClassModelBuilder<C, B>> {
private String propertyClass;
protected abstract B self();
public abstract C build();
public B propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return self();
}
}
}

View File

@ -0,0 +1,120 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Client")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Client implements Serializable {
private @Valid String client;
protected Client(ClientBuilder<?, ?> b) {
this.client = b.client;
}
public Client() {
}
/**
**/
public Client client(String client) {
this.client = client;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("client")
public String getClient() {
return client;
}
@JsonProperty("client")
public void setClient(String client) {
this.client = client;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Client client = (Client) o;
return Objects.equals(this.client, client.client);
}
@Override
public int hashCode() {
return Objects.hash(client);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Client {\n");
sb.append(" client: ").append(toIndentedString(client)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ClientBuilder<?, ?> builder() {
return new ClientBuilderImpl();
}
private static final class ClientBuilderImpl extends ClientBuilder<Client, ClientBuilderImpl> {
@Override
protected ClientBuilderImpl self() {
return this;
}
@Override
public Client build() {
return new Client(this);
}
}
public static abstract class ClientBuilder<C extends Client, B extends ClientBuilder<C, B>> {
private String client;
protected abstract B self();
public abstract C build();
public B client(String client) {
this.client = client;
return self();
}
}
}

View File

@ -0,0 +1,120 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Animal;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Dog")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Dog extends Animal implements Serializable {
private @Valid String breed;
protected Dog(DogBuilder<?, ?> b) {
super(b);
this.breed = b.breed;
}
public Dog() {
}
/**
**/
public Dog breed(String breed) {
this.breed = breed;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("breed")
public String getBreed() {
return breed;
}
@JsonProperty("breed")
public void setBreed(String breed) {
this.breed = breed;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Dog dog = (Dog) o;
return Objects.equals(this.breed, dog.breed) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(breed, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Dog {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static DogBuilder<?, ?> builder() {
return new DogBuilderImpl();
}
private static final class DogBuilderImpl extends DogBuilder<Dog, DogBuilderImpl> {
@Override
protected DogBuilderImpl self() {
return this;
}
@Override
public Dog build() {
return new Dog(this);
}
}
public static abstract class DogBuilder<C extends Dog, B extends DogBuilder<C, B>> extends AnimalBuilder<C, B> {
private String breed;
public B breed(String breed) {
this.breed = breed;
return self();
}
}
}

View File

@ -0,0 +1,121 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Dog_allOf")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class DogAllOf implements Serializable {
private @Valid String breed;
protected DogAllOf(DogAllOfBuilder<?, ?> b) {
this.breed = b.breed;
}
public DogAllOf() {
}
/**
**/
public DogAllOf breed(String breed) {
this.breed = breed;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("breed")
public String getBreed() {
return breed;
}
@JsonProperty("breed")
public void setBreed(String breed) {
this.breed = breed;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DogAllOf dogAllOf = (DogAllOf) o;
return Objects.equals(this.breed, dogAllOf.breed);
}
@Override
public int hashCode() {
return Objects.hash(breed);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DogAllOf {\n");
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static DogAllOfBuilder<?, ?> builder() {
return new DogAllOfBuilderImpl();
}
private static final class DogAllOfBuilderImpl extends DogAllOfBuilder<DogAllOf, DogAllOfBuilderImpl> {
@Override
protected DogAllOfBuilderImpl self() {
return this;
}
@Override
public DogAllOf build() {
return new DogAllOf(this);
}
}
public static abstract class DogAllOfBuilder<C extends DogAllOf, B extends DogAllOfBuilder<C, B>> {
private String breed;
protected abstract B self();
public abstract C build();
public B breed(String breed) {
this.breed = breed;
return self();
}
}
}

View File

@ -0,0 +1,261 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("EnumArrays")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class EnumArrays implements Serializable {
public enum JustSymbolEnum {
GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$"));
private String value;
JustSymbolEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static JustSymbolEnum fromString(String s) {
for (JustSymbolEnum b : JustSymbolEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static JustSymbolEnum fromValue(String value) {
for (JustSymbolEnum b : JustSymbolEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid JustSymbolEnum justSymbol;
public enum ArrayEnumEnum {
FISH(String.valueOf("fish")), CRAB(String.valueOf("crab"));
private String value;
ArrayEnumEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static ArrayEnumEnum fromString(String s) {
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static ArrayEnumEnum fromValue(String value) {
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid List<ArrayEnumEnum> arrayEnum;
protected EnumArrays(EnumArraysBuilder<?, ?> b) {
this.justSymbol = b.justSymbol;
this.arrayEnum = b.arrayEnum;
}
public EnumArrays() {
}
/**
**/
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("just_symbol")
public JustSymbolEnum getJustSymbol() {
return justSymbol;
}
@JsonProperty("just_symbol")
public void setJustSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
}
/**
**/
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("array_enum")
public List<ArrayEnumEnum> getArrayEnum() {
return arrayEnum;
}
@JsonProperty("array_enum")
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
}
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
if (this.arrayEnum == null) {
this.arrayEnum = new ArrayList<>();
}
this.arrayEnum.add(arrayEnumItem);
return this;
}
public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
if (arrayEnumItem != null && this.arrayEnum != null) {
this.arrayEnum.remove(arrayEnumItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EnumArrays enumArrays = (EnumArrays) o;
return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
}
@Override
public int hashCode() {
return Objects.hash(justSymbol, arrayEnum);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumArrays {\n");
sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static EnumArraysBuilder<?, ?> builder() {
return new EnumArraysBuilderImpl();
}
private static final class EnumArraysBuilderImpl extends EnumArraysBuilder<EnumArrays, EnumArraysBuilderImpl> {
@Override
protected EnumArraysBuilderImpl self() {
return this;
}
@Override
public EnumArrays build() {
return new EnumArrays(this);
}
}
public static abstract class EnumArraysBuilder<C extends EnumArrays, B extends EnumArraysBuilder<C, B>> {
private JustSymbolEnum justSymbol;
private List<ArrayEnumEnum> arrayEnum;
protected abstract B self();
public abstract C build();
public B justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
return self();
}
public B arrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
return self();
}
}
}

View File

@ -0,0 +1,59 @@
package org.openapitools.model;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* Gets or Sets EnumClass
*/
public enum EnumClass {
_ABC("_abc"),
_EFG("-efg"),
_XYZ_("(xyz)");
private String value;
EnumClass(String value) {
this.value = value;
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static EnumClass fromString(String s) {
for (EnumClass b : EnumClass.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EnumClass fromValue(String value) {
for (EnumClass b : EnumClass.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}

View File

@ -0,0 +1,427 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.OuterEnum;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Enum_Test")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class EnumTest implements Serializable {
public enum EnumStringEnum {
UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf(""));
private String value;
EnumStringEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static EnumStringEnum fromString(String s) {
for (EnumStringEnum b : EnumStringEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static EnumStringEnum fromValue(String value) {
for (EnumStringEnum b : EnumStringEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid EnumStringEnum enumString;
public enum EnumStringRequiredEnum {
UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf(""));
private String value;
EnumStringRequiredEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static EnumStringRequiredEnum fromString(String s) {
for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static EnumStringRequiredEnum fromValue(String value) {
for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid EnumStringRequiredEnum enumStringRequired;
public enum EnumIntegerEnum {
NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1));
private Integer value;
EnumIntegerEnum (Integer v) {
value = v;
}
public Integer value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into Integer, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static EnumIntegerEnum fromString(String s) {
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static EnumIntegerEnum fromValue(Integer value) {
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid EnumIntegerEnum enumInteger;
public enum EnumNumberEnum {
NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));
private Double value;
EnumNumberEnum (Double v) {
value = v;
}
public Double value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into Double, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static EnumNumberEnum fromString(String s) {
for (EnumNumberEnum b : EnumNumberEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static EnumNumberEnum fromValue(Double value) {
for (EnumNumberEnum b : EnumNumberEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid EnumNumberEnum enumNumber;
private @Valid OuterEnum outerEnum;
protected EnumTest(EnumTestBuilder<?, ?> b) {
this.enumString = b.enumString;
this.enumStringRequired = b.enumStringRequired;
this.enumInteger = b.enumInteger;
this.enumNumber = b.enumNumber;
this.outerEnum = b.outerEnum;
}
public EnumTest() {
}
/**
**/
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("enum_string")
public EnumStringEnum getEnumString() {
return enumString;
}
@JsonProperty("enum_string")
public void setEnumString(EnumStringEnum enumString) {
this.enumString = enumString;
}
/**
**/
public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("enum_string_required")
@NotNull
public EnumStringRequiredEnum getEnumStringRequired() {
return enumStringRequired;
}
@JsonProperty("enum_string_required")
public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
}
/**
**/
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("enum_integer")
public EnumIntegerEnum getEnumInteger() {
return enumInteger;
}
@JsonProperty("enum_integer")
public void setEnumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
}
/**
**/
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("enum_number")
public EnumNumberEnum getEnumNumber() {
return enumNumber;
}
@JsonProperty("enum_number")
public void setEnumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
}
/**
**/
public EnumTest outerEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("outerEnum")
public OuterEnum getOuterEnum() {
return outerEnum;
}
@JsonProperty("outerEnum")
public void setOuterEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EnumTest enumTest = (EnumTest) o;
return Objects.equals(this.enumString, enumTest.enumString) &&
Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) &&
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
Objects.equals(this.enumNumber, enumTest.enumNumber) &&
Objects.equals(this.outerEnum, enumTest.outerEnum);
}
@Override
public int hashCode() {
return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumTest {\n");
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n");
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static EnumTestBuilder<?, ?> builder() {
return new EnumTestBuilderImpl();
}
private static final class EnumTestBuilderImpl extends EnumTestBuilder<EnumTest, EnumTestBuilderImpl> {
@Override
protected EnumTestBuilderImpl self() {
return this;
}
@Override
public EnumTest build() {
return new EnumTest(this);
}
}
public static abstract class EnumTestBuilder<C extends EnumTest, B extends EnumTestBuilder<C, B>> {
private EnumStringEnum enumString;
private EnumStringRequiredEnum enumStringRequired;
private EnumIntegerEnum enumInteger;
private EnumNumberEnum enumNumber;
private OuterEnum outerEnum;
protected abstract B self();
public abstract C build();
public B enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return self();
}
public B enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
return self();
}
public B enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return self();
}
public B enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
return self();
}
public B outerEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
return self();
}
}
}

View File

@ -0,0 +1,168 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.model.ModelFile;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("FileSchemaTestClass")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class FileSchemaTestClass implements Serializable {
private @Valid ModelFile _file;
private @Valid List<ModelFile> files;
protected FileSchemaTestClass(FileSchemaTestClassBuilder<?, ?> b) {
this._file = b._file;
this.files = b.files;
}
public FileSchemaTestClass() {
}
/**
**/
public FileSchemaTestClass _file(ModelFile _file) {
this._file = _file;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("file")
public ModelFile getFile() {
return _file;
}
@JsonProperty("file")
public void setFile(ModelFile _file) {
this._file = _file;
}
/**
**/
public FileSchemaTestClass files(List<ModelFile> files) {
this.files = files;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("files")
public List<ModelFile> getFiles() {
return files;
}
@JsonProperty("files")
public void setFiles(List<ModelFile> files) {
this.files = files;
}
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
if (this.files == null) {
this.files = new ArrayList<>();
}
this.files.add(filesItem);
return this;
}
public FileSchemaTestClass removeFilesItem(ModelFile filesItem) {
if (filesItem != null && this.files != null) {
this.files.remove(filesItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
return Objects.equals(this._file, fileSchemaTestClass._file) &&
Objects.equals(this.files, fileSchemaTestClass.files);
}
@Override
public int hashCode() {
return Objects.hash(_file, files);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FileSchemaTestClass {\n");
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
sb.append(" files: ").append(toIndentedString(files)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static FileSchemaTestClassBuilder<?, ?> builder() {
return new FileSchemaTestClassBuilderImpl();
}
private static final class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder<FileSchemaTestClass, FileSchemaTestClassBuilderImpl> {
@Override
protected FileSchemaTestClassBuilderImpl self() {
return this;
}
@Override
public FileSchemaTestClass build() {
return new FileSchemaTestClass(this);
}
}
public static abstract class FileSchemaTestClassBuilder<C extends FileSchemaTestClass, B extends FileSchemaTestClassBuilder<C, B>> {
private ModelFile _file;
private List<ModelFile> files;
protected abstract B self();
public abstract C build();
public B _file(ModelFile _file) {
this._file = _file;
return self();
}
public B files(List<ModelFile> files) {
this.files = files;
return self();
}
}
}

View File

@ -0,0 +1,518 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.UUID;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("format_test")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class FormatTest implements Serializable {
private @Valid Integer integer;
private @Valid Integer int32;
private @Valid Long int64;
private @Valid BigDecimal number;
private @Valid Float _float;
private @Valid Double _double;
private @Valid String string;
private @Valid byte[] _byte;
private @Valid File binary;
private @Valid LocalDate date;
private @Valid LocalDateTime dateTime;
private @Valid UUID uuid;
private @Valid String password;
private @Valid BigDecimal bigDecimal;
protected FormatTest(FormatTestBuilder<?, ?> b) {
this.integer = b.integer;
this.int32 = b.int32;
this.int64 = b.int64;
this.number = b.number;
this._float = b._float;
this._double = b._double;
this.string = b.string;
this._byte = b._byte;
this.binary = b.binary;
this.date = b.date;
this.dateTime = b.dateTime;
this.uuid = b.uuid;
this.password = b.password;
this.bigDecimal = b.bigDecimal;
}
public FormatTest() {
}
/**
* minimum: 10
* maximum: 100
**/
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("integer")
@Min(10) @Max(100) public Integer getInteger() {
return integer;
}
@JsonProperty("integer")
public void setInteger(Integer integer) {
this.integer = integer;
}
/**
* minimum: 20
* maximum: 200
**/
public FormatTest int32(Integer int32) {
this.int32 = int32;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("int32")
@Min(20) @Max(200) public Integer getInt32() {
return int32;
}
@JsonProperty("int32")
public void setInt32(Integer int32) {
this.int32 = int32;
}
/**
**/
public FormatTest int64(Long int64) {
this.int64 = int64;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("int64")
public Long getInt64() {
return int64;
}
@JsonProperty("int64")
public void setInt64(Long int64) {
this.int64 = int64;
}
/**
* minimum: 32.1
* maximum: 543.2
**/
public FormatTest number(BigDecimal number) {
this.number = number;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("number")
@NotNull
@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
return number;
}
@JsonProperty("number")
public void setNumber(BigDecimal number) {
this.number = number;
}
/**
* minimum: 54.3
* maximum: 987.6
**/
public FormatTest _float(Float _float) {
this._float = _float;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("float")
@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
return _float;
}
@JsonProperty("float")
public void setFloat(Float _float) {
this._float = _float;
}
/**
* minimum: 67.8
* maximum: 123.4
**/
public FormatTest _double(Double _double) {
this._double = _double;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("double")
@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
return _double;
}
@JsonProperty("double")
public void setDouble(Double _double) {
this._double = _double;
}
/**
**/
public FormatTest string(String string) {
this.string = string;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("string")
@Pattern(regexp="/[a-z]/i") public String getString() {
return string;
}
@JsonProperty("string")
public void setString(String string) {
this.string = string;
}
/**
**/
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("byte")
@NotNull
@Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() {
return _byte;
}
@JsonProperty("byte")
public void setByte(byte[] _byte) {
this._byte = _byte;
}
/**
**/
public FormatTest binary(File binary) {
this.binary = binary;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("binary")
public File getBinary() {
return binary;
}
@JsonProperty("binary")
public void setBinary(File binary) {
this.binary = binary;
}
/**
**/
public FormatTest date(LocalDate date) {
this.date = date;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("date")
@NotNull
public LocalDate getDate() {
return date;
}
@JsonProperty("date")
public void setDate(LocalDate date) {
this.date = date;
}
/**
**/
public FormatTest dateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("dateTime")
public LocalDateTime getDateTime() {
return dateTime;
}
@JsonProperty("dateTime")
public void setDateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
}
/**
**/
public FormatTest uuid(UUID uuid) {
this.uuid = uuid;
return this;
}
@ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "")
@JsonProperty("uuid")
public UUID getUuid() {
return uuid;
}
@JsonProperty("uuid")
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
/**
**/
public FormatTest password(String password) {
this.password = password;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("password")
@NotNull
@Size(min=10,max=64) public String getPassword() {
return password;
}
@JsonProperty("password")
public void setPassword(String password) {
this.password = password;
}
/**
**/
public FormatTest bigDecimal(BigDecimal bigDecimal) {
this.bigDecimal = bigDecimal;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("BigDecimal")
public BigDecimal getBigDecimal() {
return bigDecimal;
}
@JsonProperty("BigDecimal")
public void setBigDecimal(BigDecimal bigDecimal) {
this.bigDecimal = bigDecimal;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FormatTest formatTest = (FormatTest) o;
return Objects.equals(this.integer, formatTest.integer) &&
Objects.equals(this.int32, formatTest.int32) &&
Objects.equals(this.int64, formatTest.int64) &&
Objects.equals(this.number, formatTest.number) &&
Objects.equals(this._float, formatTest._float) &&
Objects.equals(this._double, formatTest._double) &&
Objects.equals(this.string, formatTest.string) &&
Arrays.equals(this._byte, formatTest._byte) &&
Objects.equals(this.binary, formatTest.binary) &&
Objects.equals(this.date, formatTest.date) &&
Objects.equals(this.dateTime, formatTest.dateTime) &&
Objects.equals(this.uuid, formatTest.uuid) &&
Objects.equals(this.password, formatTest.password) &&
Objects.equals(this.bigDecimal, formatTest.bigDecimal);
}
@Override
public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FormatTest {\n");
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
sb.append(" string: ").append(toIndentedString(string)).append("\n");
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static FormatTestBuilder<?, ?> builder() {
return new FormatTestBuilderImpl();
}
private static final class FormatTestBuilderImpl extends FormatTestBuilder<FormatTest, FormatTestBuilderImpl> {
@Override
protected FormatTestBuilderImpl self() {
return this;
}
@Override
public FormatTest build() {
return new FormatTest(this);
}
}
public static abstract class FormatTestBuilder<C extends FormatTest, B extends FormatTestBuilder<C, B>> {
private Integer integer;
private Integer int32;
private Long int64;
private BigDecimal number;
private Float _float;
private Double _double;
private String string;
private byte[] _byte;
private File binary;
private LocalDate date;
private LocalDateTime dateTime;
private UUID uuid;
private String password;
private BigDecimal bigDecimal;
protected abstract B self();
public abstract C build();
public B integer(Integer integer) {
this.integer = integer;
return self();
}
public B int32(Integer int32) {
this.int32 = int32;
return self();
}
public B int64(Long int64) {
this.int64 = int64;
return self();
}
public B number(BigDecimal number) {
this.number = number;
return self();
}
public B _float(Float _float) {
this._float = _float;
return self();
}
public B _double(Double _double) {
this._double = _double;
return self();
}
public B string(String string) {
this.string = string;
return self();
}
public B _byte(byte[] _byte) {
this._byte = _byte;
return self();
}
public B binary(File binary) {
this.binary = binary;
return self();
}
public B date(LocalDate date) {
this.date = date;
return self();
}
public B dateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
return self();
}
public B uuid(UUID uuid) {
this.uuid = uuid;
return self();
}
public B password(String password) {
this.password = password;
return self();
}
public B bigDecimal(BigDecimal bigDecimal) {
this.bigDecimal = bigDecimal;
return self();
}
}
}

View File

@ -0,0 +1,150 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("hasOnlyReadOnly")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class HasOnlyReadOnly implements Serializable {
private @Valid String bar;
private @Valid String foo;
protected HasOnlyReadOnly(HasOnlyReadOnlyBuilder<?, ?> b) {
this.bar = b.bar;
this.foo = b.foo;
}
public HasOnlyReadOnly() {
}
/**
**/
public HasOnlyReadOnly bar(String bar) {
this.bar = bar;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("bar")
public String getBar() {
return bar;
}
@JsonProperty("bar")
public void setBar(String bar) {
this.bar = bar;
}
/**
**/
public HasOnlyReadOnly foo(String foo) {
this.foo = foo;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("foo")
public String getFoo() {
return foo;
}
@JsonProperty("foo")
public void setFoo(String foo) {
this.foo = foo;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
Objects.equals(this.foo, hasOnlyReadOnly.foo);
}
@Override
public int hashCode() {
return Objects.hash(bar, foo);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class HasOnlyReadOnly {\n");
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
sb.append(" foo: ").append(toIndentedString(foo)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HasOnlyReadOnlyBuilder<?, ?> builder() {
return new HasOnlyReadOnlyBuilderImpl();
}
private static final class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder<HasOnlyReadOnly, HasOnlyReadOnlyBuilderImpl> {
@Override
protected HasOnlyReadOnlyBuilderImpl self() {
return this;
}
@Override
public HasOnlyReadOnly build() {
return new HasOnlyReadOnly(this);
}
}
public static abstract class HasOnlyReadOnlyBuilder<C extends HasOnlyReadOnly, B extends HasOnlyReadOnlyBuilder<C, B>> {
private String bar;
private String foo;
protected abstract B self();
public abstract C build();
public B bar(String bar) {
this.bar = bar;
return self();
}
public B foo(String foo) {
this.foo = foo;
return self();
}
}
}

View File

@ -0,0 +1,320 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("MapTest")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class MapTest implements Serializable {
private @Valid Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
public enum InnerEnum {
UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower"));
private String value;
InnerEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static InnerEnum fromString(String s) {
for (InnerEnum b : InnerEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static InnerEnum fromValue(String value) {
for (InnerEnum b : InnerEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
private @Valid Map<String, Boolean> directMap = new HashMap<>();
private @Valid Map<String, Boolean> indirectMap = new HashMap<>();
protected MapTest(MapTestBuilder<?, ?> b) {
this.mapMapOfString = b.mapMapOfString;
this.mapOfEnumString = b.mapOfEnumString;
this.directMap = b.directMap;
this.indirectMap = b.indirectMap;
}
public MapTest() {
}
/**
**/
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_map_of_string")
public Map<String, Map<String, String>> getMapMapOfString() {
return mapMapOfString;
}
@JsonProperty("map_map_of_string")
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
}
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = new HashMap<>();
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
public MapTest removeMapMapOfStringItem(Map<String, String> mapMapOfStringItem) {
if (mapMapOfStringItem != null && this.mapMapOfString != null) {
this.mapMapOfString.remove(mapMapOfStringItem);
}
return this;
}
/**
**/
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map_of_enum_string")
public Map<String, InnerEnum> getMapOfEnumString() {
return mapOfEnumString;
}
@JsonProperty("map_of_enum_string")
public void setMapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = new HashMap<>();
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) {
if (mapOfEnumStringItem != null && this.mapOfEnumString != null) {
this.mapOfEnumString.remove(mapOfEnumStringItem);
}
return this;
}
/**
**/
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("direct_map")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
@JsonProperty("direct_map")
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<>();
}
this.directMap.put(key, directMapItem);
return this;
}
public MapTest removeDirectMapItem(Boolean directMapItem) {
if (directMapItem != null && this.directMap != null) {
this.directMap.remove(directMapItem);
}
return this;
}
/**
**/
public MapTest indirectMap(Map<String, Boolean> indirectMap) {
this.indirectMap = indirectMap;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("indirect_map")
public Map<String, Boolean> getIndirectMap() {
return indirectMap;
}
@JsonProperty("indirect_map")
public void setIndirectMap(Map<String, Boolean> indirectMap) {
this.indirectMap = indirectMap;
}
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = new HashMap<>();
}
this.indirectMap.put(key, indirectMapItem);
return this;
}
public MapTest removeIndirectMapItem(Boolean indirectMapItem) {
if (indirectMapItem != null && this.indirectMap != null) {
this.indirectMap.remove(indirectMapItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MapTest {\n");
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static MapTestBuilder<?, ?> builder() {
return new MapTestBuilderImpl();
}
private static final class MapTestBuilderImpl extends MapTestBuilder<MapTest, MapTestBuilderImpl> {
@Override
protected MapTestBuilderImpl self() {
return this;
}
@Override
public MapTest build() {
return new MapTest(this);
}
}
public static abstract class MapTestBuilder<C extends MapTest, B extends MapTestBuilder<C, B>> {
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
private Map<String, Boolean> directMap = new HashMap<>();
private Map<String, Boolean> indirectMap = new HashMap<>();
protected abstract B self();
public abstract C build();
public B mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return self();
}
public B mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
return self();
}
public B directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return self();
}
public B indirectMap(Map<String, Boolean> indirectMap) {
this.indirectMap = indirectMap;
return self();
}
}
}

View File

@ -0,0 +1,199 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.openapitools.model.Animal;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable {
private @Valid UUID uuid;
private @Valid LocalDateTime dateTime;
private @Valid Map<String, Animal> map = new HashMap<>();
protected MixedPropertiesAndAdditionalPropertiesClass(MixedPropertiesAndAdditionalPropertiesClassBuilder<?, ?> b) {
this.uuid = b.uuid;
this.dateTime = b.dateTime;
this.map = b.map;
}
public MixedPropertiesAndAdditionalPropertiesClass() {
}
/**
**/
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
this.uuid = uuid;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("uuid")
public UUID getUuid() {
return uuid;
}
@JsonProperty("uuid")
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
/**
**/
public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("dateTime")
public LocalDateTime getDateTime() {
return dateTime;
}
@JsonProperty("dateTime")
public void setDateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
}
/**
**/
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
this.map = map;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("map")
public Map<String, Animal> getMap() {
return map;
}
@JsonProperty("map")
public void setMap(Map<String, Animal> map) {
this.map = map;
}
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = new HashMap<>();
}
this.map.put(key, mapItem);
return this;
}
public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) {
if (mapItem != null && this.map != null) {
this.map.remove(mapItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
}
@Override
public int hashCode() {
return Objects.hash(uuid, dateTime, map);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" map: ").append(toIndentedString(map)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static MixedPropertiesAndAdditionalPropertiesClassBuilder<?, ?> builder() {
return new MixedPropertiesAndAdditionalPropertiesClassBuilderImpl();
}
private static final class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder<MixedPropertiesAndAdditionalPropertiesClass, MixedPropertiesAndAdditionalPropertiesClassBuilderImpl> {
@Override
protected MixedPropertiesAndAdditionalPropertiesClassBuilderImpl self() {
return this;
}
@Override
public MixedPropertiesAndAdditionalPropertiesClass build() {
return new MixedPropertiesAndAdditionalPropertiesClass(this);
}
}
public static abstract class MixedPropertiesAndAdditionalPropertiesClassBuilder<C extends MixedPropertiesAndAdditionalPropertiesClass, B extends MixedPropertiesAndAdditionalPropertiesClassBuilder<C, B>> {
private UUID uuid;
private LocalDateTime dateTime;
private Map<String, Animal> map = new HashMap<>();
protected abstract B self();
public abstract C build();
public B uuid(UUID uuid) {
this.uuid = uuid;
return self();
}
public B dateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
return self();
}
public B map(Map<String, Animal> map) {
this.map = map;
return self();
}
}
}

View File

@ -0,0 +1,152 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Model for testing model name starting with number
**/
@ApiModel(description = "Model for testing model name starting with number")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model name starting with number")
@JsonTypeName("200_response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Model200Response implements Serializable {
private @Valid Integer name;
private @Valid String propertyClass;
protected Model200Response(Model200ResponseBuilder<?, ?> b) {
this.name = b.name;
this.propertyClass = b.propertyClass;
}
public Model200Response() {
}
/**
**/
public Model200Response name(Integer name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public Integer getName() {
return name;
}
@JsonProperty("name")
public void setName(Integer name) {
this.name = name;
}
/**
**/
public Model200Response propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("class")
public String getPropertyClass() {
return propertyClass;
}
@JsonProperty("class")
public void setPropertyClass(String propertyClass) {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200response = (Model200Response) o;
return Objects.equals(this.name, _200response.name) &&
Objects.equals(this.propertyClass, _200response.propertyClass);
}
@Override
public int hashCode() {
return Objects.hash(name, propertyClass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model200Response {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static Model200ResponseBuilder<?, ?> builder() {
return new Model200ResponseBuilderImpl();
}
private static final class Model200ResponseBuilderImpl extends Model200ResponseBuilder<Model200Response, Model200ResponseBuilderImpl> {
@Override
protected Model200ResponseBuilderImpl self() {
return this;
}
@Override
public Model200Response build() {
return new Model200Response(this);
}
}
public static abstract class Model200ResponseBuilder<C extends Model200Response, B extends Model200ResponseBuilder<C, B>> {
private Integer name;
private String propertyClass;
protected abstract B self();
public abstract C build();
public B name(Integer name) {
this.name = name;
return self();
}
public B propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return self();
}
}
}

View File

@ -0,0 +1,179 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("ApiResponse")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ModelApiResponse implements Serializable {
private @Valid Integer code;
private @Valid String type;
private @Valid String message;
protected ModelApiResponse(ModelApiResponseBuilder<?, ?> b) {
this.code = b.code;
this.type = b.type;
this.message = b.message;
}
public ModelApiResponse() {
}
/**
**/
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("code")
public Integer getCode() {
return code;
}
@JsonProperty("code")
public void setCode(Integer code) {
this.code = code;
}
/**
**/
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
/**
**/
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("message")
public String getMessage() {
return message;
}
@JsonProperty("message")
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
}
@Override
public int hashCode() {
return Objects.hash(code, type, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ModelApiResponseBuilder<?, ?> builder() {
return new ModelApiResponseBuilderImpl();
}
private static final class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder<ModelApiResponse, ModelApiResponseBuilderImpl> {
@Override
protected ModelApiResponseBuilderImpl self() {
return this;
}
@Override
public ModelApiResponse build() {
return new ModelApiResponse(this);
}
}
public static abstract class ModelApiResponseBuilder<C extends ModelApiResponse, B extends ModelApiResponseBuilder<C, B>> {
private Integer code;
private String type;
private String message;
protected abstract B self();
public abstract C build();
public B code(Integer code) {
this.code = code;
return self();
}
public B type(String type) {
this.type = type;
return self();
}
public B message(String message) {
this.message = message;
return self();
}
}
}

View File

@ -0,0 +1,124 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Must be named &#x60;File&#x60; for test.
**/
@ApiModel(description = "Must be named `File` for test.")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Must be named `File` for test.")
@JsonTypeName("File")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ModelFile implements Serializable {
private @Valid String sourceURI;
protected ModelFile(ModelFileBuilder<?, ?> b) {
this.sourceURI = b.sourceURI;
}
public ModelFile() {
}
/**
* Test capitalization
**/
public ModelFile sourceURI(String sourceURI) {
this.sourceURI = sourceURI;
return this;
}
@ApiModelProperty(value = "Test capitalization")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Test capitalization")
@JsonProperty("sourceURI")
public String getSourceURI() {
return sourceURI;
}
@JsonProperty("sourceURI")
public void setSourceURI(String sourceURI) {
this.sourceURI = sourceURI;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelFile _file = (ModelFile) o;
return Objects.equals(this.sourceURI, _file.sourceURI);
}
@Override
public int hashCode() {
return Objects.hash(sourceURI);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelFile {\n");
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ModelFileBuilder<?, ?> builder() {
return new ModelFileBuilderImpl();
}
private static final class ModelFileBuilderImpl extends ModelFileBuilder<ModelFile, ModelFileBuilderImpl> {
@Override
protected ModelFileBuilderImpl self() {
return this;
}
@Override
public ModelFile build() {
return new ModelFile(this);
}
}
public static abstract class ModelFileBuilder<C extends ModelFile, B extends ModelFileBuilder<C, B>> {
private String sourceURI;
protected abstract B self();
public abstract C build();
public B sourceURI(String sourceURI) {
this.sourceURI = sourceURI;
return self();
}
}
}

View File

@ -0,0 +1,121 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("List")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ModelList implements Serializable {
private @Valid String _123list;
protected ModelList(ModelListBuilder<?, ?> b) {
this._123list = b._123list;
}
public ModelList() {
}
/**
**/
public ModelList _123list(String _123list) {
this._123list = _123list;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("123-list")
public String get123list() {
return _123list;
}
@JsonProperty("123-list")
public void set123list(String _123list) {
this._123list = _123list;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelList _list = (ModelList) o;
return Objects.equals(this._123list, _list._123list);
}
@Override
public int hashCode() {
return Objects.hash(_123list);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelList {\n");
sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ModelListBuilder<?, ?> builder() {
return new ModelListBuilderImpl();
}
private static final class ModelListBuilderImpl extends ModelListBuilder<ModelList, ModelListBuilderImpl> {
@Override
protected ModelListBuilderImpl self() {
return this;
}
@Override
public ModelList build() {
return new ModelList(this);
}
}
public static abstract class ModelListBuilder<C extends ModelList, B extends ModelListBuilder<C, B>> {
private String _123list;
protected abstract B self();
public abstract C build();
public B _123list(String _123list) {
this._123list = _123list;
return self();
}
}
}

View File

@ -0,0 +1,123 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Model for testing reserved words
**/
@ApiModel(description = "Model for testing reserved words")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing reserved words")
@JsonTypeName("Return")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ModelReturn implements Serializable {
private @Valid Integer _return;
protected ModelReturn(ModelReturnBuilder<?, ?> b) {
this._return = b._return;
}
public ModelReturn() {
}
/**
**/
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("return")
public Integer getReturn() {
return _return;
}
@JsonProperty("return")
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(this._return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ModelReturnBuilder<?, ?> builder() {
return new ModelReturnBuilderImpl();
}
private static final class ModelReturnBuilderImpl extends ModelReturnBuilder<ModelReturn, ModelReturnBuilderImpl> {
@Override
protected ModelReturnBuilderImpl self() {
return this;
}
@Override
public ModelReturn build() {
return new ModelReturn(this);
}
}
public static abstract class ModelReturnBuilder<C extends ModelReturn, B extends ModelReturnBuilder<C, B>> {
private Integer _return;
protected abstract B self();
public abstract C build();
public B _return(Integer _return) {
this._return = _return;
return self();
}
}
}

View File

@ -0,0 +1,210 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Model for testing model name same as property name
**/
@ApiModel(description = "Model for testing model name same as property name")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model name same as property name")
@JsonTypeName("Name")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Name implements Serializable {
private @Valid Integer name;
private @Valid Integer snakeCase;
private @Valid String property;
private @Valid Integer _123number;
protected Name(NameBuilder<?, ?> b) {
this.name = b.name;
this.snakeCase = b.snakeCase;
this.property = b.property;
this._123number = b._123number;
}
public Name() {
}
/**
**/
public Name name(Integer name) {
this.name = name;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("name")
@NotNull
public Integer getName() {
return name;
}
@JsonProperty("name")
public void setName(Integer name) {
this.name = name;
}
/**
**/
public Name snakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("snake_case")
public Integer getSnakeCase() {
return snakeCase;
}
@JsonProperty("snake_case")
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
}
/**
**/
public Name property(String property) {
this.property = property;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("property")
public String getProperty() {
return property;
}
@JsonProperty("property")
public void setProperty(String property) {
this.property = property;
}
/**
**/
public Name _123number(Integer _123number) {
this._123number = _123number;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("123Number")
public Integer get123number() {
return _123number;
}
@JsonProperty("123Number")
public void set123number(Integer _123number) {
this._123number = _123number;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Name name = (Name) o;
return Objects.equals(this.name, name.name) &&
Objects.equals(this.snakeCase, name.snakeCase) &&
Objects.equals(this.property, name.property) &&
Objects.equals(this._123number, name._123number);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase, property, _123number);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Name {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static NameBuilder<?, ?> builder() {
return new NameBuilderImpl();
}
private static final class NameBuilderImpl extends NameBuilder<Name, NameBuilderImpl> {
@Override
protected NameBuilderImpl self() {
return this;
}
@Override
public Name build() {
return new Name(this);
}
}
public static abstract class NameBuilder<C extends Name, B extends NameBuilder<C, B>> {
private Integer name;
private Integer snakeCase;
private String property;
private Integer _123number;
protected abstract B self();
public abstract C build();
public B name(Integer name) {
this.name = name;
return self();
}
public B snakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
return self();
}
public B property(String property) {
this.property = property;
return self();
}
public B _123number(Integer _123number) {
this._123number = _123number;
return self();
}
}
}

View File

@ -0,0 +1,121 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("NumberOnly")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class NumberOnly implements Serializable {
private @Valid BigDecimal justNumber;
protected NumberOnly(NumberOnlyBuilder<?, ?> b) {
this.justNumber = b.justNumber;
}
public NumberOnly() {
}
/**
**/
public NumberOnly justNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("JustNumber")
public BigDecimal getJustNumber() {
return justNumber;
}
@JsonProperty("JustNumber")
public void setJustNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NumberOnly numberOnly = (NumberOnly) o;
return Objects.equals(this.justNumber, numberOnly.justNumber);
}
@Override
public int hashCode() {
return Objects.hash(justNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NumberOnly {\n");
sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static NumberOnlyBuilder<?, ?> builder() {
return new NumberOnlyBuilderImpl();
}
private static final class NumberOnlyBuilderImpl extends NumberOnlyBuilder<NumberOnly, NumberOnlyBuilderImpl> {
@Override
protected NumberOnlyBuilderImpl self() {
return this;
}
@Override
public NumberOnly build() {
return new NumberOnly(this);
}
}
public static abstract class NumberOnlyBuilder<C extends NumberOnly, B extends NumberOnlyBuilder<C, B>> {
private BigDecimal justNumber;
protected abstract B self();
public abstract C build();
public B justNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
return self();
}
}
}

View File

@ -0,0 +1,314 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Order")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Order implements Serializable {
private @Valid Long id;
private @Valid Long petId;
private @Valid Integer quantity;
private @Valid LocalDateTime shipDate;
public enum StatusEnum {
PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered"));
private String value;
StatusEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static StatusEnum fromString(String s) {
for (StatusEnum b : StatusEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid StatusEnum status;
private @Valid Boolean complete = false;
protected Order(OrderBuilder<?, ?> b) {
this.id = b.id;
this.petId = b.petId;
this.quantity = b.quantity;
this.shipDate = b.shipDate;
this.status = b.status;
this.complete = b.complete;
}
public Order() {
}
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("id")
public Long getId() {
return id;
}
@JsonProperty("id")
public void setId(Long id) {
this.id = id;
}
/**
**/
public Order petId(Long petId) {
this.petId = petId;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("petId")
public Long getPetId() {
return petId;
}
@JsonProperty("petId")
public void setPetId(Long petId) {
this.petId = petId;
}
/**
**/
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("quantity")
public Integer getQuantity() {
return quantity;
}
@JsonProperty("quantity")
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
**/
public Order shipDate(LocalDateTime shipDate) {
this.shipDate = shipDate;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("shipDate")
public LocalDateTime getShipDate() {
return shipDate;
}
@JsonProperty("shipDate")
public void setShipDate(LocalDateTime shipDate) {
this.shipDate = shipDate;
}
/**
* Order Status
**/
public Order status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(value = "Order Status")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Order Status")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
@JsonProperty("status")
public void setStatus(StatusEnum status) {
this.status = status;
}
/**
**/
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("complete")
public Boolean getComplete() {
return complete;
}
@JsonProperty("complete")
public void setComplete(Boolean complete) {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
}
@Override
public int hashCode() {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static OrderBuilder<?, ?> builder() {
return new OrderBuilderImpl();
}
private static final class OrderBuilderImpl extends OrderBuilder<Order, OrderBuilderImpl> {
@Override
protected OrderBuilderImpl self() {
return this;
}
@Override
public Order build() {
return new Order(this);
}
}
public static abstract class OrderBuilder<C extends Order, B extends OrderBuilder<C, B>> {
private Long id;
private Long petId;
private Integer quantity;
private LocalDateTime shipDate;
private StatusEnum status;
private Boolean complete = false;
protected abstract B self();
public abstract C build();
public B id(Long id) {
this.id = id;
return self();
}
public B petId(Long petId) {
this.petId = petId;
return self();
}
public B quantity(Integer quantity) {
this.quantity = quantity;
return self();
}
public B shipDate(LocalDateTime shipDate) {
this.shipDate = shipDate;
return self();
}
public B status(StatusEnum status) {
this.status = status;
return self();
}
public B complete(Boolean complete) {
this.complete = complete;
return self();
}
}
}

View File

@ -0,0 +1,179 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("OuterComposite")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class OuterComposite implements Serializable {
private @Valid BigDecimal myNumber;
private @Valid String myString;
private @Valid Boolean myBoolean;
protected OuterComposite(OuterCompositeBuilder<?, ?> b) {
this.myNumber = b.myNumber;
this.myString = b.myString;
this.myBoolean = b.myBoolean;
}
public OuterComposite() {
}
/**
**/
public OuterComposite myNumber(BigDecimal myNumber) {
this.myNumber = myNumber;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("my_number")
public BigDecimal getMyNumber() {
return myNumber;
}
@JsonProperty("my_number")
public void setMyNumber(BigDecimal myNumber) {
this.myNumber = myNumber;
}
/**
**/
public OuterComposite myString(String myString) {
this.myString = myString;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("my_string")
public String getMyString() {
return myString;
}
@JsonProperty("my_string")
public void setMyString(String myString) {
this.myString = myString;
}
/**
**/
public OuterComposite myBoolean(Boolean myBoolean) {
this.myBoolean = myBoolean;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("my_boolean")
public Boolean getMyBoolean() {
return myBoolean;
}
@JsonProperty("my_boolean")
public void setMyBoolean(Boolean myBoolean) {
this.myBoolean = myBoolean;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OuterComposite outerComposite = (OuterComposite) o;
return Objects.equals(this.myNumber, outerComposite.myNumber) &&
Objects.equals(this.myString, outerComposite.myString) &&
Objects.equals(this.myBoolean, outerComposite.myBoolean);
}
@Override
public int hashCode() {
return Objects.hash(myNumber, myString, myBoolean);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OuterComposite {\n");
sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static OuterCompositeBuilder<?, ?> builder() {
return new OuterCompositeBuilderImpl();
}
private static final class OuterCompositeBuilderImpl extends OuterCompositeBuilder<OuterComposite, OuterCompositeBuilderImpl> {
@Override
protected OuterCompositeBuilderImpl self() {
return this;
}
@Override
public OuterComposite build() {
return new OuterComposite(this);
}
}
public static abstract class OuterCompositeBuilder<C extends OuterComposite, B extends OuterCompositeBuilder<C, B>> {
private BigDecimal myNumber;
private String myString;
private Boolean myBoolean;
protected abstract B self();
public abstract C build();
public B myNumber(BigDecimal myNumber) {
this.myNumber = myNumber;
return self();
}
public B myString(String myString) {
this.myString = myString;
return self();
}
public B myBoolean(Boolean myBoolean) {
this.myBoolean = myBoolean;
return self();
}
}
}

View File

@ -0,0 +1,59 @@
package org.openapitools.model;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* Gets or Sets OuterEnum
*/
public enum OuterEnum {
PLACED("placed"),
APPROVED("approved"),
DELIVERED("delivered");
private String value;
OuterEnum(String value) {
this.value = value;
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static OuterEnum fromString(String s) {
for (OuterEnum b : OuterEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static OuterEnum fromValue(String value) {
for (OuterEnum b : OuterEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}

View File

@ -0,0 +1,355 @@
package org.openapitools.model;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.openapitools.model.Category;
import org.openapitools.model.Tag;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Pet")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Pet implements Serializable {
private @Valid Long id;
private @Valid Category category;
private @Valid String name;
private @Valid Set<String> photoUrls = new LinkedHashSet<>();
private @Valid List<Tag> tags;
public enum StatusEnum {
AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold"));
private String value;
StatusEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
/**
* Convert a String into String, as specified in the
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
*/
public static StatusEnum fromString(String s) {
for (StatusEnum b : StatusEnum.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Valid StatusEnum status;
protected Pet(PetBuilder<?, ?> b) {
this.id = b.id;
this.category = b.category;
this.name = b.name;
this.photoUrls = b.photoUrls;
this.tags = b.tags;
this.status = b.status;
}
public Pet() {
}
/**
**/
public Pet id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("id")
public Long getId() {
return id;
}
@JsonProperty("id")
public void setId(Long id) {
this.id = id;
}
/**
**/
public Pet category(Category category) {
this.category = category;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("category")
public Category getCategory() {
return category;
}
@JsonProperty("category")
public void setCategory(Category category) {
this.category = category;
}
/**
**/
public Pet name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(example = "doggie", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "doggie", required = true, description = "")
@JsonProperty("name")
@NotNull
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
/**
**/
public Pet photoUrls(Set<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("photoUrls")
@NotNull
public Set<String> getPhotoUrls() {
return photoUrls;
}
@JsonProperty("photoUrls")
@JsonDeserialize(as = LinkedHashSet.class)
public void setPhotoUrls(Set<String> photoUrls) {
this.photoUrls = photoUrls;
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new LinkedHashSet<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}
public Pet removePhotoUrlsItem(String photoUrlsItem) {
if (photoUrlsItem != null && this.photoUrls != null) {
this.photoUrls.remove(photoUrlsItem);
}
return this;
}
/**
**/
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
}
@JsonProperty("tags")
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
public Pet removeTagsItem(Tag tagsItem) {
if (tagsItem != null && this.tags != null) {
this.tags.remove(tagsItem);
}
return this;
}
/**
* pet status in the store
**/
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
@ApiModelProperty(value = "pet status in the store")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
@JsonProperty("status")
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
}
@Override
public int hashCode() {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static PetBuilder<?, ?> builder() {
return new PetBuilderImpl();
}
private static final class PetBuilderImpl extends PetBuilder<Pet, PetBuilderImpl> {
@Override
protected PetBuilderImpl self() {
return this;
}
@Override
public Pet build() {
return new Pet(this);
}
}
public static abstract class PetBuilder<C extends Pet, B extends PetBuilder<C, B>> {
private Long id;
private Category category;
private String name;
private Set<String> photoUrls = new LinkedHashSet<>();
private List<Tag> tags;
private StatusEnum status;
protected abstract B self();
public abstract C build();
public B id(Long id) {
this.id = id;
return self();
}
public B category(Category category) {
this.category = category;
return self();
}
public B name(String name) {
this.name = name;
return self();
}
public B photoUrls(Set<String> photoUrls) {
this.photoUrls = photoUrls;
return self();
}
public B tags(List<Tag> tags) {
this.tags = tags;
return self();
}
public B status(StatusEnum status) {
this.status = status;
return self();
}
}
}

View File

@ -0,0 +1,149 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("ReadOnlyFirst")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class ReadOnlyFirst implements Serializable {
private @Valid String bar;
private @Valid String baz;
protected ReadOnlyFirst(ReadOnlyFirstBuilder<?, ?> b) {
this.bar = b.bar;
this.baz = b.baz;
}
public ReadOnlyFirst() {
}
/**
**/
public ReadOnlyFirst bar(String bar) {
this.bar = bar;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("bar")
public String getBar() {
return bar;
}
@JsonProperty("bar")
public void setBar(String bar) {
this.bar = bar;
}
/**
**/
public ReadOnlyFirst baz(String baz) {
this.baz = baz;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("baz")
public String getBaz() {
return baz;
}
@JsonProperty("baz")
public void setBaz(String baz) {
this.baz = baz;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
return Objects.equals(this.bar, readOnlyFirst.bar) &&
Objects.equals(this.baz, readOnlyFirst.baz);
}
@Override
public int hashCode() {
return Objects.hash(bar, baz);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReadOnlyFirst {\n");
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
sb.append(" baz: ").append(toIndentedString(baz)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static ReadOnlyFirstBuilder<?, ?> builder() {
return new ReadOnlyFirstBuilderImpl();
}
private static final class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder<ReadOnlyFirst, ReadOnlyFirstBuilderImpl> {
@Override
protected ReadOnlyFirstBuilderImpl self() {
return this;
}
@Override
public ReadOnlyFirst build() {
return new ReadOnlyFirst(this);
}
}
public static abstract class ReadOnlyFirstBuilder<C extends ReadOnlyFirst, B extends ReadOnlyFirstBuilder<C, B>> {
private String bar;
private String baz;
protected abstract B self();
public abstract C build();
public B bar(String bar) {
this.bar = bar;
return self();
}
public B baz(String baz) {
this.baz = baz;
return self();
}
}
}

View File

@ -0,0 +1,121 @@
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("$special[model.name]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class SpecialModelName implements Serializable {
private @Valid Long $specialPropertyName;
protected SpecialModelName(SpecialModelNameBuilder<?, ?> b) {
this.$specialPropertyName = b.$specialPropertyName;
}
public SpecialModelName() {
}
/**
**/
public SpecialModelName $specialPropertyName(Long $specialPropertyName) {
this.$specialPropertyName = $specialPropertyName;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("$special[property.name]")
public Long get$SpecialPropertyName() {
return $specialPropertyName;
}
@JsonProperty("$special[property.name]")
public void set$SpecialPropertyName(Long $specialPropertyName) {
this.$specialPropertyName = $specialPropertyName;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName $specialModelName = (SpecialModelName) o;
return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash($specialPropertyName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static SpecialModelNameBuilder<?, ?> builder() {
return new SpecialModelNameBuilderImpl();
}
private static final class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder<SpecialModelName, SpecialModelNameBuilderImpl> {
@Override
protected SpecialModelNameBuilderImpl self() {
return this;
}
@Override
public SpecialModelName build() {
return new SpecialModelName(this);
}
}
public static abstract class SpecialModelNameBuilder<C extends SpecialModelName, B extends SpecialModelNameBuilder<C, B>> {
private Long $specialPropertyName;
protected abstract B self();
public abstract C build();
public B $specialPropertyName(Long $specialPropertyName) {
this.$specialPropertyName = $specialPropertyName;
return self();
}
}
}

View File

@ -0,0 +1,149 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("Tag")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class Tag implements Serializable {
private @Valid Long id;
private @Valid String name;
protected Tag(TagBuilder<?, ?> b) {
this.id = b.id;
this.name = b.name;
}
public Tag() {
}
/**
**/
public Tag id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("id")
public Long getId() {
return id;
}
@JsonProperty("id")
public void setId(Long id) {
this.id = id;
}
/**
**/
public Tag name(String name) {
this.name = name;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Tag {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static TagBuilder<?, ?> builder() {
return new TagBuilderImpl();
}
private static final class TagBuilderImpl extends TagBuilder<Tag, TagBuilderImpl> {
@Override
protected TagBuilderImpl self() {
return this;
}
@Override
public Tag build() {
return new Tag(this);
}
}
public static abstract class TagBuilder<C extends Tag, B extends TagBuilder<C, B>> {
private Long id;
private String name;
protected abstract B self();
public abstract C build();
public B id(Long id) {
this.id = id;
return self();
}
public B name(String name) {
this.name = name;
return self();
}
}
}

View File

@ -0,0 +1,260 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("TypeHolderDefault")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class TypeHolderDefault implements Serializable {
private @Valid String stringItem = "what";
private @Valid BigDecimal numberItem;
private @Valid Integer integerItem;
private @Valid Boolean boolItem = true;
private @Valid List<Integer> arrayItem = new ArrayList<>();
protected TypeHolderDefault(TypeHolderDefaultBuilder<?, ?> b) {
this.stringItem = b.stringItem;
this.numberItem = b.numberItem;
this.integerItem = b.integerItem;
this.boolItem = b.boolItem;
this.arrayItem = b.arrayItem;
}
public TypeHolderDefault() {
}
/**
**/
public TypeHolderDefault stringItem(String stringItem) {
this.stringItem = stringItem;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("string_item")
@NotNull
public String getStringItem() {
return stringItem;
}
@JsonProperty("string_item")
public void setStringItem(String stringItem) {
this.stringItem = stringItem;
}
/**
**/
public TypeHolderDefault numberItem(BigDecimal numberItem) {
this.numberItem = numberItem;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("number_item")
@NotNull
public BigDecimal getNumberItem() {
return numberItem;
}
@JsonProperty("number_item")
public void setNumberItem(BigDecimal numberItem) {
this.numberItem = numberItem;
}
/**
**/
public TypeHolderDefault integerItem(Integer integerItem) {
this.integerItem = integerItem;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("integer_item")
@NotNull
public Integer getIntegerItem() {
return integerItem;
}
@JsonProperty("integer_item")
public void setIntegerItem(Integer integerItem) {
this.integerItem = integerItem;
}
/**
**/
public TypeHolderDefault boolItem(Boolean boolItem) {
this.boolItem = boolItem;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("bool_item")
@NotNull
public Boolean getBoolItem() {
return boolItem;
}
@JsonProperty("bool_item")
public void setBoolItem(Boolean boolItem) {
this.boolItem = boolItem;
}
/**
**/
public TypeHolderDefault arrayItem(List<Integer> arrayItem) {
this.arrayItem = arrayItem;
return this;
}
@ApiModelProperty(required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "")
@JsonProperty("array_item")
@NotNull
public List<Integer> getArrayItem() {
return arrayItem;
}
@JsonProperty("array_item")
public void setArrayItem(List<Integer> arrayItem) {
this.arrayItem = arrayItem;
}
public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}
public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) {
if (arrayItemItem != null && this.arrayItem != null) {
this.arrayItem.remove(arrayItemItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o;
return Objects.equals(this.stringItem, typeHolderDefault.stringItem) &&
Objects.equals(this.numberItem, typeHolderDefault.numberItem) &&
Objects.equals(this.integerItem, typeHolderDefault.integerItem) &&
Objects.equals(this.boolItem, typeHolderDefault.boolItem) &&
Objects.equals(this.arrayItem, typeHolderDefault.arrayItem);
}
@Override
public int hashCode() {
return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TypeHolderDefault {\n");
sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n");
sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n");
sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n");
sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n");
sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static TypeHolderDefaultBuilder<?, ?> builder() {
return new TypeHolderDefaultBuilderImpl();
}
private static final class TypeHolderDefaultBuilderImpl extends TypeHolderDefaultBuilder<TypeHolderDefault, TypeHolderDefaultBuilderImpl> {
@Override
protected TypeHolderDefaultBuilderImpl self() {
return this;
}
@Override
public TypeHolderDefault build() {
return new TypeHolderDefault(this);
}
}
public static abstract class TypeHolderDefaultBuilder<C extends TypeHolderDefault, B extends TypeHolderDefaultBuilder<C, B>> {
private String stringItem = "what";
private BigDecimal numberItem;
private Integer integerItem;
private Boolean boolItem = true;
private List<Integer> arrayItem = new ArrayList<>();
protected abstract B self();
public abstract C build();
public B stringItem(String stringItem) {
this.stringItem = stringItem;
return self();
}
public B numberItem(BigDecimal numberItem) {
this.numberItem = numberItem;
return self();
}
public B integerItem(Integer integerItem) {
this.integerItem = integerItem;
return self();
}
public B boolItem(Boolean boolItem) {
this.boolItem = boolItem;
return self();
}
public B arrayItem(List<Integer> arrayItem) {
this.arrayItem = arrayItem;
return self();
}
}
}

View File

@ -0,0 +1,290 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("TypeHolderExample")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class TypeHolderExample implements Serializable {
private @Valid String stringItem;
private @Valid BigDecimal numberItem;
private @Valid Float floatItem;
private @Valid Integer integerItem;
private @Valid Boolean boolItem;
private @Valid List<Integer> arrayItem = new ArrayList<>();
protected TypeHolderExample(TypeHolderExampleBuilder<?, ?> b) {
this.stringItem = b.stringItem;
this.numberItem = b.numberItem;
this.floatItem = b.floatItem;
this.integerItem = b.integerItem;
this.boolItem = b.boolItem;
this.arrayItem = b.arrayItem;
}
public TypeHolderExample() {
}
/**
**/
public TypeHolderExample stringItem(String stringItem) {
this.stringItem = stringItem;
return this;
}
@ApiModelProperty(example = "what", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "what", required = true, description = "")
@JsonProperty("string_item")
@NotNull
public String getStringItem() {
return stringItem;
}
@JsonProperty("string_item")
public void setStringItem(String stringItem) {
this.stringItem = stringItem;
}
/**
**/
public TypeHolderExample numberItem(BigDecimal numberItem) {
this.numberItem = numberItem;
return this;
}
@ApiModelProperty(example = "1.234", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", required = true, description = "")
@JsonProperty("number_item")
@NotNull
public BigDecimal getNumberItem() {
return numberItem;
}
@JsonProperty("number_item")
public void setNumberItem(BigDecimal numberItem) {
this.numberItem = numberItem;
}
/**
**/
public TypeHolderExample floatItem(Float floatItem) {
this.floatItem = floatItem;
return this;
}
@ApiModelProperty(example = "1.234", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", required = true, description = "")
@JsonProperty("float_item")
@NotNull
public Float getFloatItem() {
return floatItem;
}
@JsonProperty("float_item")
public void setFloatItem(Float floatItem) {
this.floatItem = floatItem;
}
/**
**/
public TypeHolderExample integerItem(Integer integerItem) {
this.integerItem = integerItem;
return this;
}
@ApiModelProperty(example = "-2", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", required = true, description = "")
@JsonProperty("integer_item")
@NotNull
public Integer getIntegerItem() {
return integerItem;
}
@JsonProperty("integer_item")
public void setIntegerItem(Integer integerItem) {
this.integerItem = integerItem;
}
/**
**/
public TypeHolderExample boolItem(Boolean boolItem) {
this.boolItem = boolItem;
return this;
}
@ApiModelProperty(example = "true", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", required = true, description = "")
@JsonProperty("bool_item")
@NotNull
public Boolean getBoolItem() {
return boolItem;
}
@JsonProperty("bool_item")
public void setBoolItem(Boolean boolItem) {
this.boolItem = boolItem;
}
/**
**/
public TypeHolderExample arrayItem(List<Integer> arrayItem) {
this.arrayItem = arrayItem;
return this;
}
@ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(example = "[0, 1, 2, 3]", required = true, description = "")
@JsonProperty("array_item")
@NotNull
public List<Integer> getArrayItem() {
return arrayItem;
}
@JsonProperty("array_item")
public void setArrayItem(List<Integer> arrayItem) {
this.arrayItem = arrayItem;
}
public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}
public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) {
if (arrayItemItem != null && this.arrayItem != null) {
this.arrayItem.remove(arrayItemItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TypeHolderExample typeHolderExample = (TypeHolderExample) o;
return Objects.equals(this.stringItem, typeHolderExample.stringItem) &&
Objects.equals(this.numberItem, typeHolderExample.numberItem) &&
Objects.equals(this.floatItem, typeHolderExample.floatItem) &&
Objects.equals(this.integerItem, typeHolderExample.integerItem) &&
Objects.equals(this.boolItem, typeHolderExample.boolItem) &&
Objects.equals(this.arrayItem, typeHolderExample.arrayItem);
}
@Override
public int hashCode() {
return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TypeHolderExample {\n");
sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n");
sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n");
sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n");
sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n");
sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n");
sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static TypeHolderExampleBuilder<?, ?> builder() {
return new TypeHolderExampleBuilderImpl();
}
private static final class TypeHolderExampleBuilderImpl extends TypeHolderExampleBuilder<TypeHolderExample, TypeHolderExampleBuilderImpl> {
@Override
protected TypeHolderExampleBuilderImpl self() {
return this;
}
@Override
public TypeHolderExample build() {
return new TypeHolderExample(this);
}
}
public static abstract class TypeHolderExampleBuilder<C extends TypeHolderExample, B extends TypeHolderExampleBuilder<C, B>> {
private String stringItem;
private BigDecimal numberItem;
private Float floatItem;
private Integer integerItem;
private Boolean boolItem;
private List<Integer> arrayItem = new ArrayList<>();
protected abstract B self();
public abstract C build();
public B stringItem(String stringItem) {
this.stringItem = stringItem;
return self();
}
public B numberItem(BigDecimal numberItem) {
this.numberItem = numberItem;
return self();
}
public B floatItem(Float floatItem) {
this.floatItem = floatItem;
return self();
}
public B integerItem(Integer integerItem) {
this.integerItem = integerItem;
return self();
}
public B boolItem(Boolean boolItem) {
this.boolItem = boolItem;
return self();
}
public B arrayItem(List<Integer> arrayItem) {
this.arrayItem = arrayItem;
return self();
}
}
}

View File

@ -0,0 +1,324 @@
package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@org.eclipse.microprofile.openapi.annotations.media.Schema(description="")
@JsonTypeName("User")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")
public class User implements Serializable {
private @Valid Long id;
private @Valid String username;
private @Valid String firstName;
private @Valid String lastName;
private @Valid String email;
private @Valid String password;
private @Valid String phone;
private @Valid Integer userStatus;
protected User(UserBuilder<?, ?> b) {
this.id = b.id;
this.username = b.username;
this.firstName = b.firstName;
this.lastName = b.lastName;
this.email = b.email;
this.password = b.password;
this.phone = b.phone;
this.userStatus = b.userStatus;
}
public User() {
}
/**
**/
public User id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("id")
public Long getId() {
return id;
}
@JsonProperty("id")
public void setId(Long id) {
this.id = id;
}
/**
**/
public User username(String username) {
this.username = username;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("username")
public String getUsername() {
return username;
}
@JsonProperty("username")
public void setUsername(String username) {
this.username = username;
}
/**
**/
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("firstName")
public String getFirstName() {
return firstName;
}
@JsonProperty("firstName")
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
**/
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("lastName")
public String getLastName() {
return lastName;
}
@JsonProperty("lastName")
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
**/
public User email(String email) {
this.email = email;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("email")
public String getEmail() {
return email;
}
@JsonProperty("email")
public void setEmail(String email) {
this.email = email;
}
/**
**/
public User password(String password) {
this.password = password;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("password")
public String getPassword() {
return password;
}
@JsonProperty("password")
public void setPassword(String password) {
this.password = password;
}
/**
**/
public User phone(String phone) {
this.phone = phone;
return this;
}
@ApiModelProperty(value = "")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "")
@JsonProperty("phone")
public String getPhone() {
return phone;
}
@JsonProperty("phone")
public void setPhone(String phone) {
this.phone = phone;
}
/**
* User Status
**/
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
@ApiModelProperty(value = "User Status")
@org.eclipse.microprofile.openapi.annotations.media.Schema(description = "User Status")
@JsonProperty("userStatus")
public Integer getUserStatus() {
return userStatus;
}
@JsonProperty("userStatus")
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
}
@Override
public int hashCode() {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class User {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static UserBuilder<?, ?> builder() {
return new UserBuilderImpl();
}
private static final class UserBuilderImpl extends UserBuilder<User, UserBuilderImpl> {
@Override
protected UserBuilderImpl self() {
return this;
}
@Override
public User build() {
return new User(this);
}
}
public static abstract class UserBuilder<C extends User, B extends UserBuilder<C, B>> {
private Long id;
private String username;
private String firstName;
private String lastName;
private String email;
private String password;
private String phone;
private Integer userStatus;
protected abstract B self();
public abstract C build();
public B id(Long id) {
this.id = id;
return self();
}
public B username(String username) {
this.username = username;
return self();
}
public B firstName(String firstName) {
this.firstName = firstName;
return self();
}
public B lastName(String lastName) {
this.lastName = lastName;
return self();
}
public B email(String email) {
this.email = email;
return self();
}
public B password(String password) {
this.password = password;
return self();
}
public B phone(String phone) {
this.phone = phone;
return self();
}
public B userStatus(Integer userStatus) {
this.userStatus = userStatus;
return self();
}
}
}

View File

@ -0,0 +1,34 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the docker image run:
#
# mvn package
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/jaxrs-spec-petstore-server-jvm .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/jaxrs-spec-petstore-server-jvm
#
###
FROM fabric8/java-alpine-openjdk8-jre:1.6.5
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV AB_ENABLED=jmx_exporter
# Be prepared for running in OpenShift too
RUN adduser -G root --no-create-home --disabled-password 1001 \
&& chown -R 1001 /deployments \
&& chmod -R "g+rwX" /deployments \
&& chown -R 1001:root /deployments
COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/app.jar
EXPOSE 8080
# run with user 1001
USER 1001
ENTRYPOINT [ "/deployments/run-java.sh" ]

View File

@ -0,0 +1,22 @@
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode
#
# Before building the docker image run:
#
# mvn package -Pnative -Dquarkus.native.container-build=true
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native -t quarkus/jaxrs-spec-petstore-server .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/jaxrs-spec-petstore-server
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal
WORKDIR /work/
COPY target/*-runner /work/application
RUN chmod 775 /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

View File

@ -0,0 +1,5 @@
# Configuration file
# key = value
mp.openapi.scan.disable=true