diff --git a/README.md b/README.md index 7253eea064a4..26c247a2ec07 100644 --- a/README.md +++ b/README.md @@ -792,6 +792,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) +- [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [Rapid7](https://rapid7.com/) - [Reload! A/S](https://reload.dk/) @@ -913,6 +914,15 @@ Here are the requirements to become a core team member: To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. +## License information on Generated Code + +The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: + +* The templates included with this project are subject to the [License](#license). +* Generated code is intentionally _not_ subject to the parent project license + +When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. + License ------- diff --git a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java index aca8bbf673c8..1755e67750f9 100644 --- a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java +++ b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java @@ -310,7 +310,10 @@ public class CodeGenMojo extends AbstractMojo { } if (addCompileSourceRoot) { - String sourceJavaFolder = output.toString() + "/" + configOptions.get(CodegenConstants.SOURCE_FOLDER); + final Object sourceFolderObject = configOptions.get(CodegenConstants.SOURCE_FOLDER); + final String sourceFolder = sourceFolderObject == null ? "src/main/java" : sourceFolderObject.toString(); + + String sourceJavaFolder = output.toString() + "/" + sourceFolder; project.addCompileSourceRoot(sourceJavaFolder); } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 23bfb825bea1..63cad401d023 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1892,7 +1892,11 @@ public class DefaultCodegen { for (String key : consumes) { Map mediaType = new HashMap(); // escape quotation to avoid code injection - mediaType.put("mediaType", escapeText(escapeQuotationMark(key))); + if ("*/*".equals(key)) { // "*/*" is a special case, do nothing + mediaType.put("mediaType", key); + } else { + mediaType.put("mediaType", escapeText(escapeQuotationMark(key))); + } count += 1; if (count < consumes.size()) { mediaType.put("hasMore", "true"); @@ -1926,7 +1930,11 @@ public class DefaultCodegen { for (String key : produces) { Map mediaType = new HashMap(); // escape quotation to avoid code injection - mediaType.put("mediaType", escapeText(escapeQuotationMark(key))); + if ("*/*".equals(key)) { // "*/*" is a special case, do nothing + mediaType.put("mediaType", key); + } else { + mediaType.put("mediaType", escapeText(escapeQuotationMark(key))); + } count += 1; if (count < produces.size()) { mediaType.put("hasMore", "true"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index fd893f5d52f5..a2e7f597c433 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -141,7 +141,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { config.additionalProperties().put("generatedDate", DateTime.now().toString()); config.additionalProperties().put("generatorClass", config.getClass().toString()); config.additionalProperties().put("inputSpec", config.getInputSpec()); - + if (swagger.getInfo() != null) { Info info = swagger.getInfo(); if (info.getTitle() != null) { @@ -405,6 +405,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { operation.put("classname", config.toApiName(tag)); operation.put("classVarName", config.toApiVarName(tag)); operation.put("importPath", config.toApiImport(tag)); + operation.put("classFilename", config.toApiFilename(tag)); if(!config.vendorExtensions().isEmpty()) { operation.put("vendorExtensions", config.vendorExtensions()); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 7871f33da838..380c87b3b8ff 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -291,7 +291,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code typeMapping.put("DateTime", "OffsetDateTime"); importMapping.put("OffsetDateTime", "java.time.OffsetDateTime"); } - } else { + } else if (dateLibrary.equals("legacy")) { additionalProperties.put("legacyDates", "true"); } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java index de0812c40f81..af961e9983be 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -139,8 +139,11 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen } } } + 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); } else if ( operation.returnType.startsWith("List") ) { String rt = operation.returnType; int end = rt.lastIndexOf(">"); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNet5ServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNet5ServerCodegen.java index d22e18f2cd02..83bbfbb6adb0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNet5ServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNet5ServerCodegen.java @@ -10,6 +10,8 @@ public class AspNet5ServerCodegen extends AspNetCoreServerCodegen { public AspNet5ServerCodegen() { super(); + + embeddedTemplateDir = templateDir = "aspnetcore"; } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index 29df7970b484..691fd206b723 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -136,8 +136,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValida } if ("feign".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("FormAwareEncoder.mustache", invokerFolder, "FormAwareEncoder.java")); additionalProperties.put("jackson", "true"); + supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); } else if ("okhttp-gson".equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache index df0c5d4153e4..06c138c16cc3 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -24,6 +24,7 @@ import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import feign.Feign; import feign.RequestInterceptor; +import feign.form.FormEncoder; import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; import feign.slf4j.Slf4jLogger; @@ -43,7 +44,7 @@ public class ApiClient { objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); feignBuilder = Feign.builder() - .encoder(new FormAwareEncoder(new JacksonEncoder(objectMapper))) + .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) .decoder(new JacksonDecoder(objectMapper)) .logger(new Slf4jLogger()); } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/FormAwareEncoder.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/FormAwareEncoder.mustache deleted file mode 100644 index baf29b5f4dec..000000000000 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/FormAwareEncoder.mustache +++ /dev/null @@ -1,192 +0,0 @@ -package {{invokerPackage}}; - -import java.io.*; -import java.lang.reflect.Type; -import java.net.URLEncoder; -import java.net.URLConnection; -import java.nio.charset.Charset; -import java.util.*; - -import java.text.DateFormat; - -import feign.codec.EncodeException; -import feign.codec.Encoder; -import feign.RequestTemplate; - -{{>generatedAnnotation}} -public class FormAwareEncoder implements Encoder { - public static final String UTF_8 = "utf-8"; - private static final String LINE_FEED = "\r\n"; - private static final String TWO_DASH = "--"; - private static final String BOUNDARY = "----------------314159265358979323846"; - - private byte[] lineFeedBytes; - private byte[] boundaryBytes; - private byte[] twoDashBytes; - private byte[] atBytes; - private byte[] eqBytes; - - private final Encoder delegate; - private final DateFormat dateFormat; - - public FormAwareEncoder(Encoder delegate) { - this.delegate = delegate; - this.dateFormat = new RFC3339DateFormat();; - - try { - this.lineFeedBytes = LINE_FEED.getBytes(UTF_8); - this.boundaryBytes = BOUNDARY.getBytes(UTF_8); - this.twoDashBytes = TWO_DASH.getBytes(UTF_8); - this.atBytes = "&".getBytes(UTF_8); - this.eqBytes = "=".getBytes(UTF_8); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - - public void encode(Object object, Type bodyType, RequestTemplate template) throws EncodeException { - if (object instanceof Map) { - try { - encodeFormParams(template, (Map) object); - } catch (IOException e) { - throw new EncodeException("Failed to create request", e); - } - } else { - delegate.encode(object, bodyType, template); - } - } - - private void encodeFormParams(RequestTemplate template, Map formParams) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - - boolean isMultiPart = isMultiPart(formParams); - boolean isFirstField = true; - for (Map.Entry param : formParams.entrySet()) { - String keyStr = param.getKey(); - if (param.getValue() instanceof File) { - addFilePart(baos, keyStr, (File) param.getValue()); - } else { - String valueStr = parameterToString(param.getValue()); - if (isMultiPart) { - addMultiPartFormField(baos, keyStr, valueStr); - } else { - addEncodedFormField(baos, keyStr, valueStr, isFirstField); - isFirstField = false; - } - } - } - - if (isMultiPart) { - baos.write(lineFeedBytes); - baos.write(twoDashBytes); - baos.write(boundaryBytes); - baos.write(twoDashBytes); - baos.write(lineFeedBytes); - } - - String contentType = isMultiPart ? "multipart/form-data; boundary=" + BOUNDARY : "application/x-www-form-urlencoded"; - template.header("Content-type"); - template.header("Content-type", contentType); - template.header("MIME-Version", "1.0"); - template.body(baos.toByteArray(), Charset.forName(UTF_8)); - } - - /* - * Currently only supports text files - */ - private void addFilePart(ByteArrayOutputStream baos, String fieldName, File uploadFile) throws IOException { - String fileName = uploadFile.getName(); - baos.write(twoDashBytes); - baos.write(boundaryBytes); - baos.write(lineFeedBytes); - - String contentDisposition = "Content-Disposition: form-data; name=\"" + fieldName - + "\"; filename=\"" + fileName + "\""; - baos.write(contentDisposition.getBytes(UTF_8)); - baos.write(lineFeedBytes); - String contentType = "Content-Type: " + URLConnection.guessContentTypeFromName(fileName); - baos.write(contentType.getBytes(UTF_8)); - baos.write(lineFeedBytes); - baos.write(lineFeedBytes); - - BufferedReader reader = new BufferedReader(new FileReader(uploadFile)); - InputStream input = new FileInputStream(uploadFile); - byte[] bytes = new byte[4096]; - int len = bytes.length; - while ((len = input.read(bytes)) != -1) { - baos.write(bytes, 0, len); - baos.write(lineFeedBytes); - } - - baos.write(lineFeedBytes); - } - - private void addEncodedFormField(ByteArrayOutputStream baos, String name, String value, boolean isFirstField) throws IOException { - if (!isFirstField) { - baos.write(atBytes); - } - - String encodedName = URLEncoder.encode(name, UTF_8); - String encodedValue = URLEncoder.encode(value, UTF_8); - baos.write(encodedName.getBytes(UTF_8)); - baos.write("=".getBytes(UTF_8)); - baos.write(encodedValue.getBytes(UTF_8)); - } - - private void addMultiPartFormField(ByteArrayOutputStream baos, String name, String value) throws IOException { - baos.write(twoDashBytes); - baos.write(boundaryBytes); - baos.write(lineFeedBytes); - - String contentDisposition = "Content-Disposition: form-data; name=\"" + name + "\""; - String contentType = "Content-Type: text/plain; charset=utf-8"; - - baos.write(contentDisposition.getBytes(UTF_8)); - baos.write(lineFeedBytes); - baos.write(contentType.getBytes(UTF_8)); - baos.write(lineFeedBytes); - baos.write(lineFeedBytes); - baos.write(value.getBytes(UTF_8)); - baos.write(lineFeedBytes); - } - - private boolean isMultiPart(Map formParams) { - boolean isMultiPart = false; - for (Map.Entry entry : formParams.entrySet()) { - if (entry.getValue() instanceof File) { - isMultiPart = true; - break; - } - } - return isMultiPart; - } - - /** - * Format the given parameter object into string. - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Format the given Date object into string. - */ - public String formatDate(Date date) { - return dateFormat.format(date); - } -} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ParamExpander.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ParamExpander.mustache new file mode 100644 index 000000000000..2f5095d00f03 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ParamExpander.mustache @@ -0,0 +1,22 @@ +package {{invokerPackage}}; + +import feign.Param; + +import java.text.DateFormat; +import java.util.Date; + +/** + * Param Expander to convert {@link Date} to RFC3339 + */ +public class ParamExpander implements Param.Expander { + + private static final DateFormat dateformat = new RFC3339DateFormat(); + + @Override + public String expand(Object value) { + if (value instanceof Date) { + return dateformat.format(value); + } + return value.toString(); + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache index 6cb2deaccbc0..a72dac0496df 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/api.mustache @@ -1,6 +1,9 @@ package {{package}}; import {{invokerPackage}}.ApiClient; +{{#legacyDates}} +import {{invokerPackage}}.ParamExpander; +{{/legacyDates}} {{#imports}}import {{import}}; {{/imports}} @@ -25,12 +28,12 @@ public interface {{classname}} extends ApiClient.Api { */ @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}") @Headers({ - "Content-type: {{vendorExtensions.x-contentType}}", + "Content-Type: {{vendorExtensions.x-contentType}}", "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}}, {{/hasMore}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}@Param("{{paramName}}") {{/isBodyParam}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} {{/operations}} } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache index 3991f5f2d96a..66551591f58f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -97,6 +97,7 @@ ext { swagger_annotations_version = "1.5.9" jackson_version = "{{^threetenbp}}2.7.5{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" feign_version = "8.17.0" + feign_form_version = "2.0.2" junit_version = "4.12" oltu_version = "1.0.1" } @@ -106,6 +107,7 @@ dependencies { compile "com.netflix.feign:feign-core:$feign_version" compile "com.netflix.feign:feign-jackson:$feign_version" compile "com.netflix.feign:feign-slf4j:$feign_version" + compile "io.github.openfeign.form:feign-form:$feign_form_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache index c46bd4003437..d0270a99b59d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -13,18 +13,11 @@ lazy val root = (project in file(".")). "com.netflix.feign" % "feign-core" % "8.16.0" % "compile", "com.netflix.feign" % "feign-jackson" % "8.17.0" % "compile", "com.netflix.feign" % "feign-slf4j" % "8.16.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "{{^threetenbp}}2.7.5{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "{{^threetenbp}}2.7.5{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "{{^threetenbp}}2.7.5{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", - {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5" % "compile", - {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.7.5" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", - {{/threetenbp}} + "io.github.openfeign.form" % "feign-form" % "2.0.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.7.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.7.5" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "junit" % "junit" % "4.12" % "test", diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index 9685d3c30341..3a978a4af835 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache @@ -1,189 +1,195 @@ - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - +xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +4.0.0 +{{groupId}} +{{artifactId}} +jar +{{artifactId}} +{{artifactVersion}} + +scm:git:git@github.com:swagger-api/swagger-mustache.git +scm:git:git@github.com:swagger-api/swagger-codegen.git +https://github.com/swagger-api/swagger-codegen + + +2.2.0 + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest + ${project.build.directory}/lib - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + src/main/java + - + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + com.netflix.feign + feign-core + ${feign-version} + + + com.netflix.feign + feign-jackson + ${feign-version} + + + com.netflix.feign + feign-slf4j + ${feign-version} + + + io.github.openfeign.form + feign-form + ${feign-form-version} + - - - com.netflix.feign - feign-core - ${feign-version} - - - com.netflix.feign - feign-jackson - ${feign-version} - - - com.netflix.feign - feign-slf4j - ${feign-version} - + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + +{{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + +{{/joda}} +{{#java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + +{{/java8}} +{{#threetenbp}} + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + +{{/threetenbp}} + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - {{/joda}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - {{/threetenbp}} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - - - junit - junit - ${junit-version} - test - - - - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} - ${java.version} - ${java.version} - 1.5.9 - 8.17.0 - {{^threetenbp}}2.7.5{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} + + + junit + junit + ${junit-version} + test + + + +{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} +${java.version} +${java.version} +1.5.9 +8.17.0 + 2.0.2 + 2.7.5 4.12 1.0.0 1.0.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index 4e706ed7d4c7..408c6dbe645e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -63,12 +63,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/maximum}} * @return {{name}} **/ - {{#vendorExtensions.extraAnnotation}} - {{{vendorExtensions.extraAnnotation}}} - {{/vendorExtensions.extraAnnotation}} {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.extraAnnotation}} - {{vendorExtensions.extraAnnotation}} + {{{vendorExtensions.extraAnnotation}}} {{/vendorExtensions.extraAnnotation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache index 9b55d4c7551a..c0199a9b5ca1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -25,7 +25,7 @@ public class {{classname}}ServiceImpl implements {{classname}} { public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { // TODO: Implement... - {{#returnType}}return null;{{/returnType}} + {{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}} } {{/operation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache index 94212231156e..10bb9d0f4e06 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache @@ -1,9 +1,9 @@ @XmlType(name="{{datatypeWithEnum}}") -@XmlEnum +@XmlEnum({{datatype}}.class) public enum {{datatypeWithEnum}} { {{#allowableValues}} - {{#enumVars}}{{name}}({{datatype}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{#enumVars}}@XmlEnumValue({{{value}}}) {{name}}({{datatype}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/allowableValues}} @@ -17,7 +17,17 @@ public enum {{datatypeWithEnum}} { return value; } + @Override + public String toString() { + return String.valueOf(value); + } + public static {{datatypeWithEnum}} fromValue(String v) { - return valueOf(v); + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 382b8372daad..9f00536089c1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -5,6 +5,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) {{#hasVars}} @XmlType(name = "{{classname}}", propOrder = diff --git a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache index 9ad7e3d3a90d..39d346399167 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_enum_class.mustache @@ -20,5 +20,14 @@ {{/allowableValues}} }; + /** + * Returns a {{classname}} enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The enum {{classname}} value. + */ + exports.constructFromObject = function(object) { + return exports[object]; + } + return exports; })); diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/api.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/api.mustache index f90d25641870..8a04d1cad7e2 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/api.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/api.mustache @@ -15,8 +15,8 @@ import {{package}}.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/apiService.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/apiService.mustache index edaa0f9becb5..ca5e8d349685 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/apiService.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/apiService.mustache @@ -3,7 +3,8 @@ package {{package}}; import {{package}}.*; import {{modelPackage}}.*; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; {{#imports}}import {{import}}; {{/imports}} diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/apiServiceImpl.mustache index af1b56fc69c5..7b66d35361b4 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/apiServiceImpl.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/apiServiceImpl.mustache @@ -11,7 +11,8 @@ import {{package}}.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache index 9a7ff6ea6cf3..249266065db5 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/formParams.mustache @@ -1,3 +1,3 @@ {{#isFormParam}}{{#notFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{paramName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/notFile}}{{#isFile}} @FormDataParam("{{paramName}}") InputStream {{paramName}}InputStream, - @FormDataParam("{{paramName}}") FormDataContentDisposition {{paramName}}Detail{{/isFile}}{{/isFormParam}} + @FormDataParam("{{paramName}}") FileInfo {{paramName}}Detail{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache index ff9764e8e95f..7839f9c1ec24 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache @@ -66,16 +66,6 @@ jackson-datatype-joda 2.4.1 - - org.glassfish.jersey.containers - jersey-container-servlet-core - ${jersey2-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey2-version} - diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/serviceFormParams.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/serviceFormParams.mustache index dc2d2eb1ecf2..c58393551dfc 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/serviceFormParams.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/serviceFormParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}InputStream {{paramName}}InputStream, FormDataContentDisposition {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}{{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}InputStream {{paramName}}InputStream, FileInfo {{paramName}}Detail{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/dart/apilib.mustache b/modules/swagger-codegen/src/main/resources/dart/apilib.mustache index f608cf214e01..07b02ef61051 100644 --- a/modules/swagger-codegen/src/main/resources/dart/apilib.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/apilib.mustache @@ -16,7 +16,7 @@ part 'auth/api_key_auth.dart'; part 'auth/oauth.dart'; part 'auth/http_basic_auth.dart'; -{{#apiInfo}}{{#apis}}part 'api/{{classVarName}}_api.dart'; +{{#apiInfo}}{{#apis}}part 'api/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} {{#models}}{{#model}}part 'model/{{classFilename}}.dart'; {{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache index 2a37076d7183..47fe9ce48414 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-header.mustache @@ -32,7 +32,49 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey; /** - * Updates header parameters and query parameters for authentication + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +/** + * Gets the next request id + * + * @return The next executed request id. + */ ++(NSNumber*) nextRequestId; + +/** + * Generates request id and add it to the queue + * + * @return The next executed request id. + */ ++(NSNumber*) queueRequest; + +/** + * Removes request id from the queue + * + * @param requestId The request which will be removed. + */ ++(void) cancelRequest:(NSNumber*)requestId; + +/** + * Customizes the behavior when the reachability changed * * @param headers The header parameter will be udpated, passed by pointer to pointer. * @param querys The query parameters will be updated, passed by pointer to pointer. diff --git a/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache index 0227b0fb2b44..fc1f88f38653 100644 --- a/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache @@ -95,7 +95,7 @@ /** * Sets the prefix for API key * - * @param apiKeyPrefix API key prefix. + * @param prefix API key prefix. * @param identifier API key identifier. */ - (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; @@ -135,7 +135,7 @@ /** * Removes header from defaultHeaders * -* @param Header name. +* @param key Header name. */ -(void) removeDefaultHeaderForKey:(NSString*)key; @@ -148,7 +148,7 @@ -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; /** -* @param Header key name. +* @param key Header key name. */ -(NSString*) defaultHeaderForKey:(NSString*)key; diff --git a/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache b/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache index 90aa174d7c43..774fe1ee5af5 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ResponseDeserializer-header.mustache @@ -28,7 +28,7 @@ extern NSInteger const {{classPrefix}}UnknownResponseObjectErrorCode; * Deserializes the given data to Objective-C object. * * @param data The data will be deserialized. - * @param class The type of objective-c object. + * @param className The type of objective-c object. * @param error The error */ - (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; diff --git a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache index 5ca9303e5a8d..8307a28d54a2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache @@ -43,7 +43,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ {{#vars}}@"{{baseName}}": @"{{name}}"{{#hasMore}}, {{/hasMore}}{{/vars}} }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ {{#vars}}@"{{name}}": @"{{baseName}}"{{#hasMore}}, {{/hasMore}}{{/vars}} }]; } /** diff --git a/modules/swagger-codegen/src/main/resources/objc/podspec.mustache b/modules/swagger-codegen/src/main/resources/objc/podspec.mustache index 88c4ab0613f8..693afa7e5296 100644 --- a/modules/swagger-codegen/src/main/resources/objc/podspec.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/podspec.mustache @@ -31,7 +31,7 @@ Pod::Spec.new do |s| {{#useCoreData}} s.resources = '{{podName}}/**/*.{xcdatamodeld,xcdatamodel}'{{/useCoreData}} s.dependency 'AFNetworking', '~> 3' - s.dependency 'JSONModel', '~> 1.2' + s.dependency 'JSONModel', '~> 1.4' s.dependency 'ISO8601', '~> 0.6' end diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 0a5864a81af9..dc4fe509f623 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -462,7 +462,7 @@ class ApiClient(object): content_types = list(map(lambda x: x.lower(), content_types)) - if 'application/json' in content_types: + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: return content_types[0] diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache index fcd4b3eebfa8..7fa611e37449 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache @@ -125,10 +125,11 @@ module {{moduleName}} # application/json # application/json; charset=UTF8 # APPLICATION/JSON + # */* # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? end # Deserialize the response to the given return type. diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index ea5714fd72f7..8e7eb9a69852 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -613,9 +613,9 @@ paths: descriptions: To test enum parameters operationId: testEnumParameters consumes: - - application/json + - "*/*" produces: - - application/json + - "*/*" parameters: - name: enum_form_string_array type: array diff --git a/pom.xml b/pom.xml index b5310be90901..daabde4fc626 100644 --- a/pom.xml +++ b/pom.xml @@ -463,6 +463,18 @@ samples/server/petstore/java-msf4/ + + jaxrs-cxf-server + + + env + java + + + + samples/server/petstore/jaxrs-cxf + + jaxrs-resteasy-server diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 94a8475d06a2..989223768cbd 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -97,6 +97,7 @@ ext { swagger_annotations_version = "1.5.9" jackson_version = "2.6.4" feign_version = "8.17.0" + feign_form_version = "2.0.2" junit_version = "4.12" oltu_version = "1.0.1" } @@ -106,6 +107,10 @@ dependencies { compile "com.netflix.feign:feign-core:$feign_version" compile "com.netflix.feign:feign-jackson:$feign_version" compile "com.netflix.feign:feign-slf4j:$feign_version" + compile "io.github.openfeign.form:feign-form:$feign_form_version" + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version", compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 581d58d7c133..dd67e3e7298e 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -13,7 +13,11 @@ lazy val root = (project in file(".")). "com.netflix.feign" % "feign-core" % "8.16.0" % "compile", "com.netflix.feign" % "feign-jackson" % "8.17.0" % "compile", "com.netflix.feign" % "feign-slf4j" % "8.16.0" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", + "io.github.openfeign.form" % "feign-form" % "2.0.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.7.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "junit" % "junit" % "4.12" % "test", diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index e99364253c69..be5255b16ce9 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -1,158 +1,179 @@ - 4.0.0 +xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +4.0.0 +io.swagger +swagger-petstore-feign +jar +swagger-petstore-feign +1.0.0 + +scm:git:git@github.com:swagger-api/swagger-mustache.git +scm:git:git@github.com:swagger-api/swagger-codegen.git +https://github.com/swagger-api/swagger-codegen + + +2.2.0 + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + + + io.swagger - swagger-petstore-feign - jar - swagger-petstore-feign - 1.0.0 - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + swagger-annotations + ${swagger-core-version} + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + com.netflix.feign + feign-core + ${feign-version} + + + com.netflix.feign + feign-jackson + ${feign-version} + + + com.netflix.feign + feign-slf4j + ${feign-version} + + + io.github.openfeign.form + feign-form + ${feign-form-version} + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - - com.netflix.feign - feign-core - ${feign-version} - - - com.netflix.feign - feign-jackson - ${feign-version} - - - com.netflix.feign - feign-slf4j - ${feign-version} - - - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - - - junit - junit - ${junit-version} - test - - - - 1.7 - ${java.version} - ${java.version} - 1.5.9 - 8.17.0 - 2.6.4 + + + junit + junit + ${junit-version} + test + + + +1.7 +${java.version} +${java.version} +1.5.9 +8.17.0 + 2.0.2 + 2.7.5 4.12 1.0.0 1.0.1 diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java index 83a718e2d1b5..71c53530f48f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java @@ -5,9 +5,7 @@ import java.util.Map; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZonedDateTime; +import org.threeten.bp.*; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -16,6 +14,7 @@ import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import feign.Feign; import feign.RequestInterceptor; +import feign.form.FormEncoder; import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; import feign.slf4j.Slf4jLogger; @@ -35,7 +34,7 @@ public class ApiClient { objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); feignBuilder = Feign.builder() - .encoder(new FormAwareEncoder(new JacksonEncoder(objectMapper))) + .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) .decoder(new JacksonDecoder(objectMapper)) .logger(new Slf4jLogger()); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java deleted file mode 100644 index 85e7fad4d725..000000000000 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java +++ /dev/null @@ -1,192 +0,0 @@ -package io.swagger.client; - -import java.io.*; -import java.lang.reflect.Type; -import java.net.URLEncoder; -import java.net.URLConnection; -import java.nio.charset.Charset; -import java.util.*; - -import java.text.DateFormat; - -import feign.codec.EncodeException; -import feign.codec.Encoder; -import feign.RequestTemplate; - - -public class FormAwareEncoder implements Encoder { - public static final String UTF_8 = "utf-8"; - private static final String LINE_FEED = "\r\n"; - private static final String TWO_DASH = "--"; - private static final String BOUNDARY = "----------------314159265358979323846"; - - private byte[] lineFeedBytes; - private byte[] boundaryBytes; - private byte[] twoDashBytes; - private byte[] atBytes; - private byte[] eqBytes; - - private final Encoder delegate; - private final DateFormat dateFormat; - - public FormAwareEncoder(Encoder delegate) { - this.delegate = delegate; - this.dateFormat = new RFC3339DateFormat();; - - try { - this.lineFeedBytes = LINE_FEED.getBytes(UTF_8); - this.boundaryBytes = BOUNDARY.getBytes(UTF_8); - this.twoDashBytes = TWO_DASH.getBytes(UTF_8); - this.atBytes = "&".getBytes(UTF_8); - this.eqBytes = "=".getBytes(UTF_8); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - - public void encode(Object object, Type bodyType, RequestTemplate template) throws EncodeException { - if (object instanceof Map) { - try { - encodeFormParams(template, (Map) object); - } catch (IOException e) { - throw new EncodeException("Failed to create request", e); - } - } else { - delegate.encode(object, bodyType, template); - } - } - - private void encodeFormParams(RequestTemplate template, Map formParams) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - - boolean isMultiPart = isMultiPart(formParams); - boolean isFirstField = true; - for (Map.Entry param : formParams.entrySet()) { - String keyStr = param.getKey(); - if (param.getValue() instanceof File) { - addFilePart(baos, keyStr, (File) param.getValue()); - } else { - String valueStr = parameterToString(param.getValue()); - if (isMultiPart) { - addMultiPartFormField(baos, keyStr, valueStr); - } else { - addEncodedFormField(baos, keyStr, valueStr, isFirstField); - isFirstField = false; - } - } - } - - if (isMultiPart) { - baos.write(lineFeedBytes); - baos.write(twoDashBytes); - baos.write(boundaryBytes); - baos.write(twoDashBytes); - baos.write(lineFeedBytes); - } - - String contentType = isMultiPart ? "multipart/form-data; boundary=" + BOUNDARY : "application/x-www-form-urlencoded"; - template.header("Content-type"); - template.header("Content-type", contentType); - template.header("MIME-Version", "1.0"); - template.body(baos.toByteArray(), Charset.forName(UTF_8)); - } - - /* - * Currently only supports text files - */ - private void addFilePart(ByteArrayOutputStream baos, String fieldName, File uploadFile) throws IOException { - String fileName = uploadFile.getName(); - baos.write(twoDashBytes); - baos.write(boundaryBytes); - baos.write(lineFeedBytes); - - String contentDisposition = "Content-Disposition: form-data; name=\"" + fieldName - + "\"; filename=\"" + fileName + "\""; - baos.write(contentDisposition.getBytes(UTF_8)); - baos.write(lineFeedBytes); - String contentType = "Content-Type: " + URLConnection.guessContentTypeFromName(fileName); - baos.write(contentType.getBytes(UTF_8)); - baos.write(lineFeedBytes); - baos.write(lineFeedBytes); - - BufferedReader reader = new BufferedReader(new FileReader(uploadFile)); - InputStream input = new FileInputStream(uploadFile); - byte[] bytes = new byte[4096]; - int len = bytes.length; - while ((len = input.read(bytes)) != -1) { - baos.write(bytes, 0, len); - baos.write(lineFeedBytes); - } - - baos.write(lineFeedBytes); - } - - private void addEncodedFormField(ByteArrayOutputStream baos, String name, String value, boolean isFirstField) throws IOException { - if (!isFirstField) { - baos.write(atBytes); - } - - String encodedName = URLEncoder.encode(name, UTF_8); - String encodedValue = URLEncoder.encode(value, UTF_8); - baos.write(encodedName.getBytes(UTF_8)); - baos.write("=".getBytes(UTF_8)); - baos.write(encodedValue.getBytes(UTF_8)); - } - - private void addMultiPartFormField(ByteArrayOutputStream baos, String name, String value) throws IOException { - baos.write(twoDashBytes); - baos.write(boundaryBytes); - baos.write(lineFeedBytes); - - String contentDisposition = "Content-Disposition: form-data; name=\"" + name + "\""; - String contentType = "Content-Type: text/plain; charset=utf-8"; - - baos.write(contentDisposition.getBytes(UTF_8)); - baos.write(lineFeedBytes); - baos.write(contentType.getBytes(UTF_8)); - baos.write(lineFeedBytes); - baos.write(lineFeedBytes); - baos.write(value.getBytes(UTF_8)); - baos.write(lineFeedBytes); - } - - private boolean isMultiPart(Map formParams) { - boolean isMultiPart = false; - for (Map.Entry entry : formParams.entrySet()) { - if (entry.getValue() instanceof File) { - isMultiPart = true; - break; - } - } - return isMultiPart; - } - - /** - * Format the given parameter object into string. - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Format the given Date object into string. - */ - public String formatDate(Date date) { - return dateFormat.format(date); - } -} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ParamExpander.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ParamExpander.java new file mode 100644 index 000000000000..71a6f5866b3a --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ParamExpander.java @@ -0,0 +1,22 @@ +package io.swagger.client; + +import feign.Param; + +import java.text.DateFormat; +import java.util.Date; + +/** + * Param Expander to convert {@link Date} to RFC3339 + */ +public class ParamExpander implements Param.Expander { + + private static final DateFormat dateformat = new RFC3339DateFormat(); + + @Override + public String expand(Object value) { + if (value instanceof Date) { + return dateformat.format(value); + } + return value.toString(); + } +} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java index 5152dd837de5..df24bf298fbc 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -3,8 +3,8 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import io.swagger.client.model.Client; -import org.threeten.bp.OffsetDateTime; import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; import java.math.BigDecimal; import java.util.ArrayList; @@ -25,7 +25,7 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("PATCH /fake") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) Client testClientModel(Client body); @@ -51,7 +51,7 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("POST /fake") @Headers({ - "Content-type: application/xml; charset=utf-8", + "Content-Type: application/xml; charset=utf-8", "Accept: application/xml; charset=utf-8,application/json; charset=utf-8", }) void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("patternWithoutDelimiter") String patternWithoutDelimiter, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("string") String string, @Param("binary") byte[] binary, @Param("date") LocalDate date, @Param("dateTime") OffsetDateTime dateTime, @Param("password") String password, @Param("paramCallback") String paramCallback); @@ -71,8 +71,8 @@ public interface FakeApi extends ApiClient.Api { */ @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}") @Headers({ - "Content-type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", "enum_header_string_array: {enumHeaderStringArray}", "enum_header_string: {enumHeaderString}" diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeclassnametagsApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeclassnametagsApi.java deleted file mode 100644 index 463e619fd27d..000000000000 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeclassnametagsApi.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiClient; - -import io.swagger.client.model.Client; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import feign.*; - - -public interface FakeclassnametagsApi extends ApiClient.Api { - - - /** - * To test class name in snake case - * - * @param body client model (required) - * @return Client - */ - @RequestLine("PATCH /fake_classname_test") - @Headers({ - "Content-type: application/json", - "Accept: application/json", - }) - Client testClassname(Client body); -} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index b6fbdf208dc5..3876f4cded9f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -3,8 +3,8 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; import io.swagger.client.model.Pet; -import io.swagger.client.model.ModelApiResponse; import java.io.File; +import io.swagger.client.model.ModelApiResponse; import java.util.ArrayList; import java.util.HashMap; @@ -24,7 +24,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("POST /pet") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void addPet(Pet body); @@ -38,7 +38,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("DELETE /pet/{petId}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", "api_key: {apiKey}" }) @@ -52,7 +52,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("GET /pet/findByStatus?status={status}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) List findPetsByStatus(@Param("status") List status); @@ -65,7 +65,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) List findPetsByTags(@Param("tags") List tags); @@ -78,7 +78,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("GET /pet/{petId}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) Pet getPetById(@Param("petId") Long petId); @@ -91,7 +91,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("PUT /pet") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void updatePet(Pet body); @@ -106,7 +106,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("POST /pet/{petId}") @Headers({ - "Content-type: application/x-www-form-urlencoded", + "Content-Type: application/x-www-form-urlencoded", "Accept: application/json", }) void updatePetWithForm(@Param("petId") Long petId, @Param("name") String name, @Param("status") String status); @@ -121,7 +121,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("POST /pet/{petId}/uploadImage") @Headers({ - "Content-type: multipart/form-data", + "Content-Type: multipart/form-data", "Accept: application/json", }) ModelApiResponse uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index ee80acba0b42..a0d06d34dd88 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -22,7 +22,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("DELETE /store/order/{orderId}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void deleteOrder(@Param("orderId") String orderId); @@ -34,7 +34,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("GET /store/inventory") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) Map getInventory(); @@ -47,7 +47,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("GET /store/order/{orderId}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) Order getOrderById(@Param("orderId") Long orderId); @@ -60,7 +60,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("POST /store/order") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) Order placeOrder(Order body); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index 6a2c8a6afb16..d4f59bffc4ce 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -22,7 +22,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("POST /user") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void createUser(User body); @@ -35,7 +35,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("POST /user/createWithArray") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void createUsersWithArrayInput(List body); @@ -48,7 +48,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("POST /user/createWithList") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void createUsersWithListInput(List body); @@ -61,7 +61,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("DELETE /user/{username}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void deleteUser(@Param("username") String username); @@ -74,7 +74,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("GET /user/{username}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) User getUserByName(@Param("username") String username); @@ -88,7 +88,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("GET /user/login?username={username}&password={password}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) String loginUser(@Param("username") String username, @Param("password") String password); @@ -100,7 +100,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("GET /user/logout") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void logoutUser(); @@ -114,7 +114,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("PUT /user/{username}") @Headers({ - "Content-type: application/json", + "Content-Type: application/json", "Accept: application/json", }) void updateUser(@Param("username") String username, User body); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index db74fca66a7c..21e4efaeaa26 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -110,6 +110,7 @@ public class AdditionalPropertiesClass { return Objects.hash(mapProperty, mapOfMapProperty); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 6799afd7bebf..993f9bbe6f4c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -97,6 +97,7 @@ public class Animal { return Objects.hash(className, color); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java index 8a50c9c6cb5f..181812be4f42 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -52,6 +52,7 @@ public class AnimalFarm extends ArrayList { return Objects.hash(super.hashCode()); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index e57ce230767d..c02b8e1a37fb 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -83,6 +83,7 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 6dafaf06c62d..fe97b65e1902 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -83,6 +83,7 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java index 8bb3d0c57b7b..a035e8fe2f01 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -137,6 +137,7 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index 949df4491993..b2532f78f852 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -77,6 +77,7 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index b8e278b2a749..84def6a8dacd 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -97,6 +97,7 @@ public class Category { return Objects.hash(id, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java index 024f8cb3b72b..1540bc4d7de5 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java @@ -75,6 +75,7 @@ public class Client { return Objects.hash(client); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 00e981ab4346..d5e9063c9880 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -77,6 +77,7 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index 140473801800..d8be37b302cf 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -164,6 +164,7 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java index 53665518adb3..cf3cab664582 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -209,6 +209,7 @@ public class EnumTest { return Objects.hash(enumString, enumInteger, enumNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index 03c64ce528fe..17d4d2b7c045 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -353,6 +353,7 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1cd90edaae84..9f59c6a47bd4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -79,6 +79,7 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index 60751c48d8c3..335dcb31cbfd 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -140,6 +140,7 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6a0184d17951..201950c21982 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -130,6 +130,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java index 849f208ff7ae..e905b7f9183e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java @@ -98,6 +98,7 @@ public class Model200Response { return Objects.hash(name, propertyClass); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index 79d704bc1bfd..f554939b8986 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -119,6 +119,7 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java index 0d85efb9884d..5332ff4fe2bf 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -76,6 +76,7 @@ public class ModelReturn { return Objects.hash(_return); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java index cc3e7252197e..d26b62921fa9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java @@ -124,6 +124,7 @@ public class Name { return Objects.hash(name, snakeCase, property, _123Number); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java index c7eb42d616cd..3dc6009047f6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java @@ -76,6 +76,7 @@ public class NumberOnly { return Objects.hash(justNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index e84eeb2fce52..bdd2238c13ac 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -218,6 +218,7 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index 06e43f726f34..3ef257006ec6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -231,6 +231,7 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 5c7ed3ec0a6c..0cbe504a297e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -88,6 +88,7 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java index 74695119c3e1..96bbd285945b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -75,6 +75,7 @@ public class SpecialModelName { return Objects.hash(specialPropertyName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index a886efeac4b7..330d2c8faa1e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -97,6 +97,7 @@ public class Tag { return Objects.hash(id, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index f73fff70097f..97fc77b476db 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -229,6 +229,7 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index 941acefddb55..9b9884b5f4bf 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -62,6 +62,15 @@ */ "(xyz)": "(xyz)" }; + /** + * Returns a EnumClass enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/EnumClass} The enum EnumClass value. + */ + exports.constructFromObject = function(object) { + return exports[object]; + } + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index 941acefddb55..9b9884b5f4bf 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -62,6 +62,15 @@ */ "(xyz)": "(xyz)" }; + /** + * Returns a EnumClass enum value from a Javascript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/EnumClass} The enum EnumClass value. + */ + exports.constructFromObject = function(object) { + return exports[object]; + } + return exports; })); diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index c3078b075944..32942f42b029 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -123,6 +123,12 @@ Class | Method | HTTP request | Description ## Documentation For Authorization +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## petstore_auth - **Type**: OAuth @@ -132,12 +138,6 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## Author diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec index fd785a6255c4..f00ff98d4fd7 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient.podspec +++ b/samples/client/petstore/objc/core-data/SwaggerClient.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.resources = 'SwaggerClient/**/*.{xcdatamodeld,xcdatamodel}' s.dependency 'AFNetworking', '~> 3' - s.dependency 'JSONModel', '~> 1.2' + s.dependency 'JSONModel', '~> 1.4' s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index c0ca97c34805..8d1fb7593425 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -352,7 +352,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + NSArray *authSettings = @[@"api_key", @"petstore_auth"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index a2d019aab793..5e32e8a49491 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -54,7 +54,49 @@ extern NSString *const SWGResponseObjectErrorKey; /** - * Updates header parameters and query parameters for authentication + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +/** + * Gets the next request id + * + * @return The next executed request id. + */ ++(NSNumber*) nextRequestId; + +/** + * Generates request id and add it to the queue + * + * @return The next executed request id. + */ ++(NSNumber*) queueRequest; + +/** + * Removes request id from the queue + * + * @param requestId The request which will be removed. + */ ++(void) cancelRequest:(NSNumber*)requestId; + +/** + * Customizes the behavior when the reachability changed * * @param headers The header parameter will be udpated, passed by pointer to pointer. * @param querys The query parameters will be updated, passed by pointer to pointer. diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m index f757e139d0e0..16fabe930893 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m @@ -80,7 +80,6 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { @"application/x-www-form-urlencoded": afhttpRequestSerializer, @"multipart/form-data": afhttpRequestSerializer }; - self.securityPolicy = [self createSecurityPolicy]; self.responseSerializer = [AFHTTPResponseSerializer serializer]; } return self; @@ -352,25 +351,4 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) { *querys = [NSDictionary dictionaryWithDictionary:querysWithAuth]; } -- (AFSecurityPolicy *) createSecurityPolicy { - AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - - id config = self.configuration; - - if (config.sslCaCert) { - NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; - } - - if (config.verifySSL) { - [securityPolicy setAllowInvalidCertificates:NO]; - } - else { - [securityPolicy setAllowInvalidCertificates:YES]; - [securityPolicy setValidatesDomainName:NO]; - } - - return securityPolicy; -} - @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index 864d87d25355..555f6d520358 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -75,18 +75,6 @@ static NSString * const kSWGAPIVersion = @"1.0.0"; */ @property (readonly, nonatomic) BOOL debug; -/** - * SSL/TLS verification - * Set this to NO to skip verifying SSL certificate when calling API from https server - */ -@property (readonly, nonatomic) BOOL verifySSL; - -/** - * SSL/TLS verification - * Set this to customize the certificate file to verify the peer - */ -@property (readonly, nonatomic) NSString *sslCaCert; - /** * Authentication Settings */ diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index 48cedd5d5584..ee4004901316 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -117,7 +117,7 @@ /** * Sets the prefix for API key * - * @param apiKeyPrefix API key prefix. + * @param prefix API key prefix. * @param identifier API key identifier. */ - (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; @@ -157,7 +157,7 @@ /** * Removes header from defaultHeaders * -* @param Header name. +* @param key Header name. */ -(void) removeDefaultHeaderForKey:(NSString*)key; @@ -170,7 +170,7 @@ -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; /** -* @param Header key name. +* @param key Header key name. */ -(NSString*) defaultHeaderForKey:(NSString*)key; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m index 705580e9a544..6c274bce81ac 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -32,7 +32,6 @@ _username = @""; _password = @""; _accessToken= @""; - _verifySSL = YES; _mutableApiKey = [NSMutableDictionary dictionary]; _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; _mutableDefaultHeaders = [NSMutableDictionary dictionary]; @@ -104,13 +103,6 @@ - (NSDictionary *) authSettings { return @{ - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, @"api_key": @{ @"type": @"api_key", @@ -118,6 +110,13 @@ @"key": @"api_key", @"value": [self getApiKeyWithPrefix:@"api_key"] }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, }; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h index c0d7b716a01e..ae1c2b18b902 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h @@ -50,7 +50,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; * Deserializes the given data to Objective-C object. * * @param data The data will be deserialized. - * @param class The type of objective-c object. + * @param className The type of objective-c object. * @param error The error */ - (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m index 00745d1f4990..21e354b30e9e 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; } /** diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m index e0b44e06954b..7f93b0212c48 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; } /** diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m index a1c63520dc44..8c958695c888 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; } /** diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m index e71829873d11..3a62bcbb9a12 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; } /** diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m index c8195660df63..fd50c02e2c9c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; } /** diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 7ee3eb8862d8..2c63354b73d3 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -214,13 +214,15 @@ isa = PBXNativeTarget; buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */; buildPhases = ( + 841AD69C2F0A6609E3057F05 /* 📦 Check Pods Manifest.lock */, 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */, 6003F586195388D20070C39A /* Sources */, 6003F587195388D20070C39A /* Frameworks */, 6003F588195388D20070C39A /* Resources */, 429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */, 183E54C09C54DAEB54B2546F /* [CP] Embed Pods Frameworks */, - FF3F107CF27E0A54D86C49F5 /* Embed Pods Frameworks */, + FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */, + DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -235,13 +237,15 @@ isa = PBXNativeTarget; buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */; buildPhases = ( + E0F523B17966072A199F040E /* 📦 Check Pods Manifest.lock */, 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */, 6003F5AA195388D20070C39A /* Sources */, 6003F5AB195388D20070C39A /* Frameworks */, 6003F5AC195388D20070C39A /* Resources */, E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */, 111D7956304BD6E860AA8709 /* [CP] Embed Pods Frameworks */, - AA7CAD658C61D6EBA222B5F8 /* Embed Pods Frameworks */, + AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */, + E994E0232EFD15F8EE665A4D /* 📦 Copy Pods Resources */, ); buildRules = ( ); @@ -380,14 +384,29 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - AA7CAD658C61D6EBA222B5F8 /* Embed Pods Frameworks */ = { + 841AD69C2F0A6609E3057F05 /* 📦 Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "📦 Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -395,6 +414,36 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E0F523B17966072A199F040E /* 📦 Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -410,14 +459,29 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - FF3F107CF27E0A54D86C49F5 /* Embed Pods Frameworks */ = { + E994E0232EFD15F8EE665A4D /* 📦 Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index 02ad6a83aead..32942f42b029 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -6,7 +6,6 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi - API version: 1.0.0 - Package version: -- Build date: 2016-09-14T16:08:31.542+02:00 - Build package: class io.swagger.codegen.languages.ObjcClientCodegen ## Requirements @@ -124,6 +123,12 @@ Class | Method | HTTP request | Description ## Documentation For Authorization +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## petstore_auth - **Type**: OAuth @@ -133,12 +138,6 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## Author diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec index 32d8e336da7c..aaa4e771f384 100644 --- a/samples/client/petstore/objc/default/SwaggerClient.podspec +++ b/samples/client/petstore/objc/default/SwaggerClient.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.dependency 'AFNetworking', '~> 3' - s.dependency 'JSONModel', '~> 1.2' + s.dependency 'JSONModel', '~> 1.4' s.dependency 'ISO8601', '~> 0.6' end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index c0ca97c34805..8d1fb7593425 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -352,7 +352,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + NSArray *authSettings = @[@"api_key", @"petstore_auth"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index a2d019aab793..5e32e8a49491 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -54,7 +54,49 @@ extern NSString *const SWGResponseObjectErrorKey; /** - * Updates header parameters and query parameters for authentication + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +/** + * Gets the next request id + * + * @return The next executed request id. + */ ++(NSNumber*) nextRequestId; + +/** + * Generates request id and add it to the queue + * + * @return The next executed request id. + */ ++(NSNumber*) queueRequest; + +/** + * Removes request id from the queue + * + * @param requestId The request which will be removed. + */ ++(void) cancelRequest:(NSNumber*)requestId; + +/** + * Customizes the behavior when the reachability changed * * @param headers The header parameter will be udpated, passed by pointer to pointer. * @param querys The query parameters will be updated, passed by pointer to pointer. diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index 48cedd5d5584..ee4004901316 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -117,7 +117,7 @@ /** * Sets the prefix for API key * - * @param apiKeyPrefix API key prefix. + * @param prefix API key prefix. * @param identifier API key identifier. */ - (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; @@ -157,7 +157,7 @@ /** * Removes header from defaultHeaders * -* @param Header name. +* @param key Header name. */ -(void) removeDefaultHeaderForKey:(NSString*)key; @@ -170,7 +170,7 @@ -(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; /** -* @param Header key name. +* @param key Header key name. */ -(NSString*) defaultHeaderForKey:(NSString*)key; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m index b809ac4d6bb7..6c274bce81ac 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -103,13 +103,6 @@ - (NSDictionary *) authSettings { return @{ - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, @"api_key": @{ @"type": @"api_key", @@ -117,6 +110,13 @@ @"key": @"api_key", @"value": [self getApiKeyWithPrefix:@"api_key"] }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, }; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h index c0d7b716a01e..ae1c2b18b902 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h @@ -50,7 +50,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; * Deserializes the given data to Objective-C object. * * @param data The data will be deserialized. - * @param class The type of objective-c object. + * @param className The type of objective-c object. * @param error The error */ - (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m index 00745d1f4990..21e354b30e9e 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; } /** diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m index e0b44e06954b..7f93b0212c48 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; } /** diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m index a1c63520dc44..8c958695c888 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; } /** diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m index e71829873d11..3a62bcbb9a12 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; } /** diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m index c8195660df63..fd50c02e2c9c 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m @@ -17,7 +17,7 @@ * This method is used by `JSONModel`. */ + (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; } /** diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index 1b677442d03a..7cc7dbab6271 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -246,17 +246,14 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - // Configure API key authorization: (authentication scheme: api_key) [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + NSNumber* petId = @789; // ID of pet that needs to be fetched @@ -286,7 +283,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index adf66173dbc0..bd57c1089a4e 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -462,7 +462,7 @@ class ApiClient(object): content_types = list(map(lambda x: x.lower(), content_types)) - if 'application/json' in content_types: + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: return content_types[0] diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 1524d9c915ff..971fdadb1ae8 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -191,8 +191,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: */* + - **Accept**: */* diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 3500dfbb52fe..a9c7cf077104 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -306,11 +306,11 @@ module Petstore header_params = {} # HTTP header 'Accept' (if needed) - local_header_accept = ['application/json'] + local_header_accept = ['*/*'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' - local_header_content_type = ['application/json'] + local_header_content_type = ['*/*'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil? header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil? diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 0a95711ce43c..64cc2e286c22 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -142,10 +142,11 @@ module Petstore # application/json # application/json; charset=UTF8 # APPLICATION/JSON + # */* # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? end # Deserialize the response to the given return type. diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index b408c98d9e15..b7c61004bac4 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -66,16 +66,6 @@ jackson-datatype-joda 2.4.1 - - org.glassfish.jersey.containers - jersey-container-servlet-core - ${jersey2-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey2-version} - diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java index ca3257cd2147..1ff18daec256 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApi.java @@ -16,8 +16,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java index ae97d88b73ab..33a0ff02d3c2 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/FakeApiService.java @@ -3,7 +3,8 @@ package io.swagger.api; import io.swagger.api.*; import io.swagger.model.*; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import io.swagger.model.Client; import java.util.Date; @@ -19,7 +20,30 @@ import javax.ws.rs.core.SecurityContext; public abstract class FakeApiService { - public abstract Response testClientModel(Client body ) throws NotFoundException; - public abstract Response testEndpointParameters(BigDecimal number ,Double _double ,String patternWithoutDelimiter ,byte[] _byte ,Integer integer ,Integer int32 ,Long int64 ,Float _float ,String string ,byte[] binary ,Date date ,Date dateTime ,String password ,String paramCallback ) throws NotFoundException; - public abstract Response testEnumParameters(List enumFormStringArray ,String enumFormString ,List enumHeaderStringArray ,String enumHeaderString ,List enumQueryStringArray ,String enumQueryString ,BigDecimal enumQueryInteger ,Double enumQueryDouble ) throws NotFoundException; + public abstract Response testClientModel(Client body + ) throws NotFoundException; + public abstract Response testEndpointParameters(BigDecimal number + ,Double _double + ,String patternWithoutDelimiter + ,byte[] _byte + ,Integer integer + ,Integer int32 + ,Long int64 + ,Float _float + ,String string + ,byte[] binary + ,Date date + ,Date dateTime + ,String password + ,String paramCallback + ) throws NotFoundException; + public abstract Response testEnumParameters(List enumFormStringArray + ,String enumFormString + ,List enumHeaderStringArray + ,String enumHeaderString + ,List enumQueryStringArray + ,String enumQueryString + ,BigDecimal enumQueryInteger + ,Double enumQueryDouble + ) throws NotFoundException; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java index 641fcd6bd287..a6b77ddc778b 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApi.java @@ -16,8 +16,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; @@ -179,7 +179,7 @@ public class PetApi { ,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata , @FormDataParam("file") InputStream fileInputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail + @FormDataParam("file") FileInfo fileDetail ) throws NotFoundException { return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail); diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java index cc55195c9dce..f96a1305859f 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/PetApiService.java @@ -3,7 +3,8 @@ package io.swagger.api; import io.swagger.api.*; import io.swagger.model.*; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import io.swagger.model.Pet; import java.io.File; @@ -19,12 +20,25 @@ import javax.ws.rs.core.SecurityContext; public abstract class PetApiService { - public abstract Response addPet(Pet body ) throws NotFoundException; - public abstract Response deletePet(Long petId ,String apiKey ) throws NotFoundException; - public abstract Response findPetsByStatus(List status ) throws NotFoundException; - public abstract Response findPetsByTags(List tags ) throws NotFoundException; - public abstract Response getPetById(Long petId ) throws NotFoundException; - public abstract Response updatePet(Pet body ) throws NotFoundException; - public abstract Response updatePetWithForm(Long petId ,String name ,String status ) throws NotFoundException; - public abstract Response uploadFile(Long petId ,String additionalMetadata ,InputStream fileInputStream, FormDataContentDisposition fileDetail ) throws NotFoundException; + public abstract Response addPet(Pet body + ) throws NotFoundException; + public abstract Response deletePet(Long petId + ,String apiKey + ) throws NotFoundException; + public abstract Response findPetsByStatus(List status + ) throws NotFoundException; + public abstract Response findPetsByTags(List tags + ) throws NotFoundException; + public abstract Response getPetById(Long petId + ) throws NotFoundException; + public abstract Response updatePet(Pet body + ) throws NotFoundException; + public abstract Response updatePetWithForm(Long petId + ,String name + ,String status + ) throws NotFoundException; + public abstract Response uploadFile(Long petId + ,String additionalMetadata + ,InputStream fileInputStream, FileInfo fileDetail + ) throws NotFoundException; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java index 4bd3369fb9ca..6d6aa3848f76 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApi.java @@ -15,8 +15,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApiService.java index 40d6e37102a6..58331f65bffc 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/StoreApiService.java @@ -3,7 +3,8 @@ package io.swagger.api; import io.swagger.api.*; import io.swagger.model.*; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import java.util.Map; import io.swagger.model.Order; @@ -18,8 +19,11 @@ import javax.ws.rs.core.SecurityContext; public abstract class StoreApiService { - public abstract Response deleteOrder(String orderId ) throws NotFoundException; + public abstract Response deleteOrder(String orderId + ) throws NotFoundException; public abstract Response getInventory() throws NotFoundException; - public abstract Response getOrderById(Long orderId ) throws NotFoundException; - public abstract Response placeOrder(Order body ) throws NotFoundException; + public abstract Response getOrderById(Long orderId + ) throws NotFoundException; + public abstract Response placeOrder(Order body + ) throws NotFoundException; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java index 6db93811a670..fe7159324b98 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApi.java @@ -15,8 +15,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java index 2d41ae3a61dd..5042a5513420 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/api/UserApiService.java @@ -3,7 +3,8 @@ package io.swagger.api; import io.swagger.api.*; import io.swagger.model.*; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import io.swagger.model.User; import java.util.List; @@ -18,12 +19,21 @@ import javax.ws.rs.core.SecurityContext; public abstract class UserApiService { - public abstract Response createUser(User body ) throws NotFoundException; - public abstract Response createUsersWithArrayInput(List body ) throws NotFoundException; - public abstract Response createUsersWithListInput(List body ) throws NotFoundException; - public abstract Response deleteUser(String username ) throws NotFoundException; - public abstract Response getUserByName(String username ) throws NotFoundException; - public abstract Response loginUser(String username ,String password ) throws NotFoundException; + public abstract Response createUser(User body + ) throws NotFoundException; + public abstract Response createUsersWithArrayInput(List body + ) throws NotFoundException; + public abstract Response createUsersWithListInput(List body + ) throws NotFoundException; + public abstract Response deleteUser(String username + ) throws NotFoundException; + public abstract Response getUserByName(String username + ) throws NotFoundException; + public abstract Response loginUser(String username + ,String password + ) throws NotFoundException; public abstract Response logoutUser() throws NotFoundException; - public abstract Response updateUser(String username ,User body ) throws NotFoundException; + public abstract Response updateUser(String username + ,User body + ) throws NotFoundException; } diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index f4fb68654952..43e07c14462b 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -12,7 +12,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @@ -20,17 +21,40 @@ import javax.ws.rs.core.SecurityContext; public class FakeApiServiceImpl extends FakeApiService { @Override - public Response testClientModel(Client body ) throws NotFoundException { + public Response testClientModel(Client body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, Date date, Date dateTime, String password, String paramCallback ) throws NotFoundException { + public Response testEndpointParameters(BigDecimal number +, Double _double +, String patternWithoutDelimiter +, byte[] _byte +, Integer integer +, Integer int32 +, Long int64 +, Float _float +, String string +, byte[] binary +, Date date +, Date dateTime +, String password +, String paramCallback + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble ) throws NotFoundException { + public Response testEnumParameters(List enumFormStringArray +, String enumFormString +, List enumHeaderStringArray +, String enumHeaderString +, List enumQueryStringArray +, String enumQueryString +, BigDecimal enumQueryInteger +, Double enumQueryDouble + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index e99c9fa1e75c..ea6b7553a526 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -12,7 +12,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @@ -20,42 +21,55 @@ import javax.ws.rs.core.SecurityContext; public class PetApiServiceImpl extends PetApiService { @Override - public Response addPet(Pet body ) throws NotFoundException { + public Response addPet(Pet body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response deletePet(Long petId, String apiKey ) throws NotFoundException { + public Response deletePet(Long petId +, String apiKey + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByStatus(List status ) throws NotFoundException { + public Response findPetsByStatus(List status + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags(List tags ) throws NotFoundException { + public Response findPetsByTags(List tags + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response getPetById(Long petId ) throws NotFoundException { + public Response getPetById(Long petId + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response updatePet(Pet body ) throws NotFoundException { + public Response updatePet(Pet body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response updatePetWithForm(Long petId, String name, String status ) throws NotFoundException { + public Response updatePetWithForm(Long petId +, String name +, String status + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, FormDataContentDisposition fileDetail ) throws NotFoundException { + public Response uploadFile(Long petId +, String additionalMetadata +, InputStream fileInputStream, FileInfo fileDetail + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 9df17bebc178..cc9af6a75974 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -11,7 +11,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @@ -19,7 +20,8 @@ import javax.ws.rs.core.SecurityContext; public class StoreApiServiceImpl extends StoreApiService { @Override - public Response deleteOrder(String orderId ) throws NotFoundException { + public Response deleteOrder(String orderId + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @@ -29,12 +31,14 @@ public class StoreApiServiceImpl extends StoreApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response getOrderById(Long orderId ) throws NotFoundException { + public Response getOrderById(Long orderId + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response placeOrder(Order body ) throws NotFoundException { + public Response placeOrder(Order body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index bab444ea6207..babd595dca8b 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -11,7 +11,8 @@ import io.swagger.api.NotFoundException; import java.io.InputStream; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.wso2.msf4j.formparam.FormDataParam; +import org.wso2.msf4j.formparam.FileInfo; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @@ -19,32 +20,39 @@ import javax.ws.rs.core.SecurityContext; public class UserApiServiceImpl extends UserApiService { @Override - public Response createUser(User body ) throws NotFoundException { + public Response createUser(User body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response createUsersWithArrayInput(List body ) throws NotFoundException { + public Response createUsersWithArrayInput(List body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response createUsersWithListInput(List body ) throws NotFoundException { + public Response createUsersWithListInput(List body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response deleteUser(String username ) throws NotFoundException { + public Response deleteUser(String username + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response getUserByName(String username ) throws NotFoundException { + public Response getUserByName(String username + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response loginUser(String username, String password ) throws NotFoundException { + public Response loginUser(String username +, String password + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @@ -54,7 +62,9 @@ public class UserApiServiceImpl extends UserApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response updateUser(String username, User body ) throws NotFoundException { + public Response updateUser(String username +, User body + ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Category.java index c84e936b3b40..ecd7630f6a76 100644 --- a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Category.java @@ -8,6 +8,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Category", propOrder = diff --git a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/ModelApiResponse.java index 950307540f4c..dc8a57cf13a4 100644 --- a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/ModelApiResponse.java @@ -8,6 +8,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ModelApiResponse", propOrder = diff --git a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Order.java index d3d9ffabfb56..ec2140e1b4d7 100644 --- a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Order.java @@ -8,6 +8,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Order", propOrder = @@ -31,10 +32,10 @@ public class Order { private javax.xml.datatype.XMLGregorianCalendar shipDate = null; @XmlType(name="StatusEnum") -@XmlEnum +@XmlEnum(String.class) public enum StatusEnum { - PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), 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; @@ -47,8 +48,18 @@ public enum StatusEnum { return value; } + @Override + public String toString() { + return String.valueOf(value); + } + public static StatusEnum fromValue(String v) { - return valueOf(v); + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; } } diff --git a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Pet.java index 3c1adb7d97fb..5a636e92c338 100644 --- a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Pet.java @@ -12,6 +12,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Pet", propOrder = @@ -38,10 +39,10 @@ public class Pet { private List tags = new ArrayList(); @XmlType(name="StatusEnum") -@XmlEnum +@XmlEnum(String.class) public enum StatusEnum { - AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), 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; @@ -54,8 +55,18 @@ public enum StatusEnum { return value; } + @Override + public String toString() { + return String.valueOf(value); + } + public static StatusEnum fromValue(String v) { - return valueOf(v); + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; } } diff --git a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Tag.java index 1eddc2f761f9..848da3841f01 100644 --- a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/Tag.java @@ -8,6 +8,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Tag", propOrder = diff --git a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/User.java index f66d1df57e0f..e08637a5777e 100644 --- a/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf/gen/java/io/swagger/model/User.java @@ -8,6 +8,7 @@ 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; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "User", propOrder = diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 6b0b23180228..24ae04f9d191 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -1,18 +1,13 @@ 4.0.0 io.swagger - swagger-jaxrs-cxf-server - jar - swagger-jaxrs-cxf-server + swagger-cxf-server + war + swagger-cxf-server 1.0.0 - gen/main/java + src/main/java - - org.apache.maven.plugins - maven-war-plugin - 2.1.1 - maven-failsafe-plugin 2.6 @@ -25,7 +20,7 @@ - + org.codehaus.mojo build-helper-maven-plugin @@ -76,143 +70,87 @@ - gen/java + src/gen/java + + + + maven-war-plugin + 2.1.1 + + true + + - - - org.springframework - spring-context - ${springframework-version} + io.swagger + swagger-jaxrs + compile + ${swagger-core-version} - - org.springframework - spring-context-support - ${springframework-version} - - - org.springframework - spring-web - ${springframework-version} - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf-version} - - - - org.apache.cxf - cxf-rt-transports-http - ${cxf-version} - - - - org.apache.cxf - cxf-rt-rs-extension-providers - ${cxf-version} - - - - javax.ws.rs - jsr311-api - 1.1.1 - - - - - org.slf4j - slf4j-api - ${slf4j-version} - - - - - org.slf4j - log4j-over-slf4j - ${slf4j-version} - runtime - - - - org.slf4j - jcl-over-slf4j - ${slf4j-version} - - - - org.slf4j - jul-to-slf4j - ${slf4j-version} - - ch.qos.logback logback-classic - 1.0.9 - runtime - - - - - - - - javax.servlet - servlet-api - ${servlet-api-version} - provided - - - org.scala-lang - scala-library - ${scala-version} + ch.qos.logback + logback-core + ${logback-version} + compile - - - org.springframework - spring-test - ${springframework-version} - test - - - - org.apache.cxf - cxf-rt-transports-http-jetty - ${cxf-version} - test - - - - org.scalatest - scalatest_2.10 - ${scala-test-version} - test - - junit junit ${junit-version} test - + + + org.apache.cxf + cxf-rt-rs-client + ${cxf-version} + test + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description-swagger + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-ws-policy + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-wsdl + ${cxf-version} + compile + @@ -229,37 +167,11 @@ ${java.version} 1.5.9 9.2.9.v20150224 - 1.19.1 - 1.7.21 + 2.22.2 4.12 + 1.1.7 2.5 + 3.1.7 UTF-8 - 3.2.1.RELEASE - 2.7.15 - - 1.2 - 2.2 - 1.5.10 - 2.1.4 - 2.10.4 - 2.3.4 - 2.5 - 1.13 - 2.1 - 2.4.2 - 2.4.2 - 1.0.1 - - 4.8.1 - 1.0.0 - 3.2.1 - 1.6.3 - 2.1.3 - 8.1.11.v20130520 - 3.1.5 - 0.90 - 0.90 - 0 - diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index bc2bc84665d4..5f3f512a42db 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -124,6 +124,14 @@ jersey-media-multipart ${jersey2-version} + + + com.brsanthu + migbase64 + 2.2 + + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java index 40d9a325bebc..b47b9daa7dc8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java @@ -75,8 +75,8 @@ public class FakeApi { } @GET - @Consumes({ "application/json" }) - @Produces({ "application/json" }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "", response = void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class), diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index f74f7d3d8826..25d3c688b794 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -85,6 +110,7 @@ public class AdditionalPropertiesClass { return Objects.hash(mapProperty, mapOfMapProperty); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java index de739ed501c5..bf237d9b68b5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -72,6 +97,7 @@ public class Animal { return Objects.hash(className, color); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java index c2b0084d9cdf..7d6310bcb5df 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -27,6 +52,7 @@ public class AnimalFarm extends ArrayList { return Objects.hash(super.hashCode()); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 803eb69e16ab..514dc8c13928 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -58,6 +83,7 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index bebc2470927a..ed1c4eae8181 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -58,6 +83,7 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java index 19464a99acd8..b88dca900f58 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -112,6 +137,7 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java index 95bea5709234..cb618f4b188e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -52,6 +77,7 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java index ba1ecfdb2b87..3bbb55c96fde 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -72,6 +97,7 @@ public class Category { return Objects.hash(id, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java index fcb2b0a83402..dd85b6948890 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -50,6 +75,7 @@ public class Client { return Objects.hash(client); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java index f8072688756f..c6b58b522029 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -52,6 +77,7 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java index 959b35e6b131..f9dae7c4989b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -142,6 +167,7 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java index d8ac42c48722..7786ccdc589a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -23,7 +48,6 @@ public enum EnumClass { } @Override - @JsonValue public String toString() { return String.valueOf(value); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java index 446649217c88..fb4c755f11c3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -188,6 +213,7 @@ public class EnumTest { return Objects.hash(enumString, enumInteger, enumNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java index 7c882eb3fee4..1c09d9b83dce 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -326,6 +351,7 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 3f5492a2e623..3ed2e826909f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -54,6 +79,7 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java index 9ef30a045d05..06d5876ce652 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -117,6 +142,7 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5a55ab81d68b..4691a6be9b89 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -104,6 +129,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java index 09ad4d0d60e7..3221e2e3c649 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -73,6 +98,7 @@ public class Model200Response { return Objects.hash(name, propertyClass); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java index 82f447004eef..6ac7d14a1fc3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -94,6 +119,7 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java index 884a45c598e5..afdea1f37d1f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -51,6 +76,7 @@ public class ModelReturn { return Objects.hash(_return); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java index 09085fb52dca..ad4b96845aac 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -99,6 +124,7 @@ public class Name { return Objects.hash(name, snakeCase, property, _123Number); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java index 9424f7a4b5e6..f88928c72a2e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -51,6 +76,7 @@ public class NumberOnly { return Objects.hash(justNumber); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java index 1dfe20badf07..066e07c8825f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -195,6 +220,7 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java index 823d25e05a0d..570ea396090e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -208,6 +233,7 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 50a2a7e4184a..94030bc0d76b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -63,6 +88,7 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java index 2cdc99de90eb..d5acd14ac667 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -50,6 +75,7 @@ public class SpecialModelName { return Objects.hash(specialPropertyName); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java index 846812a5031a..c8f9cec4a9be 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -72,6 +97,7 @@ public class Tag { return Objects.hash(id, name); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java index 52c5fff826e7..d932649a4e56 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java @@ -1,3 +1,28 @@ +/* + * 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.model; import java.util.Objects; @@ -204,6 +229,7 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } + @Override public String toString() { StringBuilder sb = new StringBuilder();