[Jaxrs-cxf] Add check for useGenericResponse for jaxrs-cxf server + client (#4779)

* add check for useGenericResponse for jaxrs-cxf

* move check for genericresponse to cxf codegen #4713
This commit is contained in:
jfiala
2017-04-02 10:05:16 +02:00
committed by wing328
parent bc8e16e3f8
commit ca6b5d09d0
57 changed files with 2935 additions and 317 deletions

View File

@@ -1,15 +1,25 @@
package io.swagger.codegen.languages;
import io.swagger.codegen.*;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.Swagger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.CodegenResponse;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.Swagger;
public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures {
/**
@@ -25,8 +35,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);
public AbstractJavaJAXRSServerCodegen()
{
public AbstractJavaJAXRSServerCodegen() {
super();
sourceFolder = "src/gen/java";
@@ -46,7 +55,6 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(new CliOption("serverPort", "The port on which the server should be started"));
}
@@ -55,8 +63,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
// ===============
@Override
public CodegenType getTag()
{
public CodegenType getTag() {
return CodegenType.SERVER;
}
@@ -84,7 +91,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
swagger.setBasePath("");
}
if(!this.additionalProperties.containsKey("serverPort")) {
if (!this.additionalProperties.containsKey("serverPort")) {
final String host = swagger.getHost();
String port = "8080"; // Default value for a JEE Server
if ( host != null ) {
@@ -235,4 +242,5 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
this.useBeanValidation = useBeanValidation;
}
}

View File

@@ -11,19 +11,22 @@ import org.slf4j.LoggerFactory;
import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenResponse;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.SupportingFile;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.GzipTestFeatures;
import io.swagger.codegen.languages.features.JaxbFeatures;
import io.swagger.codegen.languages.features.LoggingTestFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.models.Operation;
public class JavaCXFClientCodegen extends AbstractJavaCodegen
implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures
{
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class);
implements BeanValidationFeatures, UseGenericResponseFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures {
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class);
/**
* Name of the sub-directory in "src/main/resource" where to find the
@@ -34,6 +37,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
protected boolean useJaxbAnnotations = true;
protected boolean useBeanValidation = false;
protected boolean useGenericResponse = false;
protected boolean useGzipFeatureForTests = false;
@@ -75,7 +80,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests"));
cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests"));
cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response"));
}
@@ -93,6 +98,14 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
boolean useBeanValidationProp = convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION);
this.setUseBeanValidation(useBeanValidationProp);
}
if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) {
this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE));
}
if (useGenericResponse) {
writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse);
}
this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS));
this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS));
@@ -132,6 +145,28 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
model.imports.remove("ToStringSerializer");
}
@Override
@SuppressWarnings("unchecked")
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
objs = super.postProcessOperations(objs);
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
if (operations != null) {
List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation operation : ops) {
if (operation.returnType == null) {
operation.returnType = "void";
// set vendorExtensions.x-java-is-response-void to true as
// returnType is set to "void"
operation.vendorExtensions.put("x-java-is-response-void", true);
}
}
}
return operations;
}
@Override
public String getHelp()
{
@@ -155,4 +190,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
this.useLoggingFeatureForTests = useLoggingFeatureForTests;
}
public void setUseGenericResponse(boolean useGenericResponse) {
this.useGenericResponse = useGenericResponse;
}
}

View File

@@ -17,10 +17,11 @@ import io.swagger.codegen.languages.features.CXFServerFeatures;
import io.swagger.codegen.languages.features.GzipTestFeatures;
import io.swagger.codegen.languages.features.JaxbFeatures;
import io.swagger.codegen.languages.features.LoggingTestFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.models.Operation;
public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures
implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures, UseGenericResponseFeatures
{
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFServerCodegen.class);
@@ -58,6 +59,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
protected boolean generateNonSpringApplication = false;
protected boolean useGenericResponse = false;
public JavaCXFServerCodegen()
{
super();
@@ -111,6 +114,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
cliOptions.add(CliOption.newBoolean(USE_ANNOTATED_BASE_PATH, "Use @Path annotations for basePath"));
cliOptions.add(CliOption.newBoolean(GENERATE_NON_SPRING_APPLICATION, "Generate non-Spring application"));
cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response"));
}
@@ -127,6 +132,14 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
if (additionalProperties.containsKey(ADD_CONSUMES_PRODUCES_JSON)) {
this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON));
}
if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) {
this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE));
}
if (useGenericResponse) {
writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse);
}
if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) {
this.setGenerateSpringApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION));
@@ -306,5 +319,9 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
public void setGenerateNonSpringApplication(boolean generateNonSpringApplication) {
this.generateNonSpringApplication = generateNonSpringApplication;
}
public void setUseGenericResponse(boolean useGenericResponse) {
this.useGenericResponse = useGenericResponse;
}
}

View File

@@ -0,0 +1,9 @@
package io.swagger.codegen.languages.features;
public interface UseGenericResponseFeatures {
// Language supports generating generic Jaxrs or native return types
public static final String USE_GENERIC_RESPONSE = "useGenericResponse";
public void setUseGenericResponse(boolean useGenericResponse);
}

View File

@@ -31,7 +31,7 @@ public class {{classname}}ServiceImpl implements {{classname}} {
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
// TODO: Implement...
{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}
{{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}}
}
{{/operation}}

View File

@@ -26,12 +26,16 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
}
@Override
{{#jackson}}
@JsonValue
{{/jackson}}
public String toString() {
return String.valueOf(value);
}
{{#jackson}}
@JsonCreator
{{/jackson}}
public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {
for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
if (String.valueOf(b.value).equals(text)) {
@@ -40,4 +44,5 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
}
return null;
}
}

View File

@@ -1 +1,4 @@
{{#returnContainer}}{{#isMapContainer}}Map<String, {{{returnType}}}>{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}
{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response:
}}{{^useGenericResponse}}{{!
}}{{#returnContainer}}{{#isMapContainer}}Map<String, {{{returnType}}}>{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{!
}}{{/useGenericResponse}}

View File

@@ -4,6 +4,7 @@ import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.languages.JavaCXFClientCodegen;
import io.swagger.codegen.options.JavaCXFClientOptionsProvider;
import io.swagger.codegen.options.JavaCXFServerOptionsProvider;
import io.swagger.codegen.options.OptionsProvider;
import mockit.Expectations;
import mockit.Tested;
@@ -59,6 +60,9 @@ public class JaxrsCXFClientOptionsTest extends AbstractOptionsTest {
clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_BEANVALIDATION));
times = 1;
clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE));
times = 1;
clientCodegen.setUseLoggingFeatureForTests(
Boolean.valueOf(JavaCXFClientOptionsProvider.USE_LOGGING_FEATURE_FOR_TESTS));
times = 1;

View File

@@ -80,6 +80,8 @@ public class JaxrsCXFServerOptionsTest extends AbstractOptionsTest {
clientCodegen.setUseBeanValidationFeature(
Boolean.valueOf(JavaCXFServerOptionsProvider.USE_BEANVALIDATION_FEATURE));
times = 1;
clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFServerOptionsProvider.USE_GENERIC_RESPONSE));
times = 1;
clientCodegen.setGenerateSpringBootApplication(
Boolean.valueOf(JavaCXFServerOptionsProvider.GENERATE_SPRING_BOOT_APPLICATION));

View File

@@ -16,6 +16,8 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider {
public static final String USE_LOGGING_FEATURE_FOR_TESTS = "true";
public static final String USE_GENERIC_RESPONSE = "true";
@Override
public boolean isServer() {
@@ -36,6 +38,7 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider {
.putAll(parentOptions);
builder.put(JavaCXFClientCodegen.USE_BEANVALIDATION, JavaCXFClientOptionsProvider.USE_BEANVALIDATION);
builder.put(JavaCXFClientCodegen.USE_GENERIC_RESPONSE, JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE);
builder.put(JavaCXFClientCodegen.USE_JAXB_ANNOTATIONS, USE_JAXB_ANNOTATIONS);
builder.put(JavaCXFClientCodegen.USE_GZIP_FEATURE_FOR_TESTS, USE_GZIP_FEATURE_FOR_TESTS);

View File

@@ -31,6 +31,8 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider {
public static final String USE_BEANVALIDATION_FEATURE = "true";
public static final String USE_GENERIC_RESPONSE = "true";
public static final String USE_SPRING_ANNOTATION_CONFIG = "true";
public static final String GENERATE_SPRING_BOOT_APPLICATION = "true";
@@ -82,6 +84,7 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider {
builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE, USE_LOGGING_FEATURE);
builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE_FOR_TESTS, USE_LOGGING_FEATURE_FOR_TESTS);
builder.put(JavaCXFServerCodegen.USE_BEANVALIDATION_FEATURE, USE_BEANVALIDATION_FEATURE);
builder.put(JavaCXFServerCodegen.USE_GENERIC_RESPONSE, USE_GENERIC_RESPONSE);
builder.put(JavaCXFServerCodegen.GENERATE_SPRING_BOOT_APPLICATION, GENERATE_SPRING_BOOT_APPLICATION);

View File

@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,45 @@
package io.swagger.api;
import java.math.BigDecimal;
import io.swagger.model.Client;
import org.joda.time.LocalDate;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
@Path("/")
@Api(value = "/", description = "")
public interface FakeApi {
@PATCH
@Path("/fake")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "To test \"client\" model", tags={ })
public Client testClientModel(Client body);
@POST
@Path("/fake")
@Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" })
@Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" })
@ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ })
public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "_double") Double _double, @Multipart(value = "patternWithoutDelimiter") String patternWithoutDelimiter, @Multipart(value = "_byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "_float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) javax.xml.datatype.XMLGregorianCalendar dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "paramCallback", required = false) String paramCallback);
@GET
@Path("/fake")
@Consumes({ "*/*" })
@Produces({ "*/*" })
@ApiOperation(value = "To test enum parameters", tags={ })
public void testEnumParameters(@Multipart(value = "enumFormStringArray", required = false) List<String> enumFormStringArray, @Multipart(value = "enumFormString", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List<String> enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array")List<String> enumQueryStringArray, @QueryParam("enum_query_string")String enumQueryString, @QueryParam("enum_query_integer")Integer enumQueryInteger, @Multipart(value = "enumQueryDouble", required = false) Double enumQueryDouble);
}

View File

@@ -1,8 +1,8 @@
package io.swagger.api;
import io.swagger.model.Pet;
import io.swagger.model.ModelApiResponse;
import java.io.File;
import io.swagger.model.ModelApiResponse;
import io.swagger.model.Pet;
import java.io.InputStream;
import java.io.OutputStream;
@@ -15,11 +15,10 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
@Path("/")
@Api(value = "/", description = "")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface PetApi {
@POST
@@ -27,52 +26,51 @@ public interface PetApi {
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Add a new pet to the store", tags={ })
public void addPet(Pet body);
public void addPet(Pet body);
@DELETE
@Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Deletes a pet", tags={ })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
@GET
@Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by status", tags={ })
public List<Pet> findPetsByStatus(@QueryParam("status")List<String> status);
public List<List<Pet>> findPetsByStatus(@QueryParam("status")List<String> status);
@GET
@Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Finds Pets by tags", tags={ })
public List<Pet> findPetsByTags(@QueryParam("tags")List<String> tags);
public List<List<Pet>> findPetsByTags(@QueryParam("tags")List<String> tags);
@GET
@Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Find pet by ID", tags={ })
public Pet getPetById(@PathParam("petId") Long petId);
public Pet getPetById(@PathParam("petId") Long petId);
@PUT
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update an existing pet", tags={ })
public void updatePet(Pet body);
public void updatePet(Pet body);
@POST
@Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Updates a pet in the store with form data", tags={ })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
@POST
@Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" })
@Produces({ "application/json" })
@ApiOperation(value = "uploads an image", tags={ })
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream,
@Multipart(value = "file" , required = false) Attachment fileDetail);
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
}

View File

@@ -13,35 +13,34 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
@Path("/")
@Api(value = "/", description = "")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface StoreApi {
@DELETE
@Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Delete purchase order by ID", tags={ })
public void deleteOrder(@PathParam("orderId") String orderId);
public void deleteOrder(@PathParam("orderId") String orderId);
@GET
@Path("/store/inventory")
@Produces({ "application/json" })
@ApiOperation(value = "Returns pet inventories by status", tags={ })
public Map<String, Integer> getInventory();
public Map<String, Map<String, Integer>> getInventory();
@GET
@Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Find purchase order by ID", tags={ })
public Order getOrderById(@PathParam("orderId") Long orderId);
public Order getOrderById(@PathParam("orderId") Long orderId);
@POST
@Path("/store/order")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Place an order for a pet", tags={ })
public Order placeOrder(Order body);
public Order placeOrder(Order body);
}

View File

@@ -13,59 +13,58 @@ import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.jaxrs.PATCH;
@Path("/")
@Api(value = "/", description = "")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface UserApi {
@POST
@Path("/user")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Create user", tags={ })
public void createUser(User body);
public void createUser(User body);
@POST
@Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Creates list of users with given input array", tags={ })
public void createUsersWithArrayInput(List<User> body);
public void createUsersWithArrayInput(List<User> body);
@POST
@Path("/user/createWithList")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Creates list of users with given input array", tags={ })
public void createUsersWithListInput(List<User> body);
public void createUsersWithListInput(List<User> body);
@DELETE
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Delete user", tags={ })
public void deleteUser(@PathParam("username") String username);
public void deleteUser(@PathParam("username") String username);
@GET
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get user by user name", tags={ })
public User getUserByName(@PathParam("username") String username);
public User getUserByName(@PathParam("username") String username);
@GET
@Path("/user/login")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Logs user into the system", tags={ })
public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password);
public String loginUser(@QueryParam("username")String username, @QueryParam("password")String password);
@GET
@Path("/user/logout")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Logs out current logged in user session", tags={ })
public void logoutUser();
public void logoutUser();
@PUT
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Updated user", tags={ })
public void updateUser(@PathParam("username") String username, User body);
public void updateUser(@PathParam("username") String username, User body);
}

View File

@@ -0,0 +1,90 @@
package io.swagger.model;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class AdditionalPropertiesClass {
@ApiModelProperty(example = "null", value = "")
private Map<String, String> mapProperty = new HashMap<String, String>();
@ApiModelProperty(example = "null", value = "")
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
/**
* Get mapProperty
* @return mapProperty
**/
public Map<String, String> getMapProperty() {
return mapProperty;
}
public void setMapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
}
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
this.mapProperty = mapProperty;
return this;
}
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
this.mapProperty.put(key, mapPropertyItem);
return this;
}
/**
* Get mapOfMapProperty
* @return mapOfMapProperty
**/
public Map<String, Map<String, String>> getMapOfMapProperty() {
return mapOfMapProperty;
}
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
}
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
return this;
}
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,77 @@
package io.swagger.model;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class Animal {
@ApiModelProperty(example = "null", required = true, value = "")
private String className = null;
@ApiModelProperty(example = "null", value = "")
private String color = "red";
/**
* Get className
* @return className
**/
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Animal className(String className) {
this.className = className;
return this;
}
/**
* Get color
* @return color
**/
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Animal color(String color) {
this.color = color;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,40 @@
package io.swagger.model;
import io.swagger.model.Animal;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class AnimalFarm extends ArrayList<Animal> {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,65 @@
package io.swagger.model;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class ArrayOfArrayOfNumberOnly {
@ApiModelProperty(example = "null", value = "")
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
/**
* Get arrayArrayNumber
* @return arrayArrayNumber
**/
public List<List<BigDecimal>> getArrayArrayNumber() {
return arrayArrayNumber;
}
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
}
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
return this;
}
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
this.arrayArrayNumber.add(arrayArrayNumberItem);
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,65 @@
package io.swagger.model;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class ArrayOfNumberOnly {
@ApiModelProperty(example = "null", value = "")
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
/**
* Get arrayNumber
* @return arrayNumber
**/
public List<BigDecimal> getArrayNumber() {
return arrayNumber;
}
public void setArrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
}
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;
return this;
}
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
this.arrayNumber.add(arrayNumberItem);
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,115 @@
package io.swagger.model;
import io.swagger.model.ReadOnlyFirst;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class ArrayTest {
@ApiModelProperty(example = "null", value = "")
private List<String> arrayOfString = new ArrayList<String>();
@ApiModelProperty(example = "null", value = "")
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
@ApiModelProperty(example = "null", value = "")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
/**
* Get arrayOfString
* @return arrayOfString
**/
public List<String> getArrayOfString() {
return arrayOfString;
}
public void setArrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
}
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;
return this;
}
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
this.arrayOfString.add(arrayOfStringItem);
return this;
}
/**
* Get arrayArrayOfInteger
* @return arrayArrayOfInteger
**/
public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return this;
}
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
return this;
}
/**
* Get arrayArrayOfModel
* @return arrayArrayOfModel
**/
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
}
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return this;
}
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,157 @@
package io.swagger.model;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class Capitalization {
@ApiModelProperty(example = "null", value = "")
private String smallCamel = null;
@ApiModelProperty(example = "null", value = "")
private String capitalCamel = null;
@ApiModelProperty(example = "null", value = "")
private String smallSnake = null;
@ApiModelProperty(example = "null", value = "")
private String capitalSnake = null;
@ApiModelProperty(example = "null", value = "")
private String scAETHFlowPoints = null;
@ApiModelProperty(example = "null", value = "Name of the pet ")
private String ATT_NAME = null;
/**
* Get smallCamel
* @return smallCamel
**/
public String getSmallCamel() {
return smallCamel;
}
public void setSmallCamel(String smallCamel) {
this.smallCamel = smallCamel;
}
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;
return this;
}
/**
* Get capitalCamel
* @return capitalCamel
**/
public String getCapitalCamel() {
return capitalCamel;
}
public void setCapitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
return this;
}
/**
* Get smallSnake
* @return smallSnake
**/
public String getSmallSnake() {
return smallSnake;
}
public void setSmallSnake(String smallSnake) {
this.smallSnake = smallSnake;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
return this;
}
/**
* Get capitalSnake
* @return capitalSnake
**/
public String getCapitalSnake() {
return capitalSnake;
}
public void setCapitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
return this;
}
/**
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
public void setScAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
return this;
}
/**
* Name of the pet
* @return ATT_NAME
**/
public String getATTNAME() {
return ATT_NAME;
}
public void setATTNAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,58 @@
package io.swagger.model;
import io.swagger.model.Animal;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class Cat extends Animal {
@ApiModelProperty(example = "null", value = "")
private Boolean declawed = null;
/**
* Get declawed
* @return declawed
**/
public Boolean getDeclawed() {
return declawed;
}
public void setDeclawed(Boolean declawed) {
this.declawed = declawed;
}
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,6 +1,5 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
@@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="A category for a pet")
public class Category {
@ApiModelProperty(example = "null", value = "")
@@ -26,9 +24,16 @@ public class Category {
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Category id(Long id) {
this.id = id;
return this;
}
/**
* Get name
* @return name
@@ -36,10 +41,17 @@ public class Category {
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Category name(String name) {
this.name = name;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -0,0 +1,59 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing model with \"_class\" property")
public class ClassModel {
@ApiModelProperty(example = "null", value = "")
private String propertyClass = null;
/**
* Get propertyClass
* @return propertyClass
**/
public String getPropertyClass() {
return propertyClass;
}
public void setPropertyClass(String propertyClass) {
this.propertyClass = propertyClass;
}
public ClassModel propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,57 @@
package io.swagger.model;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class Client {
@ApiModelProperty(example = "null", value = "")
private String client = null;
/**
* Get client
* @return client
**/
public String getClient() {
return client;
}
public void setClient(String client) {
this.client = client;
}
public Client client(String client) {
this.client = client;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,58 @@
package io.swagger.model;
import io.swagger.model.Animal;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class Dog extends Animal {
@ApiModelProperty(example = "null", value = "")
private String breed = null;
/**
* Get breed
* @return breed
**/
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
public Dog breed(String breed) {
this.breed = breed;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,150 @@
package io.swagger.model;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class EnumArrays {
@XmlType(name="JustSymbolEnum")
@XmlEnum(String.class)
public enum JustSymbolEnum {
@XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), @XmlEnumValue("$") DOLLAR(String.valueOf("$"));
private String value;
JustSymbolEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static JustSymbolEnum fromValue(String v) {
for (JustSymbolEnum b : JustSymbolEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
return null;
}
}
@ApiModelProperty(example = "null", value = "")
private JustSymbolEnum justSymbol = null;
@XmlType(name="ArrayEnumEnum")
@XmlEnum(String.class)
public enum ArrayEnumEnum {
@XmlEnumValue("fish") FISH(String.valueOf("fish")), @XmlEnumValue("crab") CRAB(String.valueOf("crab"));
private String value;
ArrayEnumEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ArrayEnumEnum fromValue(String v) {
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
return null;
}
}
@ApiModelProperty(example = "null", value = "")
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
/**
* Get justSymbol
* @return justSymbol
**/
public JustSymbolEnum getJustSymbol() {
return justSymbol;
}
public void setJustSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
}
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;
return this;
}
/**
* Get arrayEnum
* @return arrayEnum
**/
public List<ArrayEnumEnum> getArrayEnum() {
return arrayEnum;
}
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
}
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;
return this;
}
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
this.arrayEnum.add(arrayEnumItem);
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,37 @@
package io.swagger.model;
/**
* Gets or Sets EnumClass
*/
public enum EnumClass {
_ABC("_abc"),
_EFG("-efg"),
_XYZ_("(xyz)");
private String value;
EnumClass(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EnumClass fromValue(String text) {
for (EnumClass b : EnumClass.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}

View File

@@ -0,0 +1,217 @@
package io.swagger.model;
import io.swagger.model.OuterEnum;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class EnumTest {
@XmlType(name="EnumStringEnum")
@XmlEnum(String.class)
public enum EnumStringEnum {
@XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")), @XmlEnumValue("") EMPTY(String.valueOf(""));
private String value;
EnumStringEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EnumStringEnum fromValue(String v) {
for (EnumStringEnum b : EnumStringEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
return null;
}
}
@ApiModelProperty(example = "null", value = "")
private EnumStringEnum enumString = null;
@XmlType(name="EnumIntegerEnum")
@XmlEnum(Integer.class)
public enum EnumIntegerEnum {
@XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1));
private Integer value;
EnumIntegerEnum (Integer v) {
value = v;
}
public Integer value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EnumIntegerEnum fromValue(String v) {
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
return null;
}
}
@ApiModelProperty(example = "null", value = "")
private EnumIntegerEnum enumInteger = null;
@XmlType(name="EnumNumberEnum")
@XmlEnum(Double.class)
public enum EnumNumberEnum {
@XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));
private Double value;
EnumNumberEnum (Double v) {
value = v;
}
public Double value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EnumNumberEnum fromValue(String v) {
for (EnumNumberEnum b : EnumNumberEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
return null;
}
}
@ApiModelProperty(example = "null", value = "")
private EnumNumberEnum enumNumber = null;
@ApiModelProperty(example = "null", value = "")
private OuterEnum outerEnum = null;
/**
* Get enumString
* @return enumString
**/
public EnumStringEnum getEnumString() {
return enumString;
}
public void setEnumString(EnumStringEnum enumString) {
this.enumString = enumString;
}
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
}
/**
* Get enumInteger
* @return enumInteger
**/
public EnumIntegerEnum getEnumInteger() {
return enumInteger;
}
public void setEnumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
}
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return this;
}
/**
* Get enumNumber
* @return enumNumber
**/
public EnumNumberEnum getEnumNumber() {
return enumNumber;
}
public void setEnumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
}
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
return this;
}
/**
* Get outerEnum
* @return outerEnum
**/
public OuterEnum getOuterEnum() {
return outerEnum;
}
public void setOuterEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
}
public EnumTest outerEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EnumTest {\n");
sb.append(" enumString: ").append(toIndentedString(enumString)).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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,310 @@
package io.swagger.model;
import java.math.BigDecimal;
import java.util.UUID;
import org.joda.time.LocalDate;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class FormatTest {
@ApiModelProperty(example = "null", value = "")
private Integer integer = null;
@ApiModelProperty(example = "null", value = "")
private Integer int32 = null;
@ApiModelProperty(example = "null", value = "")
private Long int64 = null;
@ApiModelProperty(example = "null", required = true, value = "")
private BigDecimal number = null;
@ApiModelProperty(example = "null", value = "")
private Float _float = null;
@ApiModelProperty(example = "null", value = "")
private Double _double = null;
@ApiModelProperty(example = "null", value = "")
private String string = null;
@ApiModelProperty(example = "null", required = true, value = "")
private byte[] _byte = null;
@ApiModelProperty(example = "null", value = "")
private byte[] binary = null;
@ApiModelProperty(example = "null", required = true, value = "")
private LocalDate date = null;
@ApiModelProperty(example = "null", value = "")
private javax.xml.datatype.XMLGregorianCalendar dateTime = null;
@ApiModelProperty(example = "null", value = "")
private UUID uuid = null;
@ApiModelProperty(example = "null", required = true, value = "")
private String password = null;
/**
* Get integer
* minimum: 10
* maximum: 100
* @return integer
**/
public Integer getInteger() {
return integer;
}
public void setInteger(Integer integer) {
this.integer = integer;
}
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
}
/**
* Get int32
* minimum: 20
* maximum: 200
* @return int32
**/
public Integer getInt32() {
return int32;
}
public void setInt32(Integer int32) {
this.int32 = int32;
}
public FormatTest int32(Integer int32) {
this.int32 = int32;
return this;
}
/**
* Get int64
* @return int64
**/
public Long getInt64() {
return int64;
}
public void setInt64(Long int64) {
this.int64 = int64;
}
public FormatTest int64(Long int64) {
this.int64 = int64;
return this;
}
/**
* Get number
* minimum: 32.1
* maximum: 543.2
* @return number
**/
public BigDecimal getNumber() {
return number;
}
public void setNumber(BigDecimal number) {
this.number = number;
}
public FormatTest number(BigDecimal number) {
this.number = number;
return this;
}
/**
* Get _float
* minimum: 54.3
* maximum: 987.6
* @return _float
**/
public Float getFloat() {
return _float;
}
public void setFloat(Float _float) {
this._float = _float;
}
public FormatTest _float(Float _float) {
this._float = _float;
return this;
}
/**
* Get _double
* minimum: 67.8
* maximum: 123.4
* @return _double
**/
public Double getDouble() {
return _double;
}
public void setDouble(Double _double) {
this._double = _double;
}
public FormatTest _double(Double _double) {
this._double = _double;
return this;
}
/**
* Get string
* @return string
**/
public String getString() {
return string;
}
public void setString(String string) {
this.string = string;
}
public FormatTest string(String string) {
this.string = string;
return this;
}
/**
* Get _byte
* @return _byte
**/
public byte[] getByte() {
return _byte;
}
public void setByte(byte[] _byte) {
this._byte = _byte;
}
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
/**
* Get binary
* @return binary
**/
public byte[] getBinary() {
return binary;
}
public void setBinary(byte[] binary) {
this.binary = binary;
}
public FormatTest binary(byte[] binary) {
this.binary = binary;
return this;
}
/**
* Get date
* @return date
**/
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public FormatTest date(LocalDate date) {
this.date = date;
return this;
}
/**
* Get dateTime
* @return dateTime
**/
public javax.xml.datatype.XMLGregorianCalendar getDateTime() {
return dateTime;
}
public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
this.dateTime = dateTime;
}
public FormatTest dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
this.dateTime = dateTime;
return this;
}
/**
* Get uuid
* @return uuid
**/
public UUID getUuid() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
public FormatTest uuid(UUID uuid) {
this.uuid = uuid;
return this;
}
/**
* Get password
* @return password
**/
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public FormatTest password(String password) {
this.password = password;
return this;
}
@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("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,61 @@
package io.swagger.model;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class HasOnlyReadOnly {
@ApiModelProperty(example = "null", value = "")
private String bar = null;
@ApiModelProperty(example = "null", value = "")
private String foo = null;
/**
* Get bar
* @return bar
**/
public String getBar() {
return bar;
}
/**
* Get foo
* @return foo
**/
public String getFoo() {
return 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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,123 @@
package io.swagger.model;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class MapTest {
@ApiModelProperty(example = "null", value = "")
private Map<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();
@XmlType(name="InnerEnum")
@XmlEnum(String.class)
public enum InnerEnum {
@XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower"));
private String value;
InnerEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static InnerEnum fromValue(String v) {
for (InnerEnum b : InnerEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
return null;
}
}
@ApiModelProperty(example = "null", value = "")
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
/**
* Get mapMapOfString
* @return mapMapOfString
**/
public Map<String, Map<String, String>> getMapMapOfString() {
return mapMapOfString;
}
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
}
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
}
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
/**
* Get mapOfEnumString
* @return mapOfEnumString
**/
public Map<String, InnerEnum> getMapOfEnumString() {
return mapOfEnumString;
}
public void setMapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
return this;
}
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
@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("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,107 @@
package io.swagger.model;
import io.swagger.model.Animal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class MixedPropertiesAndAdditionalPropertiesClass {
@ApiModelProperty(example = "null", value = "")
private UUID uuid = null;
@ApiModelProperty(example = "null", value = "")
private javax.xml.datatype.XMLGregorianCalendar dateTime = null;
@ApiModelProperty(example = "null", value = "")
private Map<String, Animal> map = new HashMap<String, Animal>();
/**
* Get uuid
* @return uuid
**/
public UUID getUuid() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
this.uuid = uuid;
return this;
}
/**
* Get dateTime
* @return dateTime
**/
public javax.xml.datatype.XMLGregorianCalendar getDateTime() {
return dateTime;
}
public void setDateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
this.dateTime = dateTime;
}
public MixedPropertiesAndAdditionalPropertiesClass dateTime(javax.xml.datatype.XMLGregorianCalendar dateTime) {
this.dateTime = dateTime;
return this;
}
/**
* Get map
* @return map
**/
public Map<String, Animal> getMap() {
return map;
}
public void setMap(Map<String, Animal> map) {
this.map = map;
}
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
this.map = map;
return this;
}
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
this.map.put(key, mapItem);
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,79 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing model name starting with number")
public class Model200Response {
@ApiModelProperty(example = "null", value = "")
private Integer name = null;
@ApiModelProperty(example = "null", value = "")
private String propertyClass = null;
/**
* Get name
* @return name
**/
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
public Model200Response name(Integer name) {
this.name = name;
return this;
}
/**
* Get propertyClass
* @return propertyClass
**/
public String getPropertyClass() {
return propertyClass;
}
public void setPropertyClass(String propertyClass) {
this.propertyClass = propertyClass;
}
public Model200Response propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,6 +1,5 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
@@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Describes the result of uploading an image resource")
public class ModelApiResponse {
@ApiModelProperty(example = "null", value = "")
@@ -28,9 +26,16 @@ public class ModelApiResponse {
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
/**
* Get type
* @return type
@@ -38,9 +43,16 @@ public class ModelApiResponse {
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
/**
* Get message
* @return message
@@ -48,10 +60,17 @@ public class ModelApiResponse {
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -0,0 +1,59 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing reserved words")
public class ModelReturn {
@ApiModelProperty(example = "null", value = "")
private Integer _return = null;
/**
* Get _return
* @return _return
**/
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,103 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="Model for testing model name same as property name")
public class Name {
@ApiModelProperty(example = "null", required = true, value = "")
private Integer name = null;
@ApiModelProperty(example = "null", value = "")
private Integer snakeCase = null;
@ApiModelProperty(example = "null", value = "")
private String property = null;
@ApiModelProperty(example = "null", value = "")
private Integer _123Number = null;
/**
* Get name
* @return name
**/
public Integer getName() {
return name;
}
public void setName(Integer name) {
this.name = name;
}
public Name name(Integer name) {
this.name = name;
return this;
}
/**
* Get snakeCase
* @return snakeCase
**/
public Integer getSnakeCase() {
return snakeCase;
}
/**
* Get property
* @return property
**/
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
public Name property(String property) {
this.property = property;
return this;
}
/**
* Get _123Number
* @return _123Number
**/
public Integer get123Number() {
return _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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,58 @@
package io.swagger.model;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class NumberOnly {
@ApiModelProperty(example = "null", value = "")
private BigDecimal justNumber = null;
/**
* Get justNumber
* @return justNumber
**/
public BigDecimal getJustNumber() {
return justNumber;
}
public void setJustNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
}
public NumberOnly justNumber(BigDecimal justNumber) {
this.justNumber = justNumber;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,6 +1,5 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
@@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="An order for a pets from the pet store")
public class Order {
@ApiModelProperty(example = "null", value = "")
@@ -27,7 +25,7 @@ public class Order {
@XmlEnum(String.class)
public enum StatusEnum {
@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered"));
@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered"));
private String value;
@@ -67,9 +65,16 @@ public enum StatusEnum {
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Order id(Long id) {
this.id = id;
return this;
}
/**
* Get petId
* @return petId
@@ -77,9 +82,16 @@ public enum StatusEnum {
public Long getPetId() {
return petId;
}
public void setPetId(Long petId) {
this.petId = petId;
}
public Order petId(Long petId) {
this.petId = petId;
return this;
}
/**
* Get quantity
* @return quantity
@@ -87,9 +99,16 @@ public enum StatusEnum {
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/**
* Get shipDate
* @return shipDate
@@ -97,9 +116,16 @@ public enum StatusEnum {
public javax.xml.datatype.XMLGregorianCalendar getShipDate() {
return shipDate;
}
public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
this.shipDate = shipDate;
}
public Order shipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
this.shipDate = shipDate;
return this;
}
/**
* Order Status
* @return status
@@ -107,9 +133,16 @@ public enum StatusEnum {
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public Order status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get complete
* @return complete
@@ -117,10 +150,17 @@ public enum StatusEnum {
public Boolean getComplete() {
return complete;
}
public void setComplete(Boolean complete) {
this.complete = complete;
}
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -0,0 +1,37 @@
package io.swagger.model;
/**
* Gets or Sets OuterEnum
*/
public enum OuterEnum {
PLACED("placed"),
APPROVED("approved"),
DELIVERED("delivered");
private String value;
OuterEnum(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static OuterEnum fromValue(String text) {
for (OuterEnum b : OuterEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}

View File

@@ -1,6 +1,5 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.model.Category;
import io.swagger.model.Tag;
import java.util.ArrayList;
@@ -15,7 +14,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="A pet for sale in the pet store")
public class Pet {
@ApiModelProperty(example = "null", value = "")
@@ -33,7 +31,7 @@ public class Pet {
@XmlEnum(String.class)
public enum StatusEnum {
@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold"));
@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold"));
private String value;
@@ -71,9 +69,16 @@ public enum StatusEnum {
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Pet id(Long id) {
this.id = id;
return this;
}
/**
* Get category
* @return category
@@ -81,9 +86,16 @@ public enum StatusEnum {
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public Pet category(Category category) {
this.category = category;
return this;
}
/**
* Get name
* @return name
@@ -91,9 +103,16 @@ public enum StatusEnum {
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Pet name(String name) {
this.name = name;
return this;
}
/**
* Get photoUrls
* @return photoUrls
@@ -101,9 +120,21 @@ public enum StatusEnum {
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
return this;
}
/**
* Get tags
* @return tags
@@ -111,9 +142,21 @@ public enum StatusEnum {
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
public Pet addTagsItem(Tag tagsItem) {
this.tags.add(tagsItem);
return this;
}
/**
* pet status in the store
* @return status
@@ -121,10 +164,17 @@ public enum StatusEnum {
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -0,0 +1,69 @@
package io.swagger.model;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class ReadOnlyFirst {
@ApiModelProperty(example = "null", value = "")
private String bar = null;
@ApiModelProperty(example = "null", value = "")
private String baz = null;
/**
* Get bar
* @return bar
**/
public String getBar() {
return bar;
}
/**
* Get baz
* @return baz
**/
public String getBaz() {
return baz;
}
public void setBaz(String baz) {
this.baz = baz;
}
public ReadOnlyFirst baz(String baz) {
this.baz = baz;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,57 @@
package io.swagger.model;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
public class SpecialModelName {
@ApiModelProperty(example = "null", value = "")
private Long specialPropertyName = null;
/**
* Get specialPropertyName
* @return specialPropertyName
**/
public Long getSpecialPropertyName() {
return specialPropertyName;
}
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
}
public SpecialModelName specialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
return this;
}
@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 static String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,6 +1,5 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
@@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="A tag for a pet")
public class Tag {
@ApiModelProperty(example = "null", value = "")
@@ -26,9 +24,16 @@ public class Tag {
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Tag id(Long id) {
this.id = id;
return this;
}
/**
* Get name
* @return name
@@ -36,10 +41,17 @@ public class Tag {
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Tag name(String name) {
this.name = name;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -1,6 +1,5 @@
package io.swagger.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
@@ -11,7 +10,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
@ApiModel(description="A User who is purchasing from the pet store")
public class User {
@ApiModelProperty(example = "null", value = "")
@@ -38,9 +36,16 @@ public class User {
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User id(Long id) {
this.id = id;
return this;
}
/**
* Get username
* @return username
@@ -48,9 +53,16 @@ public class User {
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public User username(String username) {
this.username = username;
return this;
}
/**
* Get firstName
* @return firstName
@@ -58,9 +70,16 @@ public class User {
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get lastName
* @return lastName
@@ -68,9 +87,16 @@ public class User {
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get email
* @return email
@@ -78,9 +104,16 @@ public class User {
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public User email(String email) {
this.email = email;
return this;
}
/**
* Get password
* @return password
@@ -88,9 +121,16 @@ public class User {
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public User password(String password) {
this.password = password;
return this;
}
/**
* Get phone
* @return phone
@@ -98,9 +138,16 @@ public class User {
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public User phone(String phone) {
this.phone = phone;
return this;
}
/**
* User Status
* @return userStatus
@@ -108,10 +155,17 @@ public class User {
public Integer getUserStatus() {
return userStatus;
}
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@@ -0,0 +1,146 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.swagger.api;
import java.math.BigDecimal;
import io.swagger.model.Client;
import org.joda.time.LocalDate;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.ClientConfiguration;
import org.apache.cxf.jaxrs.client.WebClient;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for FakeApi
*/
public class FakeApiTest {
private FakeApi api;
@Before
public void setup() {
JacksonJsonProvider provider = new JacksonJsonProvider();
List providers = new ArrayList();
providers.add(provider);
api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", FakeApi.class, providers);
org.apache.cxf.jaxrs.client.Client client = WebClient.client(api);
ClientConfiguration config = WebClient.getConfig(client);
}
/**
* To test \&quot;client\&quot; model
*
* To test \&quot;client\&quot; model
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testClientModelTest() {
Client body = null;
//Client response = api.testClientModel(body);
//assertNotNull(response);
// TODO: test validations
}
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testEndpointParametersTest() {
BigDecimal number = null;
Double _double = null;
String patternWithoutDelimiter = null;
byte[] _byte = null;
Integer integer = null;
Integer int32 = null;
Long int64 = null;
Float _float = null;
String string = null;
byte[] binary = null;
LocalDate date = null;
javax.xml.datatype.XMLGregorianCalendar dateTime = null;
String password = null;
String paramCallback = null;
//api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
// TODO: test validations
}
/**
* To test enum parameters
*
* To test enum parameters
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testEnumParametersTest() {
List<String> enumFormStringArray = null;
String enumFormString = null;
List<String> enumHeaderStringArray = null;
String enumHeaderString = null;
List<String> enumQueryStringArray = null;
String enumQueryString = null;
Integer enumQueryInteger = null;
Double enumQueryDouble = null;
//api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
// TODO: test validations
}
}

View File

@@ -1,6 +1,6 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
@@ -25,9 +25,9 @@
package io.swagger.api;
import io.swagger.model.Pet;
import io.swagger.model.ModelApiResponse;
import java.io.File;
import io.swagger.model.ModelApiResponse;
import io.swagger.model.Pet;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
@@ -80,9 +80,11 @@ public class PetApiTest {
@Test
public void addPetTest() {
Pet body = null;
// response = api.addPet(body);
//assertNotNull(response);
//api.addPet(body);
// TODO: test validations
}
/**
@@ -97,9 +99,11 @@ public class PetApiTest {
public void deletePetTest() {
Long petId = null;
String apiKey = null;
// response = api.deletePet(petId, apiKey);
//assertNotNull(response);
//api.deletePet(petId, apiKey);
// TODO: test validations
}
/**
@@ -113,9 +117,11 @@ public class PetApiTest {
@Test
public void findPetsByStatusTest() {
List<String> status = null;
//List<Pet> response = api.findPetsByStatus(status);
//List<List<Pet>> response = api.findPetsByStatus(status);
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -129,9 +135,11 @@ public class PetApiTest {
@Test
public void findPetsByTagsTest() {
List<String> tags = null;
//List<Pet> response = api.findPetsByTags(tags);
//List<List<Pet>> response = api.findPetsByTags(tags);
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -145,9 +153,11 @@ public class PetApiTest {
@Test
public void getPetByIdTest() {
Long petId = null;
//Pet response = api.getPetById(petId);
//Pet response = api.getPetById(petId);
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -161,9 +171,11 @@ public class PetApiTest {
@Test
public void updatePetTest() {
Pet body = null;
// response = api.updatePet(body);
//assertNotNull(response);
//api.updatePet(body);
// TODO: test validations
}
/**
@@ -179,9 +191,11 @@ public class PetApiTest {
Long petId = null;
String name = null;
String status = null;
// response = api.updatePetWithForm(petId, name, status);
//assertNotNull(response);
//api.updatePetWithForm(petId, name, status);
// TODO: test validations
}
/**
@@ -196,10 +210,12 @@ public class PetApiTest {
public void uploadFileTest() {
Long petId = null;
String additionalMetadata = null;
File file = null;
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
org.apache.cxf.jaxrs.ext.multipart.Attachment file = null;
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//assertNotNull(response);
// TODO: test validations
}
}

View File

@@ -1,6 +1,6 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
@@ -78,9 +78,11 @@ public class StoreApiTest {
@Test
public void deleteOrderTest() {
String orderId = null;
// response = api.deleteOrder(orderId);
//assertNotNull(response);
//api.deleteOrder(orderId);
// TODO: test validations
}
/**
@@ -93,9 +95,11 @@ public class StoreApiTest {
*/
@Test
public void getInventoryTest() {
//Map<String, Integer> response = api.getInventory();
//Map<String, Map<String, Integer>> response = api.getInventory();
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -109,9 +113,11 @@ public class StoreApiTest {
@Test
public void getOrderByIdTest() {
Long orderId = null;
//Order response = api.getOrderById(orderId);
//Order response = api.getOrderById(orderId);
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -125,9 +131,11 @@ public class StoreApiTest {
@Test
public void placeOrderTest() {
Order body = null;
//Order response = api.placeOrder(body);
//Order response = api.placeOrder(body);
//assertNotNull(response);
// TODO: test validations
}
}

View File

@@ -1,6 +1,6 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
@@ -78,9 +78,11 @@ public class UserApiTest {
@Test
public void createUserTest() {
User body = null;
// response = api.createUser(body);
//assertNotNull(response);
//api.createUser(body);
// TODO: test validations
}
/**
@@ -94,9 +96,11 @@ public class UserApiTest {
@Test
public void createUsersWithArrayInputTest() {
List<User> body = null;
// response = api.createUsersWithArrayInput(body);
//assertNotNull(response);
//api.createUsersWithArrayInput(body);
// TODO: test validations
}
/**
@@ -110,9 +114,11 @@ public class UserApiTest {
@Test
public void createUsersWithListInputTest() {
List<User> body = null;
// response = api.createUsersWithListInput(body);
//assertNotNull(response);
//api.createUsersWithListInput(body);
// TODO: test validations
}
/**
@@ -126,9 +132,11 @@ public class UserApiTest {
@Test
public void deleteUserTest() {
String username = null;
// response = api.deleteUser(username);
//assertNotNull(response);
//api.deleteUser(username);
// TODO: test validations
}
/**
@@ -142,9 +150,11 @@ public class UserApiTest {
@Test
public void getUserByNameTest() {
String username = null;
//User response = api.getUserByName(username);
//User response = api.getUserByName(username);
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -159,9 +169,11 @@ public class UserApiTest {
public void loginUserTest() {
String username = null;
String password = null;
//String response = api.loginUser(username, password);
//String response = api.loginUser(username, password);
//assertNotNull(response);
// TODO: test validations
}
/**
@@ -174,9 +186,11 @@ public class UserApiTest {
*/
@Test
public void logoutUserTest() {
// response = api.logoutUser();
//assertNotNull(response);
//api.logoutUser();
// TODO: test validations
}
/**
@@ -191,9 +205,11 @@ public class UserApiTest {
public void updateUserTest() {
String username = null;
User body = null;
// response = api.updateUser(username, body);
//assertNotNull(response);
//api.updateUser(username, body);
// TODO: test validations
}
}

View File

@@ -21,3 +21,5 @@
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
**/impl/*

View File

@@ -37,5 +37,6 @@ public enum EnumClass {
}
return null;
}
}

View File

@@ -37,5 +37,6 @@ public enum OuterEnum {
}
return null;
}
}

View File

@@ -80,7 +80,7 @@ public class PetApiTest {
@Test
public void addPetTest() {
Pet body = null;
//api.addPet(body);
//api.addPet(body);
// TODO: test validations
@@ -99,7 +99,7 @@ public class PetApiTest {
public void deletePetTest() {
Long petId = null;
String apiKey = null;
//api.deletePet(petId, apiKey);
//api.deletePet(petId, apiKey);
// TODO: test validations
@@ -153,7 +153,7 @@ public class PetApiTest {
@Test
public void getPetByIdTest() {
Long petId = null;
//Pet response = api.getPetById(petId);
//Pet response = api.getPetById(petId);
//assertNotNull(response);
// TODO: test validations
@@ -171,7 +171,7 @@ public class PetApiTest {
@Test
public void updatePetTest() {
Pet body = null;
//api.updatePet(body);
//api.updatePet(body);
// TODO: test validations
@@ -191,7 +191,7 @@ public class PetApiTest {
Long petId = null;
String name = null;
String status = null;
//api.updatePetWithForm(petId, name, status);
//api.updatePetWithForm(petId, name, status);
// TODO: test validations
@@ -211,7 +211,7 @@ public class PetApiTest {
Long petId = null;
String additionalMetadata = null;
org.apache.cxf.jaxrs.ext.multipart.Attachment file = null;
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
//assertNotNull(response);
// TODO: test validations

View File

@@ -79,7 +79,7 @@ public class StoreApiTest {
@Test
public void deleteOrderTest() {
String orderId = null;
//api.deleteOrder(orderId);
//api.deleteOrder(orderId);
// TODO: test validations
@@ -114,7 +114,7 @@ public class StoreApiTest {
@Test
public void getOrderByIdTest() {
Long orderId = null;
//Order response = api.getOrderById(orderId);
//Order response = api.getOrderById(orderId);
//assertNotNull(response);
// TODO: test validations
@@ -132,7 +132,7 @@ public class StoreApiTest {
@Test
public void placeOrderTest() {
Order body = null;
//Order response = api.placeOrder(body);
//Order response = api.placeOrder(body);
//assertNotNull(response);
// TODO: test validations

View File

@@ -79,7 +79,7 @@ public class UserApiTest {
@Test
public void createUserTest() {
User body = null;
//api.createUser(body);
//api.createUser(body);
// TODO: test validations
@@ -97,7 +97,7 @@ public class UserApiTest {
@Test
public void createUsersWithArrayInputTest() {
List<User> body = null;
//api.createUsersWithArrayInput(body);
//api.createUsersWithArrayInput(body);
// TODO: test validations
@@ -115,7 +115,7 @@ public class UserApiTest {
@Test
public void createUsersWithListInputTest() {
List<User> body = null;
//api.createUsersWithListInput(body);
//api.createUsersWithListInput(body);
// TODO: test validations
@@ -133,7 +133,7 @@ public class UserApiTest {
@Test
public void deleteUserTest() {
String username = null;
//api.deleteUser(username);
//api.deleteUser(username);
// TODO: test validations
@@ -151,7 +151,7 @@ public class UserApiTest {
@Test
public void getUserByNameTest() {
String username = null;
//User response = api.getUserByName(username);
//User response = api.getUserByName(username);
//assertNotNull(response);
// TODO: test validations
@@ -170,7 +170,7 @@ public class UserApiTest {
public void loginUserTest() {
String username = null;
String password = null;
//String response = api.loginUser(username, password);
//String response = api.loginUser(username, password);
//assertNotNull(response);
// TODO: test validations
@@ -187,7 +187,7 @@ public class UserApiTest {
*/
@Test
public void logoutUserTest() {
//api.logoutUser();
//api.logoutUser();
// TODO: test validations
@@ -206,7 +206,7 @@ public class UserApiTest {
public void updateUserTest() {
String username = null;
User body = null;
//api.updateUser(username, body);
//api.updateUser(username, body);
// TODO: test validations