diff --git a/.gitignore b/.gitignore
index d7be0385c82..f82755eaa4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -83,6 +83,9 @@ samples/client/petstore/scala/build/
samples/client/petstore/java/resttemplate/hello.txt
samples/client/petstore/java/retrofit2/hello.txt
samples/client/petstore/java/feign/hello.txt
+samples/client/petstore/java/jersey2-java6/project/
+samples/client/petstore/java/jersey2-java8/project/
+samples/client/petstore/java/jersey2/project/
#PHP
samples/client/petstore/php/OpenAPIToolsClient-php/composer.lock
diff --git a/CI/.travis.yml.jdk6 b/CI/.travis.yml.jdk6
new file mode 100644
index 00000000000..ced240e4461
--- /dev/null
+++ b/CI/.travis.yml.jdk6
@@ -0,0 +1,29 @@
+dist: trusty
+sudo: required
+language: java
+addons:
+ apt:
+ packages:
+ - openjdk-6-jdk
+jdk: openjdk6
+
+cache:
+ directories:
+ - $HOME/.m2
+ - $HOME/.ivy2
+ - $HOME/.gradle/caches/
+ - $HOME/.gradle/wrapper/
+
+install:
+ - jdk_switcher use openjdk6
+ - java -version
+ - curl -s "https://get.sdkman.io" | bash
+ - source "$HOME/.sdkman/bin/sdkman-init.sh"
+ - sdk version
+ - sdk install gradle 2.9
+ - sdk list gradle
+ - sdk version
+ - gradle --version
+
+script:
+ - cd samples/client/petstore/java/jersey2-java6 && gradle test
diff --git a/CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle b/CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle
new file mode 100644
index 00000000000..21ecdd4241c
--- /dev/null
+++ b/CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle
@@ -0,0 +1,122 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+
+group = 'org.openapitools'
+version = '1.0.0'
+
+buildscript {
+ repositories {
+ jcenter {
+ url "http://jcenter.bintray.com/"
+ }
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ }
+}
+
+repositories {
+ jcenter {
+ url "http://jcenter.bintray.com/"
+ }
+}
+
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided 'javax.annotation:jsr250-api:1.0'
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven'
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
+
+ install {
+ repositories.mavenInstaller {
+ pom.artifactId = 'petstore-jersey2-java6'
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.5.20"
+ jackson_version = "2.9.6"
+ jersey_version = "2.6"
+ commons_io_version=2.5
+ commons_lang3_version=3.6
+ junit_version = "4.12"
+ threetenbp_version = "2.6.4"
+}
+
+dependencies {
+ compile "io.swagger:swagger-annotations:$swagger_annotations_version"
+ compile "org.glassfish.jersey.core:jersey-client:$jersey_version"
+ compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
+ compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_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 "commons-io:commons-io:$commons_io_version"
+ compile "org.apache.commons:commons-lang3:$commons_lang3_version"
+ compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
+ compile "com.brsanthu:migbase64:2.2"
+ testCompile "junit:junit:$junit_version"
+}
diff --git a/README.md b/README.md
index e26611e7773..000066043b1 100644
--- a/README.md
+++ b/README.md
@@ -87,7 +87,8 @@ OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes
---------------------------- | ------------ | -------------------------- | -----
4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback)
3.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.2.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
-3.1.1 (current master, upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.1-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
+3.1.2-SNAPSHOT (current master, upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.2-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
+[3.1.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.1.1) | 18.07.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
[3.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.1.0) | 06.07.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
[3.0.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.3) | 27.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
[3.0.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.2) | 18.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
@@ -144,16 +145,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
-JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.0/openapi-generator-cli-3.1.0.jar`
+JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.1/openapi-generator-cli-3.1.1.jar`
For **Mac/Linux** users:
```sh
-wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.0/openapi-generator-cli-3.1.0.jar -O openapi-generator-cli.jar
+wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.1/openapi-generator-cli-3.1.1.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
-Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.0/openapi-generator-cli-3.1.0.jar
+Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.1/openapi-generator-cli-3.1.1.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -585,7 +586,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
| ObjC | |
| Perl | @wing328 (2017/07) |
-| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) |
+| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) @ybelenko (2018/07) |
| PowerShell | |
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11)|
| R | |
diff --git a/appveyor.yml b/appveyor.yml
index 7d08285a8e2..9113aaa1bda 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -18,6 +18,7 @@ install:
- cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
- cmd: SET M2_HOME=C:\maven\apache-maven-3.2.5
+ - cmd: java -version
- cmd: dir/w
- git clone https://github.com/wing328/swagger-samples
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
diff --git a/bin/java-petstore-jersey2-java6.sh b/bin/java-petstore-jersey2-java6.sh
index ef862ef444c..e62724d0f69 100755
--- a/bin/java-petstore-jersey2-java6.sh
+++ b/bin/java-petstore-jersey2-java6.sh
@@ -32,4 +32,8 @@ ags="generate --artifact-id petstore-jersey2-java6 -i modules/openapi-generator/
echo "Removing files and folders under samples/client/petstore/java/jersey2-java6/src/main"
rm -rf samples/client/petstore/java/jersey2-java6/src/main
find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
+
+echo "Restoring build.gradle ... "
+cp CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle samples/client/petstore/java/jersey2-java6/
+
java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date
index a777346ef6d..34e6f480f8f 100755
--- a/bin/utils/ensure-up-to-date
+++ b/bin/utils/ensure-up-to-date
@@ -22,7 +22,7 @@ sleep 5
./bin/php-silex-petstore-server.sh > /dev/null 2>&1
./bin/php-symfony-petstore.sh > /dev/null 2>&1
./bin/php-lumen-petstore-server.sh > /dev/null 2>&1
-./bin/php-slim-petstore-server.sh > /dev/null 2>&1
+./bin/php-slim-server-petstore.sh > /dev/null 2>&1
./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1
./bin/openapi3/php-petstore.sh > /dev/null 2>&1
./bin/typescript-angular-petstore-all.sh > /dev/null 2>&1
diff --git a/bin/windows/typescript-node-petstore-with-npm.bat b/bin/windows/typescript-node-petstore-with-npm.bat
old mode 100644
new mode 100755
diff --git a/bin/windows/typescript-node-petstore.bat b/bin/windows/typescript-node-petstore.bat
old mode 100644
new mode 100755
diff --git a/docs/migration-from-swagger-codegen.md b/docs/migration-from-swagger-codegen.md
index b3846aa0f27..f2452b3bbbc 100644
--- a/docs/migration-from-swagger-codegen.md
+++ b/docs/migration-from-swagger-codegen.md
@@ -246,8 +246,8 @@ If your API client is using named parameters in the function call (e.g. Perl req
The following gnereators are not yet fully migrated and tested
-- `rust-server`
-- `apex`
+- ~~rust-server~~ (migrated)
+- `apex` (migration scheduled in Jul/Aug 2018)
and we welcome contributions from the community to help with the migration
diff --git a/docs/migration-guide.adoc b/docs/migration-guide.adoc
index 08d220cc576..0ea6754fab0 100644
--- a/docs/migration-guide.adoc
+++ b/docs/migration-guide.adoc
@@ -11,6 +11,20 @@ Another approach to find breaking changes is to look at issue and pull requests
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)]
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)]
+=== From 3.1.x to 3.2.0
+
+Version `3.2.0` is a minor version of OpenAPI-Generator, in comparison to `3.1.x` it contains some breaking changes, but with the possibility to fallback to the old behavior.
+The default value of some options might change.
+Projects relying on generated code might need to be adapted.
+
+==== Model (all languages)
+
+In `CodegenModel` and in `CodegenOperation` we use now our own class `org.openapitools.codegen.CodegenDiscriminator` instead of `io.swagger.v3.oas.models.media.Discriminator`.
+
+For the templates, this is not an API change, because the same values are available.
+
+If you have your own `Codegen` class (to support your own generator for example) then you might get some compile error due to the change.
+
=== From 3.0.x to 3.1.0
Version `3.1.0` is the first minor version of OpenAPI-Generator, in comparison to `3.0.3` it contains some breaking changes, but with the possibility to fallback to the old behavior.
diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc
index 4441a6479e6..569f3ed8d24 100644
--- a/modules/openapi-generator-gradle-plugin/README.adoc
+++ b/modules/openapi-generator-gradle-plugin/README.adoc
@@ -34,7 +34,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath "org.openapitools:openapi-generator-gradle-plugin:3.1.0"
+ classpath "org.openapitools:openapi-generator-gradle-plugin:3.1.1"
}
}
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
index b6c8225a2a3..bf314c12e10 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md
@@ -16,5 +16,5 @@ gradle buildGoSdk
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash
-gradle -PopenApiGeneratorVersion=3.1.0 openApiValidate
+gradle -PopenApiGeneratorVersion=3.1.1 openApiValidate
```
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
index 0f603047cb4..ed24512b1e9 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
@@ -1 +1 @@
-openApiGeneratorVersion=3.1.0
+openApiGeneratorVersion=3.1.1
diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md
index 89d23c0c1e3..e96567e094b 100644
--- a/modules/openapi-generator-maven-plugin/README.md
+++ b/modules/openapi-generator-maven-plugin/README.md
@@ -11,7 +11,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
org.openapitools
openapi-generator-maven-plugin
- 3.1.0
+ 3.1.1
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
index 88cf6c2df20..0d5780a775e 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
@@ -213,6 +213,9 @@ public class CodegenConstants {
public static final String EXCLUDE_TESTS = "excludeTests";
public static final String EXCLUDE_TESTS_DESC = "Specifies that no tests are to be generated.";
+ public static final String SOURCECODEONLY_GENERATION = "generateSourceCodeOnly";
+ public static final String SOURCECODEONLY_GENERATION_DESC = "Specifies that only a library source code is to be generated.";
+
// Not user-configurable. System provided for use in templates.
public static final String GENERATE_APIS = "generateApis";
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java
new file mode 100644
index 00000000000..79c2c40874b
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java
@@ -0,0 +1,88 @@
+package org.openapitools.codegen;
+
+import java.util.*;
+
+public class CodegenDiscriminator {
+ private String propertyName;
+ private Map mapping;
+ private Set mappedModels = new LinkedHashSet<>();
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public void setPropertyName(String propertyName) {
+ this.propertyName = propertyName;
+ }
+
+ public Map getMapping() {
+ return mapping;
+ }
+
+ public void setMapping(Map mapping) {
+ this.mapping = mapping;
+ }
+
+ public Set getMappedModels() {
+ return mappedModels;
+ }
+
+ public void setMappedModels(Set mappedModels) {
+ this.mappedModels = mappedModels;
+ }
+
+ public static class MappedModel {
+ private String mappingName;
+ private String modelName;
+
+ public MappedModel(String mappingName, String modelName) {
+ this.mappingName = mappingName;
+ this.modelName = modelName;
+ }
+
+ public String getMappingName() {
+ return mappingName;
+ }
+
+ public void setMappingName(String mappingName) {
+ this.mappingName = mappingName;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ MappedModel that = (MappedModel) o;
+ return Objects.equals(mappingName, that.mappingName) &&
+ Objects.equals(modelName, that.modelName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mappingName, modelName);
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ CodegenDiscriminator that = (CodegenDiscriminator) o;
+ return Objects.equals(propertyName, that.propertyName) &&
+ Objects.equals(mapping, that.mapping) &&
+ Objects.equals(mappedModels, that.mappedModels);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(propertyName, mapping, mappedModels);
+ }
+}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
index 864028eacb7..279d796f05f 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
@@ -18,15 +18,14 @@
package org.openapitools.codegen;
import io.swagger.v3.oas.models.ExternalDocumentation;
-import io.swagger.v3.oas.models.media.Discriminator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
-import java.util.Objects;
public class CodegenModel {
public String parent, parentSchema;
@@ -40,7 +39,7 @@ public class CodegenModel {
public String name, classname, title, description, classVarName, modelJson, dataType, xmlPrefix, xmlNamespace, xmlName;
public String classFilename; // store the class file name, mainly used for import
public String unescapedDescription;
- public Discriminator discriminator;
+ public CodegenDiscriminator discriminator;
public String defaultValue;
public String arrayModelType;
public boolean isAlias; // Is this effectively an alias of another simple type
@@ -349,7 +348,7 @@ public class CodegenModel {
this.unescapedDescription = unescapedDescription;
}
- public Discriminator getDiscriminator() {
+ public CodegenDiscriminator getDiscriminator() {
return discriminator;
}
@@ -357,7 +356,7 @@ public class CodegenModel {
return discriminator == null ? null : discriminator.getPropertyName();
}
- public void setDiscriminator(Discriminator discriminator) {
+ public void setDiscriminator(CodegenDiscriminator discriminator) {
this.discriminator = discriminator;
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java
index 6f29146bde3..0e7e96d1b54 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java
@@ -18,17 +18,15 @@
package org.openapitools.codegen;
import io.swagger.v3.oas.models.ExternalDocumentation;
-import io.swagger.v3.oas.models.media.Discriminator;
-import io.swagger.v3.oas.models.parameters.RequestBody;
import io.swagger.v3.oas.models.tags.Tag;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.Arrays;
public class CodegenOperation {
public final List responseHeaders = new ArrayList();
@@ -40,7 +38,7 @@ public class CodegenOperation {
isRestful, isDeprecated;
public String path, operationId, returnType, httpMethod, returnBaseType,
returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse;
- public Discriminator discriminator;
+ public CodegenDiscriminator discriminator;
public List
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
index e70b34ad0dc..da375a01057 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
@@ -709,12 +709,12 @@ public class ApiClient {
Map> responseHeaders = buildResponseHeaders(response);
if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) {
- return new ApiResponse<>(statusCode, responseHeaders);
+ return new ApiResponse<{{#supportJava6}}T{{/supportJava6}}>(statusCode, responseHeaders);
} else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) {
if (returnType == null)
- return new ApiResponse<>(statusCode, responseHeaders);
+ return new ApiResponse<{{#supportJava6}}T{{/supportJava6}}>(statusCode, responseHeaders);
else
- return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType));
+ return new ApiResponse<{{#supportJava6}}T{{/supportJava6}}>(statusCode, responseHeaders, deserialize(response, returnType));
} else {
String message = "error";
String respBody = null;
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache
index 19d8c2c6d84..8f7c03adefa 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache
@@ -32,6 +32,11 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 25
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -40,6 +45,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
@@ -83,6 +89,11 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
+ {{#supportJava6}}
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -91,6 +102,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
install {
repositories.mavenInstaller {
@@ -105,17 +117,20 @@ if(hasProperty('target') && target == 'android') {
}
ext {
- swagger_annotations_version = "1.5.17"
- jackson_version = "2.8.9"
+ swagger_annotations_version = "1.5.20"
+ jackson_version = "2.9.6"
{{#supportJava6}}
jersey_version = "2.6"
commons_io_version=2.5
commons_lang3_version=3.6
{{/supportJava6}}
{{^supportJava6}}
- jersey_version = "2.25.1"
+ jersey_version = "2.27"
{{/supportJava6}}
junit_version = "4.12"
+ {{#threetenbp}}
+ threetenbp_version = "2.6.4"
+ {{/threetenbp}}
}
dependencies {
@@ -127,17 +142,17 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
{{#joda}}
- compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version",
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
{{/joda}}
{{#java8}}
- compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version",
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
{{/java8}}
{{#supportJava6}}
compile "commons-io:commons-io:$commons_io_version"
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
{{/supportJava6}}
{{#threetenbp}}
- compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version",
+ compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
{{/threetenbp}}
{{^java8}}
compile "com.brsanthu:migbase64:2.2"
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache
index 544297d481d..54902da7989 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache
@@ -9,13 +9,13 @@ lazy val root = (project in file(".")).
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
- "io.swagger" % "swagger-annotations" % "1.5.17",
+ "io.swagger" % "swagger-annotations" % "1.5.20",
"org.glassfish.jersey.core" % "jersey-client" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}},
"org.glassfish.jersey.media" % "jersey-media-multipart" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}},
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}},
- "com.fasterxml.jackson.core" % "jackson-core" % "{{^threetenbp}}2.8.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile",
- "com.fasterxml.jackson.core" % "jackson-annotations" % "{{^threetenbp}}2.8.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile",
- "com.fasterxml.jackson.core" % "jackson-databind" % "{{^threetenbp}}2.8.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-core" % "2.8.9" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9" % "compile",
{{#joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.8.9" % "compile",
{{/joda}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache
index 85f38605dd8..5c273fa147b 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache
@@ -139,6 +139,11 @@
maven-compiler-plugin
3.6.1
+ {{#supportJava6}}
+ 1.6
+ 1.6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
1.8
1.8
@@ -147,6 +152,7 @@
1.7
1.7
{{/java8}}
+ {{/supportJava6}}
@@ -270,7 +276,7 @@
com.github.joschi.jackson
jackson-datatype-threetenbp
- ${jackson-version}
+ ${threetenbp-version}
{{/threetenbp}}
{{^java8}}
@@ -312,16 +318,19 @@
UTF-8
- 1.5.18
+ 1.5.20
{{^supportJava6}}
- 2.25.1
+ 2.27
{{/supportJava6}}
{{#supportJava6}}
- 2.6
- 2.5
- 3.6
+ 2.6
+ 2.5
+ 3.6
{{/supportJava6}}
- {{^threetenbp}}2.7.5{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}
+ 2.8.9
+ {{#threetenbp}}
+ 2.6.4
+ {{/threetenbp}}
1.0.0
4.12
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
index 27fe1caaf25..69621c1a6bd 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache
@@ -32,6 +32,11 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 25
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -40,6 +45,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
@@ -84,8 +90,20 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
- sourceCompatibility = JavaVersion.VERSION_{{^java8}}1_7{{/java8}}{{#java8}}1_8{{/java8}}
- targetCompatibility = JavaVersion.VERSION_{{^java8}}1_7{{/java8}}{{#java8}}1_8{{/java8}}
+ {{#supportJava6}}
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
+ {{#java8}}
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ {{/java8}}
+ {{^java8}}
+ sourceCompatibility = JavaVersion.VERSION_1_7
+ targetCompatibility = JavaVersion.VERSION_1_7
+ {{/java8}}
+ {{/supportJava6}}
install {
repositories.mavenInstaller {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
index b5119774a05..0b0903d617b 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
@@ -267,7 +267,7 @@
- {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}
+ {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}}
${java.version}
${java.version}
1.8.0
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache
index fc42da3e68c..fc2cd18dbea 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache
@@ -32,6 +32,11 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 23
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -40,6 +45,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
@@ -83,6 +89,11 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
+ {{#supportJava6}}
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -91,6 +102,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
install {
repositories.mavenInstaller {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
index e6aae545c91..479c22ba75c 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
@@ -120,6 +120,11 @@
maven-compiler-plugin
2.5.1
+ {{#supportJava6}}
+ 1.6
+ 1.6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
1.8
1.8
@@ -128,6 +133,7 @@
1.7
1.7
{{/java8}}
+ {{/supportJava6}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache
index e4fc1caa4f0..9925cc43daf 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache
@@ -32,6 +32,11 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 22
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -40,6 +45,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
@@ -84,6 +90,11 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
+ {{#supportJava6}}
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -92,6 +103,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
install {
repositories.mavenInstaller {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache
index 01abe39efb5..0d371de6ea1 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache
@@ -139,6 +139,11 @@
maven-compiler-plugin
3.6.1
+ {{#supportJava6}}
+ 1.6
+ 1.6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
1.8
1.8
@@ -147,6 +152,7 @@
1.7
1.7
{{/java8}}
+ {{/supportJava6}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache
index 6befe74db7c..f0c1cbe4c88 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache
@@ -32,6 +32,11 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 25
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -40,6 +45,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache
index 0921ab21ac4..adbd6e99e50 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache
@@ -139,8 +139,20 @@
maven-compiler-plugin
3.6.1
- {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}
- {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}
+ {{#supportJava6}}
+ 1.6
+ 1.6
+ {{/supportJava6}}
+ {{^supportJava6}}
+ {{#java8}}
+ 1.8
+ 1.8
+ {{/java8}}
+ {{^java8}}
+ 1.7
+ 1.7
+ {{/java8}}
+ {{/supportJava6}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache
index 3dcea989c19..ac8958824cb 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache
@@ -57,21 +57,20 @@ public class JSON {
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
- {{#parent}}
- .registerTypeSelector({{classname}}.class, new TypeSelector() {
+ {{#models}}{{#model}}{{#discriminator}} .registerTypeSelector({{classname}}.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- {{#children}}
- classByDiscriminatorValue.put("{{name}}".toUpperCase(), {{classname}}.class);
- {{/children}}
+ {{#mappedModels}}
+ classByDiscriminatorValue.put("{{mappingName}}".toUpperCase(), {{modelName}}.class);
+ {{/mappedModels}}
classByDiscriminatorValue.put("{{classname}}".toUpperCase(), {{classname}}.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, "{{{discriminatorName}}}"));
+ getDiscriminatorValue(readElement, "{{{propertyName}}}"));
}
})
- {{/parent}}
+ {{/discriminator}}{{/model}}{{/models}}
;
return fireBuilder.createGsonBuilder();
}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache
index f341375f821..858b88971b2 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache
@@ -32,6 +32,11 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 25
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -40,6 +45,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
@@ -84,8 +90,20 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
- sourceCompatibility = JavaVersion.VERSION_{{^java8}}1_7{{/java8}}{{#java8}}1_8{{/java8}}
- targetCompatibility = JavaVersion.VERSION_{{^java8}}1_7{{/java8}}{{#java8}}1_8{{/java8}}
+ {{#supportJava6}}
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
+ {{#java8}}
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ {{/java8}}
+ {{^java8}}
+ sourceCompatibility = JavaVersion.VERSION_1_7
+ targetCompatibility = JavaVersion.VERSION_1_7
+ {{/java8}}
+ {{/supportJava6}}
install {
repositories.mavenInstaller {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache
index 5c871c62073..8683ccc5f22 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache
@@ -40,7 +40,7 @@ public class ApiClient {
public ApiClient() {
// Setup authentications (key: authentication name, value: authentication).
- authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}
+ authentications = new HashMap<{{#supportJava6}}String, Authentication{{/supportJava6}}>();{{#authMethods}}{{#isBasic}}
// authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}}
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
// authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
@@ -57,8 +57,8 @@ public class ApiClient {
basePath = basePath + "/";
}
- Map extraHeaders = new HashMap<>();
- List extraQueryParams = new ArrayList<>();
+ Map extraHeaders = new HashMap<{{#supportJava6}}String, String{{/supportJava6}}>();
+ List extraQueryParams = new ArrayList<{{#supportJava6}}Pair{{/supportJava6}}>();
for (String authName : authentications.keySet()) {
Authentication auth = authentications.get(authName);
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache
index 163afd670c1..7d3dbd1e28c 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache
@@ -40,7 +40,7 @@ public class ApiClient {
public ApiClient() {
// Setup authentications (key: authentication name, value: authentication).
- authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}
+ authentications = new HashMap<{{#supportJava6}}String, Authentication{{/supportJava6}}>();{{#authMethods}}{{#isBasic}}
// authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}}
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
// authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
@@ -57,8 +57,8 @@ public class ApiClient {
basePath = basePath + "/";
}
- Map extraHeaders = new HashMap<>();
- List extraQueryParams = new ArrayList<>();
+ Map extraHeaders = new HashMap<{{#supportJava6}}String, String{{/supportJava6}}>();
+ List extraQueryParams = new ArrayList<{{#supportJava6}}Pair{{/supportJava6}}>();
for (String authName : authentications.keySet()) {
Authentication auth = authentications.get(authName);
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache
index 3adfab68fe7..f23642e46bb 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache
@@ -327,7 +327,7 @@
UTF-8
- {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}
+ {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}}
${java.version}
${java.version}
1.8.0
diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache
index 7e61c4c05ad..0c1501e115c 100644
--- a/modules/openapi-generator/src/main/resources/Java/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache
@@ -139,6 +139,11 @@
maven-compiler-plugin
3.6.1
+ {{#supportJava6}}
+ 1.6
+ 1.6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
1.8
1.8
@@ -147,6 +152,7 @@
1.7
1.7
{{/java8}}
+ {{/supportJava6}}
diff --git a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache
index 1e2d5134b34..8e4b33b7848 100644
--- a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache
@@ -1,7 +1,8 @@
{{#jackson}}
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true)
@JsonSubTypes({
- {{#children}}
- @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
- {{/children}}
+ {{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
+ {{/discriminator.mappedModels}}
}){{/jackson}}
diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
index 1e2d5134b34..8e4b33b7848 100644
--- a/modules/openapi-generator/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
@@ -1,7 +1,8 @@
{{#jackson}}
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true)
@JsonSubTypes({
- {{#children}}
- @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
- {{/children}}
+ {{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
+ {{/discriminator.mappedModels}}
}){{/jackson}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
index 1e2d5134b34..8e4b33b7848 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
@@ -1,7 +1,8 @@
{{#jackson}}
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true)
@JsonSubTypes({
- {{#children}}
- @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
- {{/children}}
+ {{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
+ {{/discriminator.mappedModels}}
}){{/jackson}}
diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache
index 1e2d5134b34..8e4b33b7848 100644
--- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/typeInfoAnnotation.mustache
@@ -1,7 +1,8 @@
{{#jackson}}
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true)
@JsonSubTypes({
- {{#children}}
- @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
- {{/children}}
+ {{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
+ {{/discriminator.mappedModels}}
}){{/jackson}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
index 1e2d5134b34..8e4b33b7848 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
@@ -1,7 +1,8 @@
{{#jackson}}
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true)
@JsonSubTypes({
- {{#children}}
- @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
- {{/children}}
+ {{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
+ {{/discriminator.mappedModels}}
}){{/jackson}}
diff --git a/modules/openapi-generator/src/main/resources/android/build.mustache b/modules/openapi-generator/src/main/resources/android/build.mustache
index 2900eaf0bcd..2b93de842ac 100644
--- a/modules/openapi-generator/src/main/resources/android/build.mustache
+++ b/modules/openapi-generator/src/main/resources/android/build.mustache
@@ -56,6 +56,11 @@ android {
{{/androidSdkVersion}}
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -64,6 +69,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache
index 45a83a6af50..8f2127fb5d1 100644
--- a/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache
+++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache
@@ -35,6 +35,11 @@ android {
targetSdkVersion 25
}
compileOptions {
+ {{#supportJava6}}
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ {{/supportJava6}}
+ {{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -43,6 +48,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/typeInfoAnnotation.mustache
index 1e2d5134b34..8e4b33b7848 100644
--- a/modules/openapi-generator/src/main/resources/java-pkmst/typeInfoAnnotation.mustache
+++ b/modules/openapi-generator/src/main/resources/java-pkmst/typeInfoAnnotation.mustache
@@ -1,7 +1,8 @@
{{#jackson}}
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminatorName}}}", visible = true)
@JsonSubTypes({
- {{#children}}
- @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
- {{/children}}
+ {{#discriminator.mappedModels}}
+ @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
+ {{/discriminator.mappedModels}}
}){{/jackson}}
diff --git a/modules/openapi-generator/src/main/resources/php-slim-server/api_test.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/api_test.mustache
new file mode 100644
index 00000000000..ecc80a622c7
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-slim-server/api_test.mustache
@@ -0,0 +1,90 @@
+=5.5",
"slim/slim": "3.*"
},
+ "require-dev": {
+ "phpunit/phpunit": "^4.8"
+ },
"autoload": {
"psr-4": { "{{escapedInvokerPackage}}\\": "{{srcBasePath}}/" }
+ },
+ "autoload-dev": {
+ "psr-4": { "{{escapedInvokerPackage}}\\": "{{testBasePath}}/" }
+ },
+ "scripts": {
+ "test": [
+ "@test-apis",
+ "@test-models"
+ ],
+ "test-apis": "phpunit --testsuite Apis",
+ "test-models": "phpunit --testsuite Models"
}
}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/php-slim-server/model_test.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/model_test.mustache
new file mode 100644
index 00000000000..cc559bd1c6b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-slim-server/model_test.mustache
@@ -0,0 +1,96 @@
+
+
+>
+
+
+ {{apiTestPath}}
+
+
+ {{modelTestPath}}
+
+
+
+
+ {{apiSrcPath}}
+ {{modelSrcPath}}
+
+
+
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/python/README.mustache b/modules/openapi-generator/src/main/resources/python/README.mustache
index cf92dc583db..be835339063 100644
--- a/modules/openapi-generator/src/main/resources/python/README.mustache
+++ b/modules/openapi-generator/src/main/resources/python/README.mustache
@@ -52,78 +52,4 @@ import {{{packageName}}}
Please follow the [installation procedure](#installation--usage) and then run the following:
-```python
-from __future__ import print_function
-import time
-import {{{packageName}}}
-from {{{packageName}}}.rest import ApiException
-from pprint import pprint
-{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
-# Configure HTTP basic authorization: {{{name}}}
-configuration = {{{packageName}}}.Configuration()
-configuration.username = 'YOUR_USERNAME'
-configuration.password = 'YOUR_PASSWORD'{{/isBasic}}{{#isApiKey}}
-# Configure API key authorization: {{{name}}}
-configuration = {{{packageName}}}.Configuration()
-configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY'
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# configuration.api_key_prefix['{{{keyParamName}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}}
-# Configure OAuth2 access token for authorization: {{{name}}}
-configuration = {{{packageName}}}.Configuration()
-configuration.access_token = 'YOUR_ACCESS_TOKEN'{{/isOAuth}}{{/authMethods}}
-{{/hasAuthMethods}}
-
-# create an instance of the API class
-api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration))
-{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
-{{/allParams}}
-
-try:
-{{#summary}} # {{{.}}}
-{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}
- pprint(api_response){{/returnType}}
-except ApiException as e:
- print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
-{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
-```
-
-## Documentation for API Endpoints
-
-All URIs are relative to *{{basePath}}*
-
-Class | Method | HTTP request | Description
------------- | ------------- | ------------- | -------------
-{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
-{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
-
-## Documentation For Models
-
-{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
-{{/model}}{{/models}}
-
-## Documentation For Authorization
-
-{{^authMethods}} All endpoints do not require authorization.
-{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
-{{#authMethods}}## {{{name}}}
-
-{{#isApiKey}}- **Type**: API key
-- **API key parameter name**: {{{keyParamName}}}
-- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
-{{/isApiKey}}
-{{#isBasic}}- **Type**: HTTP basic authentication
-{{/isBasic}}
-{{#isOAuth}}- **Type**: OAuth
-- **Flow**: {{{flow}}}
-- **Authorization URL**: {{{authorizationUrl}}}
-- **Scopes**: {{^scopes}}N/A{{/scopes}}
-{{#scopes}} - **{{{scope}}}**: {{{description}}}
-{{/scopes}}
-{{/isOAuth}}
-
-{{/authMethods}}
-
-## Author
-
-{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
-{{/hasMore}}{{/apis}}{{/apiInfo}}
+{{> common_README }}
diff --git a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache
new file mode 100644
index 00000000000..826454b1eac
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache
@@ -0,0 +1,44 @@
+# {{{projectName}}}
+{{#appDescription}}
+{{{appDescription}}}
+{{/appDescription}}
+
+The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: {{appVersion}}
+- Package version: {{packageVersion}}
+{{^hideGenerationTimestamp}}
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+- Build package: {{generatorClass}}
+{{#infoUrl}}
+For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+## Requirements.
+
+Python 2.7 and 3.4+
+
+## Installation & Usage
+
+This python library package is generated without supporting files like setup.py or requirements files
+
+To be able to use it, you will need these dependencies in your own package that uses this library:
+
+* urllib3 >= 1.15
+* six >= 1.10
+* certifi
+* python-dateutil
+{{#asyncio}}
+* aiohttp
+{{/asyncio}}
+{{#tornado}}
+* tornado>=4.2,<5
+{{/tornado}}
+
+## Getting Started
+
+In your own code, to use this library to connect and interact with {{{projectName}}},
+you can run the following:
+
+{{> common_README }}
diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache
index cd42506f540..a21c6dbac9d 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache
@@ -6,6 +6,8 @@
from __future__ import absolute_import
+__version__ = "{{packageVersion}}"
+
# import apis into sdk package
{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}}
{{/apis}}{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache
new file mode 100644
index 00000000000..f203456f208
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache
@@ -0,0 +1,75 @@
+```python
+from __future__ import print_function
+import time
+import {{{packageName}}}
+from {{{packageName}}}.rest import ApiException
+from pprint import pprint
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
+# Configure HTTP basic authorization: {{{name}}}
+configuration = {{{packageName}}}.Configuration()
+configuration.username = 'YOUR_USERNAME'
+configuration.password = 'YOUR_PASSWORD'{{/isBasic}}{{#isApiKey}}
+# Configure API key authorization: {{{name}}}
+configuration = {{{packageName}}}.Configuration()
+configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY'
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['{{{keyParamName}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}}
+# Configure OAuth2 access token for authorization: {{{name}}}
+configuration = {{{packageName}}}.Configuration()
+configuration.access_token = 'YOUR_ACCESS_TOKEN'{{/isOAuth}}{{/authMethods}}
+{{/hasAuthMethods}}
+
+# create an instance of the API class
+api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration))
+{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
+{{/allParams}}
+
+try:
+{{#summary}} # {{{.}}}
+{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}
+ pprint(api_response){{/returnType}}
+except ApiException as e:
+ print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *{{basePath}}*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
+{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
+
+## Documentation For Models
+
+{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
+{{/model}}{{/models}}
+
+## Documentation For Authorization
+
+{{^authMethods}} All endpoints do not require authorization.
+{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
+{{#authMethods}}## {{{name}}}
+
+{{#isApiKey}}- **Type**: API key
+- **API key parameter name**: {{{keyParamName}}}
+- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
+{{/isApiKey}}
+{{#isBasic}}- **Type**: HTTP basic authentication
+{{/isBasic}}
+{{#isOAuth}}- **Type**: OAuth
+- **Flow**: {{{flow}}}
+- **Authorization URL**: {{{authorizationUrl}}}
+- **Scopes**: {{^scopes}}N/A{{/scopes}}
+{{#scopes}} - **{{{scope}}}**: {{{description}}}
+{{/scopes}}
+{{/isOAuth}}
+
+{{/authMethods}}
+
+## Author
+
+{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
+{{/hasMore}}{{/apis}}{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/ruby-sinatra-server/api.mustache b/modules/openapi-generator/src/main/resources/ruby-sinatra-server/api.mustache
index 5587837fbdf..3eeaf93e93d 100644
--- a/modules/openapi-generator/src/main/resources/ruby-sinatra-server/api.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-sinatra-server/api.mustache
@@ -7,7 +7,7 @@ MyApp.add_route('{{httpMethod}}', '{{{basePathWithoutHost}}}{{{path}}}', {
"resourcePath" => "/{{{baseName}}}",
"summary" => "{{{summary}}}",
"nickname" => "{{nickname}}",
- "responseClass" => "{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}",
+ "responseClass" => "{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}",
"endpoint" => "{{{path}}}",
"notes" => "{{{notes}}}",
"parameters" => [
@@ -15,7 +15,7 @@ MyApp.add_route('{{httpMethod}}', '{{{basePathWithoutHost}}}{{{path}}}', {
{
"name" => "{{paramName}}",
"description" => "{{description}}",
- "dataType" => "{{dataType}}",
+ "dataType" => "{{{dataType}}}",
{{#collectionFormat}}
"collectionFormat" => "{{collectionFormat}}",
{{/collectionFormat}}
@@ -32,7 +32,7 @@ MyApp.add_route('{{httpMethod}}', '{{{basePathWithoutHost}}}{{{path}}}', {
{
"name" => "{{paramName}}",
"description" => "{{description}}",
- "dataType" => "{{dataType}}",
+ "dataType" => "{{{dataType}}}",
"paramType" => "path",
},
{{/pathParams}}
@@ -40,7 +40,7 @@ MyApp.add_route('{{httpMethod}}', '{{{basePathWithoutHost}}}{{{path}}}', {
{
"name" => "{{paramName}}",
"description" => "{{description}}",
- "dataType" => "{{dataType}}",
+ "dataType" => "{{{dataType}}}",
"paramType" => "header",
},
{{/headerParams}}
@@ -48,7 +48,7 @@ MyApp.add_route('{{httpMethod}}', '{{{basePathWithoutHost}}}{{{path}}}', {
{
"name" => "body",
"description" => "{{description}}",
- "dataType" => "{{dataType}}",
+ "dataType" => "{{{dataType}}}",
"paramType" => "body",
}
{{/bodyParams}}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
index 899e1c4fd8c..be71943daf7 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
@@ -356,6 +356,47 @@ public class DefaultCodegenTest {
Assert.assertEquals(codegenParameter2.example, "An example4 value");
}
+ @Test
+ public void testDiscriminator() {
+ final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", null, new ParseOptions()).getOpenAPI();
+ DefaultCodegen codegen = new DefaultCodegen();
+
+ Schema animal = openAPI.getComponents().getSchemas().get("Animal");
+ CodegenModel animalModel = codegen.fromModel("Animal", animal, openAPI.getComponents().getSchemas());
+ CodegenDiscriminator discriminator = animalModel.getDiscriminator();
+ CodegenDiscriminator test = new CodegenDiscriminator();
+ test.setPropertyName("className");
+ test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog"));
+ test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat"));
+ Assert.assertEquals(discriminator, test);
+ }
+
+ @Test
+ public void testDiscriminatorWithCustomMapping() {
+ final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/allOf.yaml", null, new ParseOptions()).getOpenAPI();
+ DefaultCodegen codegen = new DefaultCodegen();
+
+ String path = "/person/display/{personId}";
+ Operation operation = openAPI.getPaths().get(path).getGet();
+ CodegenOperation codegenOperation = codegen.fromOperation(path, "GET", operation, openAPI.getComponents().getSchemas());
+ verifyPersonDiscriminator(codegenOperation.discriminator);
+
+ Schema person = openAPI.getComponents().getSchemas().get("Person");
+ CodegenModel personModel = codegen.fromModel("Person", person, openAPI.getComponents().getSchemas());
+ verifyPersonDiscriminator(personModel.discriminator);
+ }
+
+ private void verifyPersonDiscriminator(CodegenDiscriminator discriminator) {
+ CodegenDiscriminator test = new CodegenDiscriminator();
+ test.setPropertyName("$_type");
+ test.setMapping(new HashMap<>());
+ test.getMapping().put("a", "#/components/schemas/Adult");
+ test.getMapping().put("c", "#/components/schemas/Child");
+ test.getMappedModels().add(new CodegenDiscriminator.MappedModel("a", "Adult"));
+ test.getMappedModels().add(new CodegenDiscriminator.MappedModel("c", "Child"));
+ Assert.assertEquals(discriminator, test);
+ }
+
private CodegenProperty codegenPropertyWithArrayOfIntegerValues() {
CodegenProperty array = new CodegenProperty();
final CodegenProperty items = new CodegenProperty();
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
index b3ee65c1c06..94f4aa7c05c 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
@@ -64,111 +64,6 @@ import java.util.stream.Collectors;
public class JavaClientCodegenTest {
- @Test
- public void modelInheritanceSupportInGson() throws Exception {
- List
@@ -239,7 +239,7 @@
com.github.joschi.jackson
jackson-datatype-threetenbp
- ${jackson-version}
+ ${threetenbp-version}
@@ -267,11 +267,12 @@
UTF-8
- 1.5.18
- 2.6
- 2.5
- 3.6
- 2.6.4
+ 1.5.20
+ 2.6
+ 2.5
+ 3.6
+ 2.8.9
+ 2.6.4
1.0.0
4.12
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java
index 277483ebd51..5893b2b206a 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java
@@ -698,12 +698,12 @@ public class ApiClient {
Map> responseHeaders = buildResponseHeaders(response);
if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) {
- return new ApiResponse<>(statusCode, responseHeaders);
+ return new ApiResponse(statusCode, responseHeaders);
} else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) {
if (returnType == null)
- return new ApiResponse<>(statusCode, responseHeaders);
+ return new ApiResponse(statusCode, responseHeaders);
else
- return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType));
+ return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType));
} else {
String message = "error";
String respBody = null;
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java
index 6ead598aa2d..090fe37550e 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java
@@ -25,7 +25,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java
index f23eef8b585..11916028aac 100644
--- a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java
+++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/FakeApiTest.java
@@ -17,6 +17,7 @@ import org.openapitools.client.ApiException;
import java.math.BigDecimal;
import org.openapitools.client.model.Client;
import java.io.File;
+import org.openapitools.client.model.FileSchemaTestClass;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import org.openapitools.client.model.OuterComposite;
@@ -102,6 +103,22 @@ public class FakeApiTest {
// TODO: test validations
}
+ /**
+ *
+ *
+ * For this test, the body for this request much reference a schema named `File`.
+ *
+ * @throws ApiException
+ * if the Api call fails
+ */
+ @Test
+ public void testBodyWithFileSchemaTest() throws ApiException {
+ FileSchemaTestClass fileSchemaTestClass = null;
+ api.testBodyWithFileSchema(fileSchemaTestClass);
+
+ // TODO: test validations
+ }
+
/**
*
*
diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java
index d3fbe90a5a6..f31cc07244e 100644
--- a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java
+++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java
@@ -167,4 +167,22 @@ public class PetApiTest {
// TODO: test validations
}
+ /**
+ * uploads an image (required)
+ *
+ *
+ *
+ * @throws ApiException
+ * if the Api call fails
+ */
+ @Test
+ public void uploadFileWithRequiredFileTest() throws ApiException {
+ Long petId = null;
+ File requiredFile = null;
+ String additionalMetadata = null;
+ ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
+
+ // TODO: test validations
+ }
+
}
diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle
index 523d5141c28..d271017ae90 100644
--- a/samples/client/petstore/java/jersey2-java8/build.gradle
+++ b/samples/client/petstore/java/jersey2-java8/build.gradle
@@ -93,9 +93,9 @@ if(hasProperty('target') && target == 'android') {
}
ext {
- swagger_annotations_version = "1.5.17"
- jackson_version = "2.8.9"
- jersey_version = "2.25.1"
+ swagger_annotations_version = "1.5.20"
+ jackson_version = "2.9.6"
+ jersey_version = "2.27"
junit_version = "4.12"
}
@@ -107,6 +107,6 @@ dependencies {
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.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version",
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
testCompile "junit:junit:$junit_version"
}
diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt
index 80b7698e7b2..1bd1f63a7d5 100644
--- a/samples/client/petstore/java/jersey2-java8/build.sbt
+++ b/samples/client/petstore/java/jersey2-java8/build.sbt
@@ -9,7 +9,7 @@ lazy val root = (project in file(".")).
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
- "io.swagger" % "swagger-annotations" % "1.5.17",
+ "io.swagger" % "swagger-annotations" % "1.5.20",
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml
index 0d508e5e97b..c6317e79ee4 100644
--- a/samples/client/petstore/java/jersey2-java8/pom.xml
+++ b/samples/client/petstore/java/jersey2-java8/pom.xml
@@ -251,9 +251,9 @@
UTF-8
- 1.5.18
- 2.25.1
- 2.7.5
+ 1.5.20
+ 2.27
+ 2.8.9
1.0.0
4.12
diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java
index aa818c1efa3..6819bd7fe7d 100644
--- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java
@@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle
index d189b0170b5..f1a401ef53e 100644
--- a/samples/client/petstore/java/jersey2/build.gradle
+++ b/samples/client/petstore/java/jersey2/build.gradle
@@ -93,10 +93,11 @@ if(hasProperty('target') && target == 'android') {
}
ext {
- swagger_annotations_version = "1.5.17"
- jackson_version = "2.8.9"
- jersey_version = "2.25.1"
+ swagger_annotations_version = "1.5.20"
+ jackson_version = "2.9.6"
+ jersey_version = "2.27"
junit_version = "4.12"
+ threetenbp_version = "2.6.4"
}
dependencies {
@@ -107,7 +108,7 @@ dependencies {
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 "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
compile "com.brsanthu:migbase64:2.2"
testCompile "junit:junit:$junit_version"
}
diff --git a/samples/client/petstore/java/jersey2/build.sbt b/samples/client/petstore/java/jersey2/build.sbt
index f650b5e372d..578112888ec 100644
--- a/samples/client/petstore/java/jersey2/build.sbt
+++ b/samples/client/petstore/java/jersey2/build.sbt
@@ -9,13 +9,13 @@ lazy val root = (project in file(".")).
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
- "io.swagger" % "swagger-annotations" % "1.5.17",
+ "io.swagger" % "swagger-annotations" % "1.5.20",
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
- "com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile",
- "com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile",
- "com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-core" % "2.8.9" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9" % "compile",
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile",
"com.brsanthu" % "migbase64" % "2.2",
"junit" % "junit" % "4.12" % "test",
diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml
index edc923c5dca..ffc94e97dec 100644
--- a/samples/client/petstore/java/jersey2/pom.xml
+++ b/samples/client/petstore/java/jersey2/pom.xml
@@ -239,7 +239,7 @@
com.github.joschi.jackson
jackson-datatype-threetenbp
- ${jackson-version}
+ ${threetenbp-version}
@@ -257,9 +257,10 @@
UTF-8
- 1.5.18
- 2.25.1
- 2.6.4
+ 1.5.20
+ 2.27
+ 2.8.9
+ 2.6.4
1.0.0
4.12
diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java
index aa818c1efa3..6819bd7fe7d 100644
--- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java
@@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java
index f9f55a2d382..8b4f1f34d02 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java
@@ -55,14 +55,15 @@ public class JSON {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
+ classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, ""));
+ getDiscriminatorValue(readElement, "className"));
}
})
+
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java
index f9f55a2d382..8b4f1f34d02 100644
--- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java
+++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java
@@ -55,14 +55,15 @@ public class JSON {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
+ classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, ""));
+ getDiscriminatorValue(readElement, "className"));
}
})
+
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java
index f9f55a2d382..8b4f1f34d02 100644
--- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java
+++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java
@@ -55,14 +55,15 @@ public class JSON {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
+ classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, ""));
+ getDiscriminatorValue(readElement, "className"));
}
})
+
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java
index aa818c1efa3..6819bd7fe7d 100644
--- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java
@@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java
index 8a3549a6a73..4171261093e 100644
--- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java
@@ -28,7 +28,8 @@ import javax.xml.bind.annotation.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java
index aa818c1efa3..6819bd7fe7d 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java
@@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java
index 6a2343e41be..96bdf028335 100644
--- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java
@@ -28,7 +28,8 @@ import javax.validation.Valid;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java
index 6a2343e41be..96bdf028335 100644
--- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java
@@ -28,7 +28,8 @@ import javax.validation.Valid;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java
index 911fa726945..cd8031a6b96 100644
--- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java
+++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java
@@ -52,14 +52,15 @@ public class JSON {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
+ classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, ""));
+ getDiscriminatorValue(readElement, "className"));
}
})
+
;
return fireBuilder.createGsonBuilder();
}
diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java
index 911fa726945..cd8031a6b96 100644
--- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java
+++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java
@@ -52,14 +52,15 @@ public class JSON {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
+ classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, ""));
+ getDiscriminatorValue(readElement, "className"));
}
})
+
;
return fireBuilder.createGsonBuilder();
}
diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java
index 911fa726945..cd8031a6b96 100644
--- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java
+++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java
@@ -52,14 +52,15 @@ public class JSON {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
- classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class);
+ classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class);
classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
- getDiscriminatorValue(readElement, ""));
+ getDiscriminatorValue(readElement, "className"));
}
})
+
;
return fireBuilder.createGsonBuilder();
}
diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java
index aa818c1efa3..6819bd7fe7d 100644
--- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java
@@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java
index aa818c1efa3..6819bd7fe7d 100644
--- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java
@@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md
index 40e3e1e2e76..b76d6153e89 100644
--- a/samples/client/petstore/python-asyncio/README.md
+++ b/samples/client/petstore/python-asyncio/README.md
@@ -179,3 +179,4 @@ Class | Method | HTTP request | Description
+
diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md
index 583883799e2..9b8fd577a52 100644
--- a/samples/client/petstore/python-asyncio/docs/PetApi.md
+++ b/samples/client/petstore/python-asyncio/docs/PetApi.md
@@ -430,7 +430,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
uploads an image (required)
@@ -449,12 +449,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_id = 56 # int | ID of pet to update
-file = '/path/to/file' # file | file to upload
+required_file = '/path/to/file' # file | file to upload
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
try:
# uploads an image (required)
- api_response = api_instance.upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
pprint(api_response)
except ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
@@ -465,7 +465,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update |
- **file** | **file**| file to upload |
+ **required_file** | **file**| file to upload |
**additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
diff --git a/samples/client/petstore/python-asyncio/petstore_api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/__init__.py
index ec4d33177cc..f54256a687c 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/__init__.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/__init__.py
@@ -14,6 +14,8 @@
from __future__ import absolute_import
+__version__ = "1.0.0"
+
# import apis into sdk package
from petstore_api.api.another_fake_api import AnotherFakeApi
from petstore_api.api.fake_api import FakeApi
diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py
index cccf4ed7b5e..c0a119de975 100644
--- a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py
+++ b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py
@@ -812,17 +812,17 @@ class PetApi(object):
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)
- def upload_file_with_required_file(self, pet_id, file, **kwargs): # noqa: E501
+ def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
- >>> thread = api.upload_file_with_required_file(pet_id, file, async=True)
+ >>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
>>> result = thread.get()
:param async bool
:param int pet_id: ID of pet to update (required)
- :param file file: file to upload (required)
+ :param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
:return: ApiResponse
If the method is called asynchronously,
@@ -830,22 +830,22 @@ class PetApi(object):
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
- return self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
else:
- (data) = self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
+ (data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
return data
- def upload_file_with_required_file_with_http_info(self, pet_id, file, **kwargs): # noqa: E501
+ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
- >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, file, async=True)
+ >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
>>> result = thread.get()
:param async bool
:param int pet_id: ID of pet to update (required)
- :param file file: file to upload (required)
+ :param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
:return: ApiResponse
If the method is called asynchronously,
@@ -854,7 +854,7 @@ class PetApi(object):
local_var_params = locals()
- all_params = ['pet_id', 'file', 'additional_metadata'] # noqa: E501
+ all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -872,10 +872,10 @@ class PetApi(object):
if ('pet_id' not in local_var_params or
local_var_params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
- # verify the required parameter 'file' is set
- if ('file' not in local_var_params or
- local_var_params['file'] is None):
- raise ValueError("Missing the required parameter `file` when calling `upload_file_with_required_file`") # noqa: E501
+ # verify the required parameter 'required_file' is set
+ if ('required_file' not in local_var_params or
+ local_var_params['required_file'] is None):
+ raise ValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
collection_formats = {}
@@ -891,8 +891,8 @@ class PetApi(object):
local_var_files = {}
if 'additional_metadata' in local_var_params:
form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'file' in local_var_params:
- local_var_files['file'] = local_var_params['file'] # noqa: E501
+ if 'required_file' in local_var_params:
+ local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
body_params = None
# HTTP header `Accept`
diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md
index 40e3e1e2e76..b76d6153e89 100644
--- a/samples/client/petstore/python-tornado/README.md
+++ b/samples/client/petstore/python-tornado/README.md
@@ -179,3 +179,4 @@ Class | Method | HTTP request | Description
+
diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md
index 583883799e2..9b8fd577a52 100644
--- a/samples/client/petstore/python-tornado/docs/PetApi.md
+++ b/samples/client/petstore/python-tornado/docs/PetApi.md
@@ -430,7 +430,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
uploads an image (required)
@@ -449,12 +449,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_id = 56 # int | ID of pet to update
-file = '/path/to/file' # file | file to upload
+required_file = '/path/to/file' # file | file to upload
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
try:
# uploads an image (required)
- api_response = api_instance.upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
pprint(api_response)
except ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
@@ -465,7 +465,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update |
- **file** | **file**| file to upload |
+ **required_file** | **file**| file to upload |
**additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
diff --git a/samples/client/petstore/python-tornado/petstore_api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/__init__.py
index ec4d33177cc..f54256a687c 100644
--- a/samples/client/petstore/python-tornado/petstore_api/__init__.py
+++ b/samples/client/petstore/python-tornado/petstore_api/__init__.py
@@ -14,6 +14,8 @@
from __future__ import absolute_import
+__version__ = "1.0.0"
+
# import apis into sdk package
from petstore_api.api.another_fake_api import AnotherFakeApi
from petstore_api.api.fake_api import FakeApi
diff --git a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py
index cccf4ed7b5e..c0a119de975 100644
--- a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py
+++ b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py
@@ -812,17 +812,17 @@ class PetApi(object):
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)
- def upload_file_with_required_file(self, pet_id, file, **kwargs): # noqa: E501
+ def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
- >>> thread = api.upload_file_with_required_file(pet_id, file, async=True)
+ >>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
>>> result = thread.get()
:param async bool
:param int pet_id: ID of pet to update (required)
- :param file file: file to upload (required)
+ :param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
:return: ApiResponse
If the method is called asynchronously,
@@ -830,22 +830,22 @@ class PetApi(object):
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
- return self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
else:
- (data) = self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
+ (data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
return data
- def upload_file_with_required_file_with_http_info(self, pet_id, file, **kwargs): # noqa: E501
+ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
- >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, file, async=True)
+ >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
>>> result = thread.get()
:param async bool
:param int pet_id: ID of pet to update (required)
- :param file file: file to upload (required)
+ :param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
:return: ApiResponse
If the method is called asynchronously,
@@ -854,7 +854,7 @@ class PetApi(object):
local_var_params = locals()
- all_params = ['pet_id', 'file', 'additional_metadata'] # noqa: E501
+ all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -872,10 +872,10 @@ class PetApi(object):
if ('pet_id' not in local_var_params or
local_var_params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
- # verify the required parameter 'file' is set
- if ('file' not in local_var_params or
- local_var_params['file'] is None):
- raise ValueError("Missing the required parameter `file` when calling `upload_file_with_required_file`") # noqa: E501
+ # verify the required parameter 'required_file' is set
+ if ('required_file' not in local_var_params or
+ local_var_params['required_file'] is None):
+ raise ValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
collection_formats = {}
@@ -891,8 +891,8 @@ class PetApi(object):
local_var_files = {}
if 'additional_metadata' in local_var_params:
form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'file' in local_var_params:
- local_var_files['file'] = local_var_params['file'] # noqa: E501
+ if 'required_file' in local_var_params:
+ local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
body_params = None
# HTTP header `Accept`
diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md
index 40e3e1e2e76..b76d6153e89 100644
--- a/samples/client/petstore/python/README.md
+++ b/samples/client/petstore/python/README.md
@@ -179,3 +179,4 @@ Class | Method | HTTP request | Description
+
diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md
index 583883799e2..9b8fd577a52 100644
--- a/samples/client/petstore/python/docs/PetApi.md
+++ b/samples/client/petstore/python/docs/PetApi.md
@@ -430,7 +430,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file_with_required_file**
-> ApiResponse upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
+> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
uploads an image (required)
@@ -449,12 +449,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_id = 56 # int | ID of pet to update
-file = '/path/to/file' # file | file to upload
+required_file = '/path/to/file' # file | file to upload
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
try:
# uploads an image (required)
- api_response = api_instance.upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
pprint(api_response)
except ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
@@ -465,7 +465,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet to update |
- **file** | **file**| file to upload |
+ **required_file** | **file**| file to upload |
**additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
diff --git a/samples/client/petstore/python/petstore_api/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py
index ec4d33177cc..f54256a687c 100644
--- a/samples/client/petstore/python/petstore_api/__init__.py
+++ b/samples/client/petstore/python/petstore_api/__init__.py
@@ -14,6 +14,8 @@
from __future__ import absolute_import
+__version__ = "1.0.0"
+
# import apis into sdk package
from petstore_api.api.another_fake_api import AnotherFakeApi
from petstore_api.api.fake_api import FakeApi
diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py
index cccf4ed7b5e..c0a119de975 100644
--- a/samples/client/petstore/python/petstore_api/api/pet_api.py
+++ b/samples/client/petstore/python/petstore_api/api/pet_api.py
@@ -812,17 +812,17 @@ class PetApi(object):
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)
- def upload_file_with_required_file(self, pet_id, file, **kwargs): # noqa: E501
+ def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
- >>> thread = api.upload_file_with_required_file(pet_id, file, async=True)
+ >>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
>>> result = thread.get()
:param async bool
:param int pet_id: ID of pet to update (required)
- :param file file: file to upload (required)
+ :param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
:return: ApiResponse
If the method is called asynchronously,
@@ -830,22 +830,22 @@ class PetApi(object):
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
- return self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
+ return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
else:
- (data) = self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
+ (data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
return data
- def upload_file_with_required_file_with_http_info(self, pet_id, file, **kwargs): # noqa: E501
+ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
- >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, file, async=True)
+ >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
>>> result = thread.get()
:param async bool
:param int pet_id: ID of pet to update (required)
- :param file file: file to upload (required)
+ :param file required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
:return: ApiResponse
If the method is called asynchronously,
@@ -854,7 +854,7 @@ class PetApi(object):
local_var_params = locals()
- all_params = ['pet_id', 'file', 'additional_metadata'] # noqa: E501
+ all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -872,10 +872,10 @@ class PetApi(object):
if ('pet_id' not in local_var_params or
local_var_params['pet_id'] is None):
raise ValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
- # verify the required parameter 'file' is set
- if ('file' not in local_var_params or
- local_var_params['file'] is None):
- raise ValueError("Missing the required parameter `file` when calling `upload_file_with_required_file`") # noqa: E501
+ # verify the required parameter 'required_file' is set
+ if ('required_file' not in local_var_params or
+ local_var_params['required_file'] is None):
+ raise ValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
collection_formats = {}
@@ -891,8 +891,8 @@ class PetApi(object):
local_var_files = {}
if 'additional_metadata' in local_var_params:
form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
- if 'file' in local_var_params:
- local_var_files['file'] = local_var_params['file'] # noqa: E501
+ if 'required_file' in local_var_params:
+ local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
body_params = None
# HTTP header `Accept`
diff --git a/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION b/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION
index 0628777500b..dde25ef08e8 100644
--- a/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION
+++ b/samples/server/petstore-security-test/php-slim/.openapi-generator/VERSION
@@ -1 +1 @@
-3.1.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore-security-test/php-slim/composer.json b/samples/server/petstore-security-test/php-slim/composer.json
index 5e9f23d2464..7509c8ea95a 100644
--- a/samples/server/petstore-security-test/php-slim/composer.json
+++ b/samples/server/petstore-security-test/php-slim/composer.json
@@ -1,9 +1,24 @@
{
"minimum-stability": "RC",
"require": {
+ "php": ">=5.5",
"slim/slim": "3.*"
},
+ "require-dev": {
+ "phpunit/phpunit": "^4.8"
+ },
"autoload": {
"psr-4": { "OpenAPIServer\\": "lib/" }
+ },
+ "autoload-dev": {
+ "psr-4": { "OpenAPIServer\\": "test/" }
+ },
+ "scripts": {
+ "test": [
+ "@test-apis",
+ "@test-models"
+ ],
+ "test-apis": "phpunit --testsuite Apis",
+ "test-models": "phpunit --testsuite Models"
}
}
\ No newline at end of file
diff --git a/samples/server/petstore-security-test/php-slim/lib/SlimRouter.php b/samples/server/petstore-security-test/php-slim/lib/SlimRouter.php
index 5de6efff1db..a1631e6778b 100644
--- a/samples/server/petstore-security-test/php-slim/lib/SlimRouter.php
+++ b/samples/server/petstore-security-test/php-slim/lib/SlimRouter.php
@@ -57,7 +57,7 @@ class SlimRouter {
public function __construct($container = []) {
$app = new App($container);
- $app->PUT('/fake', FakeApi::class . ':testCodeInjectEndRnNR');
+ $app->PUT('/ ' \" =end -- \\r\\n \\n \\r/v2 ' \" =end -- \\r\\n \\n \\r/fake', FakeApi::class . ':testCodeInjectEndRnNR');
$this->slimApp = $app;
}
diff --git a/samples/server/petstore-security-test/php-slim/phpunit.xml.dist b/samples/server/petstore-security-test/php-slim/phpunit.xml.dist
new file mode 100644
index 00000000000..a9fd1a3ad4f
--- /dev/null
+++ b/samples/server/petstore-security-test/php-slim/phpunit.xml.dist
@@ -0,0 +1,26 @@
+
+
+>
+
+
+ .\test\Api
+
+
+ .\test\Model
+
+
+
+
+ .\lib\Api
+ .\lib\Model
+
+
+
\ No newline at end of file
diff --git a/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php b/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php
new file mode 100644
index 00000000000..8a920bba2f3
--- /dev/null
+++ b/samples/server/petstore-security-test/php-slim/test/Api/FakeApiTest.php
@@ -0,0 +1,79 @@
+ files = null;
+
+ /**
+ **/
+ public FileSchemaTestClass file(java.io.File file) {
+ this.file = file;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("file")
+ public java.io.File getFile() {
+ return file;
+ }
+ public void setFile(java.io.File file) {
+ this.file = file;
+ }
+
+ /**
+ **/
+ public FileSchemaTestClass files(List files) {
+ this.files = files;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("files")
+ public List getFiles() {
+ return files;
+ }
+ public void setFiles(List files) {
+ this.files = files;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
+ return Objects.equals(file, fileSchemaTestClass.file) &&
+ Objects.equals(files, fileSchemaTestClass.files);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(file, files);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FileSchemaTestClass {\n");
+
+ sb.append(" file: ").append(toIndentedString(file)).append("\n");
+ sb.append(" files: ").append(toIndentedString(files)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java
index 5bc2b5bd12c..2ba14f914eb 100644
--- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java
+++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java
@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.openapitools.model.StringBooleanMap;
@@ -53,6 +54,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map mapOfEnumString = null;
+ @JsonProperty("direct_map")
+ private Map directMap = null;
+
+ @JsonProperty("indirect_map")
+ private StringBooleanMap indirectMap = null;
+
/**
**/
public MapTest mapMapOfString(Map> mapMapOfString) {
@@ -87,6 +94,40 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
+ /**
+ **/
+ public MapTest directMap(Map directMap) {
+ this.directMap = directMap;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("direct_map")
+ public Map getDirectMap() {
+ return directMap;
+ }
+ public void setDirectMap(Map directMap) {
+ this.directMap = directMap;
+ }
+
+ /**
+ **/
+ public MapTest indirectMap(StringBooleanMap indirectMap) {
+ this.indirectMap = indirectMap;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("indirect_map")
+ public StringBooleanMap getIndirectMap() {
+ return indirectMap;
+ }
+ public void setIndirectMap(StringBooleanMap indirectMap) {
+ this.indirectMap = indirectMap;
+ }
+
@Override
public boolean equals(java.lang.Object o) {
@@ -98,12 +139,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(mapMapOfString, mapTest.mapMapOfString) &&
- Objects.equals(mapOfEnumString, mapTest.mapOfEnumString);
+ Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) &&
+ Objects.equals(directMap, mapTest.directMap) &&
+ Objects.equals(indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
- return Objects.hash(mapMapOfString, mapOfEnumString);
+ return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@Override
@@ -113,6 +156,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
+ sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
+ sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}
diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java
index 30891296b80..632b6f6e4ed 100644
--- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java
+++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java
@@ -161,7 +161,7 @@ public class Order {
@ApiModelProperty(value = "")
@JsonProperty("complete")
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
public void setComplete(Boolean complete) {
diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/StringBooleanMap.java
new file mode 100644
index 00000000000..b1d676bbff2
--- /dev/null
+++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/StringBooleanMap.java
@@ -0,0 +1,51 @@
+package org.openapitools.model;
+
+import java.util.Objects;
+import java.util.HashMap;
+import java.util.Map;
+
+
+
+
+
+
+public class StringBooleanMap extends HashMap {
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ StringBooleanMap stringBooleanMap = (StringBooleanMap) o;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class StringBooleanMap {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java
index 7b8a05cce6e..e069a8c9751 100644
--- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java
+++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java
@@ -14,7 +14,9 @@ import java.math.BigDecimal;
import org.openapitools.model.Client;
import java.util.Date;
import java.io.File;
+import org.openapitools.model.FileSchemaTestClass;
import java.util.Map;
+import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.OuterComposite;
import org.openapitools.model.User;
@@ -50,6 +52,12 @@ public class FakeController {
}
*/
+ /*
+ public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass fileSchemaTestClass) {
+ return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
+ }
+ */
+
/*
public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User user) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
@@ -86,5 +94,11 @@ public class FakeController {
}
*/
+ /*
+ public ResponseContext uploadFileWithRequiredFile(RequestContext request , Long petId, FormDataContentDisposition fileDetail, String additionalMetadata) {
+ return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
+ }
+ */
+
}
diff --git a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml
index 819110c3f90..ae9b35de6a8 100644
--- a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml
+++ b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml
@@ -1026,6 +1026,66 @@ paths:
- $another-fake?
x-contentType: application/json
x-accepts: application/json
+ /fake/body-with-file-schema:
+ put:
+ description: For this test, the body for this request much reference a schema named `File`.
+ operationId: testBodyWithFileSchema
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FileSchemaTestClass'
+ required: true
+ responses:
+ 200:
+ content: {}
+ description: Success
+ tags:
+ - fake
+ x-contentType: application/json
+ x-accepts: application/json
+ /fake/{petId}/uploadImageWithRequiredFile:
+ post:
+ operationId: uploadFileWithRequiredFile
+ parameters:
+ - description: ID of pet to update
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ format: binary
+ type: string
+ required:
+ - file
+ required: true
+ responses:
+ 200:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ description: successful operation
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: uploads an image (required)
+ tags:
+ - pet
+ x-contentType: multipart/form-data
+ x-accepts: application/json
components:
schemas:
Category:
@@ -1331,14 +1391,18 @@ components:
type: array
type: object
OuterComposite:
- example: {}
+ example:
+ my_string: my_string
+ my_number: 0.80082819046101150206595775671303272247314453125
+ my_boolean: true
properties:
my_number:
- $ref: '#/components/schemas/OuterNumber'
+ type: number
my_string:
- $ref: '#/components/schemas/OuterString'
+ type: string
my_boolean:
- $ref: '#/components/schemas/OuterBoolean'
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
type: object
format_test:
properties:
@@ -1424,6 +1488,21 @@ components:
OuterBoolean:
type: boolean
x-codegen-body-parameter-name: boolean_post_body
+ FileSchemaTestClass:
+ example:
+ file:
+ sourceURI: sourceURI
+ files:
+ - sourceURI: sourceURI
+ - sourceURI: sourceURI
+ properties:
+ file:
+ $ref: '#/components/schemas/File'
+ files:
+ items:
+ $ref: '#/components/schemas/File'
+ type: array
+ type: object
Animal:
discriminator:
propertyName: className
@@ -1436,6 +1515,10 @@ components:
required:
- className
type: object
+ StringBooleanMap:
+ additionalProperties:
+ type: boolean
+ type: object
Cat:
allOf:
- $ref: '#/components/schemas/Animal'
@@ -1458,6 +1541,12 @@ components:
- lower
type: string
type: object
+ direct_map:
+ additionalProperties:
+ type: boolean
+ type: object
+ indirect_map:
+ $ref: '#/components/schemas/StringBooleanMap'
type: object
Tag:
example:
@@ -1476,6 +1565,14 @@ components:
items:
$ref: '#/components/schemas/Animal'
type: array
+ File:
+ example:
+ sourceURI: sourceURI
+ properties:
+ sourceURI:
+ description: Test capitalization
+ type: string
+ type: object
Pet:
example:
photoUrls:
diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-async/public/openapi.json b/samples/server/petstore/java-play-framework-async/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-async/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-async/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java
index a87f399d687..5e8dfb06c05 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java
@@ -24,7 +24,7 @@ public class Cat extends Animal {
* Get declawed
* @return declawed
**/
- public Boolean isDeclawed() {
+ public Boolean getDeclawed() {
return declawed;
}
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java
index a82c9ee422d..5f2c63d116d 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java
@@ -77,7 +77,7 @@ public class EnumArrays {
return null;
}
}
-
+
@JsonProperty("array_enum")
private List arrayEnum = null;
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java
new file mode 100644
index 00000000000..d01ed397a32
--- /dev/null
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java
@@ -0,0 +1,108 @@
+package apimodels;
+
+import java.util.ArrayList;
+import java.util.List;
+import com.fasterxml.jackson.annotation.*;
+import java.util.Set;
+import javax.validation.*;
+import java.util.Objects;
+import javax.validation.constraints.*;
+/**
+ * FileSchemaTestClass
+ */
+
+@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
+public class FileSchemaTestClass {
+ @JsonProperty("file")
+ private java.io.File file = null;
+
+ @JsonProperty("files")
+ private List files = null;
+
+ public FileSchemaTestClass file(java.io.File file) {
+ this.file = file;
+ return this;
+ }
+
+ /**
+ * Get file
+ * @return file
+ **/
+ @Valid
+ public java.io.File getFile() {
+ return file;
+ }
+
+ public void setFile(java.io.File file) {
+ this.file = file;
+ }
+
+ public FileSchemaTestClass files(List files) {
+ this.files = files;
+ return this;
+ }
+
+ public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
+ if (files == null) {
+ files = new ArrayList<>();
+ }
+ files.add(filesItem);
+ return this;
+ }
+
+ /**
+ * Get files
+ * @return files
+ **/
+ @Valid
+ public List getFiles() {
+ return files;
+ }
+
+ public void setFiles(List files) {
+ this.files = files;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
+ return Objects.equals(file, fileSchemaTestClass.file) &&
+ Objects.equals(files, fileSchemaTestClass.files);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(file, files);
+ }
+
+ @SuppressWarnings("StringBufferReplaceableByString")
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FileSchemaTestClass {\n");
+
+ sb.append(" file: ").append(toIndentedString(file)).append("\n");
+ sb.append(" files: ").append(toIndentedString(files)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java
index 7cd05af295f..5c1518d4cd3 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java
@@ -1,5 +1,6 @@
package apimodels;
+import apimodels.StringBooleanMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -47,10 +48,16 @@ public class MapTest {
return null;
}
}
-
+
@JsonProperty("map_of_enum_string")
private Map mapOfEnumString = null;
+ @JsonProperty("direct_map")
+ private Map directMap = null;
+
+ @JsonProperty("indirect_map")
+ private StringBooleanMap indirectMap = null;
+
public MapTest mapMapOfString(Map> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@@ -102,6 +109,49 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
+ public MapTest directMap(Map directMap) {
+ this.directMap = directMap;
+ return this;
+ }
+
+ public MapTest putDirectMapItem(String key, Boolean directMapItem) {
+ if (this.directMap == null) {
+ this.directMap = new HashMap<>();
+ }
+ this.directMap.put(key, directMapItem);
+ return this;
+ }
+
+ /**
+ * Get directMap
+ * @return directMap
+ **/
+ public Map getDirectMap() {
+ return directMap;
+ }
+
+ public void setDirectMap(Map directMap) {
+ this.directMap = directMap;
+ }
+
+ public MapTest indirectMap(StringBooleanMap indirectMap) {
+ this.indirectMap = indirectMap;
+ return this;
+ }
+
+ /**
+ * Get indirectMap
+ * @return indirectMap
+ **/
+ @Valid
+ public StringBooleanMap getIndirectMap() {
+ return indirectMap;
+ }
+
+ public void setIndirectMap(StringBooleanMap indirectMap) {
+ this.indirectMap = indirectMap;
+ }
+
@Override
public boolean equals(java.lang.Object o) {
@@ -113,12 +163,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(mapMapOfString, mapTest.mapMapOfString) &&
- Objects.equals(mapOfEnumString, mapTest.mapOfEnumString);
+ Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) &&
+ Objects.equals(directMap, mapTest.directMap) &&
+ Objects.equals(indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
- return Objects.hash(mapMapOfString, mapOfEnumString);
+ return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@SuppressWarnings("StringBufferReplaceableByString")
@@ -129,6 +181,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
+ sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
+ sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java
index 50990892750..404beae15bc 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/StringBooleanMap.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/StringBooleanMap.java
new file mode 100644
index 00000000000..94aabc84356
--- /dev/null
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/StringBooleanMap.java
@@ -0,0 +1,54 @@
+package apimodels;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.*;
+import java.util.Set;
+import javax.validation.*;
+import java.util.Objects;
+import javax.validation.constraints.*;
+/**
+ * StringBooleanMap
+ */
+
+@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
+public class StringBooleanMap extends HashMap {
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode());
+ }
+
+ @SuppressWarnings("StringBufferReplaceableByString")
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class StringBooleanMap {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java
index 6a20f9c52a3..fb501df6b6f 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java
@@ -2,6 +2,7 @@ package controllers;
import java.math.BigDecimal;
import apimodels.Client;
+import apimodels.FileSchemaTestClass;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.Map;
@@ -116,6 +117,22 @@ public class FakeApiController extends Controller {
return ok(result);
}
+ @ApiAction
+ public Result testBodyWithFileSchema() throws Exception {
+ JsonNode nodefileSchemaTestClass = request().body().asJson();
+ FileSchemaTestClass fileSchemaTestClass;
+ if (nodefileSchemaTestClass != null) {
+ fileSchemaTestClass = mapper.readValue(nodefileSchemaTestClass.toString(), FileSchemaTestClass.class);
+ if (configuration.getBoolean("useInputBeanValidation")) {
+ OpenAPIUtils.validate(fileSchemaTestClass);
+ }
+ } else {
+ throw new IllegalArgumentException("'FileSchemaTestClass' parameter is required");
+ }
+ imp.testBodyWithFileSchema(fileSchemaTestClass);
+ return ok();
+ }
+
@ApiAction
public Result testBodyWithQueryParams() throws Exception {
JsonNode nodeuser = request().body().asJson();
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java
index cd25ea9238e..a3316211927 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java
@@ -2,6 +2,7 @@ package controllers;
import java.math.BigDecimal;
import apimodels.Client;
+import apimodels.FileSchemaTestClass;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.Map;
@@ -41,6 +42,11 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface {
return new String();
}
+ @Override
+ public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception {
+ //Do your magic!!!
+ }
+
@Override
public void testBodyWithQueryParams( @NotNull String query, User user) throws Exception {
//Do your magic!!!
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java
index 0ab57c66a42..e36e7c50120 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java
@@ -2,6 +2,7 @@ package controllers;
import java.math.BigDecimal;
import apimodels.Client;
+import apimodels.FileSchemaTestClass;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.Map;
@@ -26,6 +27,8 @@ public interface FakeApiControllerImpInterface {
String fakeOuterStringSerialize(String body) throws Exception;
+ void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception;
+
void testBodyWithQueryParams( @NotNull String query, User user) throws Exception;
Client testClientModel(Client client) throws Exception;
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java
index 8dff1940237..4b5720896ee 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java
@@ -177,4 +177,25 @@ public class PetApiController extends Controller {
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
+
+ @ApiAction
+ public Result uploadFileWithRequiredFile(Long petId) throws Exception {
+ String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
+ String additionalMetadata;
+ if (valueadditionalMetadata != null) {
+ additionalMetadata = valueadditionalMetadata;
+ } else {
+ additionalMetadata = "null";
+ }
+ Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
+ if ((file == null || ((File) file.getFile()).length() == 0)) {
+ throw new IllegalArgumentException("'file' file cannot be empty");
+ }
+ ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, file, additionalMetadata);
+ if (configuration.getBoolean("useOutputBeanValidation")) {
+ OpenAPIUtils.validate(obj);
+ }
+ JsonNode result = mapper.valueToTree(obj);
+ return ok(result);
+ }
}
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java
index 2cd201c4bc3..85e0c60ef6c 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java
@@ -56,4 +56,10 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
return new ModelApiResponse();
}
+ @Override
+ public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception {
+ //Do your magic!!!
+ return new ModelApiResponse();
+ }
+
}
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java
index 96163267580..1a87f77ac02 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java
@@ -29,4 +29,6 @@ public interface PetApiControllerImpInterface {
ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception;
+ ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception;
+
}
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes
index de7b52199cb..08762f3f8eb 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes
@@ -13,6 +13,7 @@ POST /v2/fake/outer/boolean controllers.FakeApiControlle
POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize()
POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize()
POST /v2/fake/outer/string controllers.FakeApiController.fakeOuterStringSerialize()
+PUT /v2/fake/body-with-file-schema controllers.FakeApiController.testBodyWithFileSchema()
PUT /v2/fake/body-with-query-params controllers.FakeApiController.testBodyWithQueryParams()
PATCH /v2/fake controllers.FakeApiController.testClientModel()
POST /v2/fake controllers.FakeApiController.testEndpointParameters()
@@ -32,6 +33,7 @@ GET /v2/pet/:petId controllers.PetApiController.getPetBy
PUT /v2/pet controllers.PetApiController.updatePet()
POST /v2/pet/:petId controllers.PetApiController.updatePetWithForm(petId: Long)
POST /v2/pet/:petId/uploadImage controllers.PetApiController.uploadFile(petId: Long)
+POST /v2/fake/:petId/uploadImageWithRequiredFile controllers.PetApiController.uploadFileWithRequiredFile(petId: Long)
#Functions for Store API
DELETE /v2/store/order/:orderId controllers.StoreApiController.deleteOrder(orderId: String)
diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json
index 1fb6f6037eb..6a55a7238e0 100644
--- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
@@ -833,12 +835,14 @@
"name" : "enum_header_string_array",
"in" : "header",
"description" : "Header parameter enum test (string array)",
+ "style" : "simple",
+ "explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "$",
- "enum" : [ ">", "$" ]
+ "enum" : [ ">", "$" ],
+ "default" : "$"
}
}
}, {
@@ -847,20 +851,21 @@
"description" : "Header parameter enum test (string)",
"schema" : {
"type" : "string",
- "default" : "-efg",
- "enum" : [ "_abc", "-efg", "(xyz)" ]
+ "enum" : [ "_abc", "-efg", "(xyz)" ],
+ "default" : "-efg"
}
}, {
"name" : "enum_query_string_array",
"in" : "query",
"description" : "Query parameter enum test (string array)",
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "$",
- "enum" : [ ">", "$" ]
+ "enum" : [ ">", "$" ],
+ "default" : "$"
}
}
}, {
@@ -869,8 +874,8 @@
"description" : "Query parameter enum test (string)",
"schema" : {
"type" : "string",
- "default" : "-efg",
- "enum" : [ "_abc", "-efg", "(xyz)" ]
+ "enum" : [ "_abc", "-efg", "(xyz)" ],
+ "default" : "-efg"
}
}, {
"name" : "enum_query_integer",
@@ -901,15 +906,15 @@
"description" : "Form parameter enum test (string array)",
"items" : {
"type" : "string",
- "default" : "$",
- "enum" : [ ">", "$" ]
+ "enum" : [ ">", "$" ],
+ "default" : "$"
}
},
"enum_form_string" : {
"type" : "string",
"description" : "Form parameter enum test (string)",
- "default" : "-efg",
- "enum" : [ "_abc", "-efg", "(xyz)" ]
+ "enum" : [ "_abc", "-efg", "(xyz)" ],
+ "default" : "-efg"
}
}
}
@@ -1328,6 +1333,86 @@
"x-contentType" : "application/json",
"x-accepts" : "application/json"
}
+ },
+ "/fake/body-with-file-schema" : {
+ "put" : {
+ "tags" : [ "fake" ],
+ "description" : "For this test, the body for this request much reference a schema named `File`.",
+ "operationId" : "testBodyWithFileSchema",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/FileSchemaTestClass"
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "200" : {
+ "description" : "Success",
+ "content" : { }
+ }
+ },
+ "x-contentType" : "application/json",
+ "x-accepts" : "application/json"
+ }
+ },
+ "/fake/{petId}/uploadImageWithRequiredFile" : {
+ "post" : {
+ "tags" : [ "pet" ],
+ "summary" : "uploads an image (required)",
+ "operationId" : "uploadFileWithRequiredFile",
+ "parameters" : [ {
+ "name" : "petId",
+ "in" : "path",
+ "description" : "ID of pet to update",
+ "required" : true,
+ "schema" : {
+ "type" : "integer",
+ "format" : "int64"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "multipart/form-data" : {
+ "schema" : {
+ "required" : [ "file" ],
+ "properties" : {
+ "additionalMetadata" : {
+ "type" : "string",
+ "description" : "Additional data to pass to server"
+ },
+ "file" : {
+ "type" : "string",
+ "description" : "file to upload",
+ "format" : "binary"
+ }
+ }
+ }
+ }
+ },
+ "required" : true
+ },
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/ApiResponse"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "petstore_auth" : [ "write:pets", "read:pets" ]
+ } ],
+ "x-contentType" : "multipart/form-data",
+ "x-accepts" : "application/json"
+ }
}
},
"components" : {
@@ -1502,8 +1587,8 @@
},
"EnumClass" : {
"type" : "string",
- "default" : "-efg",
- "enum" : [ "_abc", "-efg", "(xyz)" ]
+ "enum" : [ "_abc", "-efg", "(xyz)" ],
+ "default" : "-efg"
},
"List" : {
"type" : "object",
@@ -1740,16 +1825,21 @@
"type" : "object",
"properties" : {
"my_number" : {
- "$ref" : "#/components/schemas/OuterNumber"
+ "type" : "number"
},
"my_string" : {
- "$ref" : "#/components/schemas/OuterString"
+ "type" : "string"
},
"my_boolean" : {
- "$ref" : "#/components/schemas/OuterBoolean"
+ "type" : "boolean",
+ "x-codegen-body-parameter-name" : "boolean_post_body"
}
},
- "example" : { }
+ "example" : {
+ "my_string" : "my_string",
+ "my_number" : 0.80082819046101150206595775671303272247314453125,
+ "my_boolean" : true
+ }
},
"format_test" : {
"required" : [ "byte", "date", "number", "password" ],
@@ -1852,6 +1942,30 @@
"type" : "boolean",
"x-codegen-body-parameter-name" : "boolean_post_body"
},
+ "FileSchemaTestClass" : {
+ "type" : "object",
+ "properties" : {
+ "file" : {
+ "$ref" : "#/components/schemas/File"
+ },
+ "files" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/File"
+ }
+ }
+ },
+ "example" : {
+ "file" : {
+ "sourceURI" : "sourceURI"
+ },
+ "files" : [ {
+ "sourceURI" : "sourceURI"
+ }, {
+ "sourceURI" : "sourceURI"
+ } ]
+ }
+ },
"Animal" : {
"required" : [ "className" ],
"type" : "object",
@@ -1868,6 +1982,12 @@
"propertyName" : "className"
}
},
+ "StringBooleanMap" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "boolean"
+ }
+ },
"Cat" : {
"allOf" : [ {
"$ref" : "#/components/schemas/Animal"
@@ -1898,6 +2018,15 @@
"type" : "string",
"enum" : [ "UPPER", "lower" ]
}
+ },
+ "direct_map" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "boolean"
+ }
+ },
+ "indirect_map" : {
+ "$ref" : "#/components/schemas/StringBooleanMap"
}
}
},
@@ -1926,6 +2055,18 @@
"$ref" : "#/components/schemas/Animal"
}
},
+ "File" : {
+ "type" : "object",
+ "properties" : {
+ "sourceURI" : {
+ "type" : "string",
+ "description" : "Test capitalization"
+ }
+ },
+ "example" : {
+ "sourceURI" : "sourceURI"
+ }
+ },
"Pet" : {
"required" : [ "name", "photoUrls" ],
"type" : "object",
diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java
index 2290a967e4b..a142a597426 100644
--- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java
@@ -156,7 +156,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json
+++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION
index 096bf47efe3..dde25ef08e8 100644
--- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION
+++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION
@@ -1 +1 @@
-3.0.0-SNAPSHOT
\ No newline at end of file
+3.1.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java
index cdc21f722c9..d1aaa38d002 100644
--- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java
+++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java
@@ -158,7 +158,7 @@ public class Order {
* Get complete
* @return complete
**/
- public Boolean isComplete() {
+ public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/java-play-framework/public/openapi.json b/samples/server/petstore/java-play-framework/public/openapi.json
index d72aeb9f185..ac1d4504782 100644
--- a/samples/server/petstore/java-play-framework/public/openapi.json
+++ b/samples/server/petstore/java-play-framework/public/openapi.json
@@ -108,13 +108,14 @@
"in" : "query",
"description" : "Status values that need to be considered for filter",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
- "default" : "available",
- "enum" : [ "available", "pending", "sold" ]
+ "enum" : [ "available", "pending", "sold" ],
+ "default" : "available"
}
}
} ],
@@ -162,6 +163,7 @@
"in" : "query",
"description" : "Tags to filter by",
"required" : true,
+ "style" : "form",
"explode" : false,
"schema" : {
"type" : "array",
diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php
index fbdacd63764..b1fa33f8ddd 100644
--- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php
+++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php
@@ -53,7 +53,7 @@ class FakeApi extends Controller
/**
* Operation testEndpointParameters
*
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
*
*
* @return Http response
diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php
index 870a8e10861..07e62522089 100644
--- a/samples/server/petstore/php-lumen/lib/routes/web.php
+++ b/samples/server/petstore/php-lumen/lib/routes/web.php
@@ -35,8 +35,8 @@ $router->patch('/v2/another-fake/dummy', 'AnotherFakeApi@testSpecialTags');
$router->patch('/v2/fake', 'FakeApi@testClientModel');
/**
* post testEndpointParameters
- * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*/
$router->post('/v2/fake', 'FakeApi@testEndpointParameters');
/**
diff --git a/samples/server/petstore/php-slim/composer.json b/samples/server/petstore/php-slim/composer.json
index 5e9f23d2464..7509c8ea95a 100644
--- a/samples/server/petstore/php-slim/composer.json
+++ b/samples/server/petstore/php-slim/composer.json
@@ -1,9 +1,24 @@
{
"minimum-stability": "RC",
"require": {
+ "php": ">=5.5",
"slim/slim": "3.*"
},
+ "require-dev": {
+ "phpunit/phpunit": "^4.8"
+ },
"autoload": {
"psr-4": { "OpenAPIServer\\": "lib/" }
+ },
+ "autoload-dev": {
+ "psr-4": { "OpenAPIServer\\": "test/" }
+ },
+ "scripts": {
+ "test": [
+ "@test-apis",
+ "@test-models"
+ ],
+ "test-apis": "phpunit --testsuite Apis",
+ "test-models": "phpunit --testsuite Models"
}
}
\ No newline at end of file
diff --git a/samples/server/petstore/php-slim/composer.lock b/samples/server/petstore/php-slim/composer.lock
index c31fb841c9b..24e93daec4d 100644
--- a/samples/server/petstore/php-slim/composer.lock
+++ b/samples/server/petstore/php-slim/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "913417690829da41975a473b88f30f64",
+ "content-hash": "dd09324f4c42e91ef9a7865e277effe6",
"packages": [
{
"name": "container-interop/container-interop",
@@ -304,12 +304,1196 @@
"time": "2018-04-19T19:29:08+00:00"
}
],
- "packages-dev": [],
+ "packages-dev": [
+ {
+ "name": "doctrine/instantiator",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "athletic/athletic": "~0.1.8",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpunit/phpunit": "^6.2.3",
+ "squizlabs/php_codesniffer": "^3.0.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2017-07-22T11:58:36+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-common",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+ "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "homepage": "http://www.phpdoc.org",
+ "keywords": [
+ "FQSEN",
+ "phpDocumentor",
+ "phpdoc",
+ "reflection",
+ "static analysis"
+ ],
+ "time": "2017-09-11T18:02:19+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-docblock",
+ "version": "4.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0",
+ "phpdocumentor/reflection-common": "^1.0.0",
+ "phpdocumentor/type-resolver": "^0.4.0",
+ "webmozart/assert": "^1.0"
+ },
+ "require-dev": {
+ "doctrine/instantiator": "~1.0.5",
+ "mockery/mockery": "^1.0",
+ "phpunit/phpunit": "^6.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+ "time": "2017-11-30T07:14:17+00:00"
+ },
+ {
+ "name": "phpdocumentor/type-resolver",
+ "version": "0.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
+ "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7.0",
+ "phpdocumentor/reflection-common": "^1.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "^5.2||^4.8.24"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "time": "2017-07-14T14:27:02+00:00"
+ },
+ {
+ "name": "phpspec/prophecy",
+ "version": "1.7.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpspec/prophecy.git",
+ "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+ "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": "^5.3|^7.0",
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
+ "sebastian/comparator": "^1.1|^2.0|^3.0",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ },
+ "require-dev": {
+ "phpspec/phpspec": "^2.5|^3.2",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.7.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "homepage": "https://github.com/phpspec/prophecy",
+ "keywords": [
+ "Double",
+ "Dummy",
+ "fake",
+ "mock",
+ "spy",
+ "stub"
+ ],
+ "time": "2018-04-18T13:57:24+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "2.2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-file-iterator": "~1.3",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-token-stream": "~1.3",
+ "sebastian/environment": "^1.3.2",
+ "sebastian/version": "~1.0"
+ },
+ "require-dev": {
+ "ext-xdebug": ">=2.1.4",
+ "phpunit/phpunit": "~4"
+ },
+ "suggest": {
+ "ext-dom": "*",
+ "ext-xdebug": ">=2.2.1",
+ "ext-xmlwriter": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2015-10-06T15:47:00+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.4.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2017-11-27T13:52:08+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2015-06-21T13:50:34+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2017-02-26T11:10:40+00:00"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "1.4.12",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2017-12-04T08:55:13+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "4.8.36",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
+ "reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=5.3.3",
+ "phpspec/prophecy": "^1.3.1",
+ "phpunit/php-code-coverage": "~2.1",
+ "phpunit/php-file-iterator": "~1.4",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-timer": "^1.0.6",
+ "phpunit/phpunit-mock-objects": "~2.3",
+ "sebastian/comparator": "~1.2.2",
+ "sebastian/diff": "~1.2",
+ "sebastian/environment": "~1.3",
+ "sebastian/exporter": "~1.2",
+ "sebastian/global-state": "~1.0",
+ "sebastian/version": "~1.0",
+ "symfony/yaml": "~2.1|~3.0"
+ },
+ "suggest": {
+ "phpunit/php-invoker": "~1.1"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.8.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "time": "2017-06-21T08:07:12+00:00"
+ },
+ {
+ "name": "phpunit/phpunit-mock-objects",
+ "version": "2.3.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
+ "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": ">=5.3.3",
+ "phpunit/php-text-template": "~1.2",
+ "sebastian/exporter": "~1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Mock Object library for PHPUnit",
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "keywords": [
+ "mock",
+ "xunit"
+ ],
+ "time": "2015-10-02T06:51:40+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "1.2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/diff": "~1.2",
+ "sebastian/exporter": "~1.2 || ~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "time": "2017-01-29T09:50:25+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "1.4.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff"
+ ],
+ "time": "2017-05-22T07:24:03+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "1.3.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
+ "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8 || ^5.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "time": "2016-08-18T05:49:44+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "1.2.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/recursion-context": "~1.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "time": "2016-06-17T09:04:28+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "time": "2015-10-12T03:26:01+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "time": "2016-10-03T07:41:43+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "1.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+ "shasum": ""
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2015-06-21T13:59:46+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.8.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+ "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ },
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "time": "2018-04-30T19:57:29+00:00"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v3.4.12",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0",
+ "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/console": "<3.4"
+ },
+ "require-dev": {
+ "symfony/console": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/console": "For validating YAML files using the lint command"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-05-03T23:18:14+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozart/assert.git",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6",
+ "sebastian/version": "^1.0.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "time": "2018-01-29T19:49:41+00:00"
+ }
+ ],
"aliases": [],
"minimum-stability": "RC",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
- "platform": [],
+ "platform": {
+ "php": ">=5.5"
+ },
"platform-dev": []
}
diff --git a/samples/server/petstore/php-slim/lib/Api/FakeApi.php b/samples/server/petstore/php-slim/lib/Api/FakeApi.php
index 8baa4619a76..2f8fee13498 100644
--- a/samples/server/petstore/php-slim/lib/Api/FakeApi.php
+++ b/samples/server/petstore/php-slim/lib/Api/FakeApi.php
@@ -103,6 +103,21 @@ class FakeApi extends AbstractApiController {
return $response;
}
+ /**
+ * PUT testBodyWithFileSchema
+ * Summary:
+ * Notes: For this test, the body for this request much reference a schema named `File`.
+ *
+ * @param \Psr\Http\Message\ServerRequestInterface $request Request
+ * @param \Psr\Http\Message\ResponseInterface $response Response
+ * @param array|null $args Path arguments
+ */
+ public function testBodyWithFileSchema($request, $response, $args) {
+ $body = $request->getParsedBody();
+ $response->write('How about implementing testBodyWithFileSchema as a PUT method ?');
+ return $response;
+ }
+
/**
* PUT testBodyWithQueryParams
* Summary:
@@ -138,8 +153,8 @@ class FakeApi extends AbstractApiController {
/**
* POST testEndpointParameters
- * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* @param \Psr\Http\Message\ServerRequestInterface $request Request
* @param \Psr\Http\Message\ResponseInterface $response Response
diff --git a/samples/server/petstore/php-slim/lib/Api/PetApi.php b/samples/server/petstore/php-slim/lib/Api/PetApi.php
index 666b0e5ab9a..7534dd9e48c 100644
--- a/samples/server/petstore/php-slim/lib/Api/PetApi.php
+++ b/samples/server/petstore/php-slim/lib/Api/PetApi.php
@@ -184,7 +184,7 @@ class PetApi extends AbstractApiController {
public function uploadFileWithRequiredFile($request, $response, $args) {
$petId = $args['petId'];
$additionalMetadata = $request->getParsedBodyParam('additionalMetadata');
- $file = (key_exists('file', $request->getUploadedFiles())) ? $request->getUploadedFiles()['file'] : null;
+ $requiredFile = (key_exists('requiredFile', $request->getUploadedFiles())) ? $request->getUploadedFiles()['requiredFile'] : null;
$response->write('How about implementing uploadFileWithRequiredFile as a POST method ?');
return $response;
}
diff --git a/samples/server/petstore/php-slim/lib/Model/Capitalization.php b/samples/server/petstore/php-slim/lib/Model/Capitalization.php
index c85a6506cc9..8ea348becef 100644
--- a/samples/server/petstore/php-slim/lib/Model/Capitalization.php
+++ b/samples/server/petstore/php-slim/lib/Model/Capitalization.php
@@ -24,7 +24,7 @@ class Capitalization {
/** @var string $sCAETHFlowPoints */
private $sCAETHFlowPoints;
- /** @var string $aTTNAME Name of the pet */
+ /** @var string $aTTNAME Name of the pet*/
private $aTTNAME;
}
diff --git a/samples/server/petstore/php-slim/lib/Model/File.php b/samples/server/petstore/php-slim/lib/Model/File.php
new file mode 100644
index 00000000000..8ad71447f84
--- /dev/null
+++ b/samples/server/petstore/php-slim/lib/Model/File.php
@@ -0,0 +1,15 @@
+POST('/v2/fake/outer/composite', FakeApi::class . ':fakeOuterCompositeSerialize');
$app->POST('/v2/fake/outer/number', FakeApi::class . ':fakeOuterNumberSerialize');
$app->POST('/v2/fake/outer/string', FakeApi::class . ':fakeOuterStringSerialize');
+ $app->PUT('/v2/fake/body-with-file-schema', FakeApi::class . ':testBodyWithFileSchema');
$app->PUT('/v2/fake/body-with-query-params', FakeApi::class . ':testBodyWithQueryParams');
$app->PATCH('/v2/fake', FakeApi::class . ':testClientModel');
$app->POST('/v2/fake', FakeApi::class . ':testEndpointParameters');
diff --git a/samples/server/petstore/php-slim/phpunit.xml.dist b/samples/server/petstore/php-slim/phpunit.xml.dist
new file mode 100644
index 00000000000..4a44f5ac146
--- /dev/null
+++ b/samples/server/petstore/php-slim/phpunit.xml.dist
@@ -0,0 +1,26 @@
+
+
+>
+
+
+ ./test/Api
+
+
+ ./test/Model
+
+
+
+
+ ./lib/Api
+ ./lib/Model
+
+
+
\ No newline at end of file
diff --git a/samples/server/petstore/php-slim/test/Api/AnotherFakeApiTest.php b/samples/server/petstore/php-slim/test/Api/AnotherFakeApiTest.php
new file mode 100644
index 00000000000..06cd6fe39c2
--- /dev/null
+++ b/samples/server/petstore/php-slim/test/Api/AnotherFakeApiTest.php
@@ -0,0 +1,78 @@
+ "/Pet",
"summary" => "Add a new pet to the store",
"nickname" => "add_pet",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/pet",
"notes" => "",
"parameters" => [
@@ -27,20 +27,20 @@ MyApp.add_route('DELETE', '/v2/pet/{petId}', {
"resourcePath" => "/Pet",
"summary" => "Deletes a pet",
"nickname" => "delete_pet",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/pet/{petId}",
"notes" => "",
"parameters" => [
{
"name" => "pet_id",
"description" => "Pet id to delete",
- "dataType" => "int",
+ "dataType" => "Integer",
"paramType" => "path",
},
{
"name" => "api_key",
"description" => "",
- "dataType" => "string",
+ "dataType" => "String",
"paramType" => "header",
},
]}) do
@@ -55,14 +55,14 @@ MyApp.add_route('GET', '/v2/pet/findByStatus', {
"resourcePath" => "/Pet",
"summary" => "Finds Pets by status",
"nickname" => "find_pets_by_status",
- "responseClass" => "array[Pet]",
+ "responseClass" => "Array",
"endpoint" => "/pet/findByStatus",
"notes" => "Multiple status values can be provided with comma separated strings",
"parameters" => [
{
"name" => "status",
"description" => "Status values that need to be considered for filter",
- "dataType" => "array[string]",
+ "dataType" => "Array",
"collectionFormat" => "csv",
"paramType" => "query",
},
@@ -78,14 +78,14 @@ MyApp.add_route('GET', '/v2/pet/findByTags', {
"resourcePath" => "/Pet",
"summary" => "Finds Pets by tags",
"nickname" => "find_pets_by_tags",
- "responseClass" => "array[Pet]",
+ "responseClass" => "Array",
"endpoint" => "/pet/findByTags",
"notes" => "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"parameters" => [
{
"name" => "tags",
"description" => "Tags to filter by",
- "dataType" => "array[string]",
+ "dataType" => "Array",
"collectionFormat" => "csv",
"paramType" => "query",
},
@@ -101,14 +101,14 @@ MyApp.add_route('GET', '/v2/pet/{petId}', {
"resourcePath" => "/Pet",
"summary" => "Find pet by ID",
"nickname" => "get_pet_by_id",
- "responseClass" => "Pet",
+ "responseClass" => "Pet",
"endpoint" => "/pet/{petId}",
"notes" => "Returns a single pet",
"parameters" => [
{
"name" => "pet_id",
"description" => "ID of pet to return",
- "dataType" => "int",
+ "dataType" => "Integer",
"paramType" => "path",
},
]}) do
@@ -123,7 +123,7 @@ MyApp.add_route('PUT', '/v2/pet', {
"resourcePath" => "/Pet",
"summary" => "Update an existing pet",
"nickname" => "update_pet",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/pet",
"notes" => "",
"parameters" => [
@@ -145,14 +145,14 @@ MyApp.add_route('POST', '/v2/pet/{petId}', {
"resourcePath" => "/Pet",
"summary" => "Updates a pet in the store with form data",
"nickname" => "update_pet_with_form",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/pet/{petId}",
"notes" => "",
"parameters" => [
{
"name" => "pet_id",
"description" => "ID of pet that needs to be updated",
- "dataType" => "int",
+ "dataType" => "Integer",
"paramType" => "path",
},
]}) do
@@ -167,14 +167,14 @@ MyApp.add_route('POST', '/v2/pet/{petId}/uploadImage', {
"resourcePath" => "/Pet",
"summary" => "uploads an image",
"nickname" => "upload_file",
- "responseClass" => "ApiResponse",
+ "responseClass" => "ApiResponse",
"endpoint" => "/pet/{petId}/uploadImage",
"notes" => "",
"parameters" => [
{
"name" => "pet_id",
"description" => "ID of pet to update",
- "dataType" => "int",
+ "dataType" => "Integer",
"paramType" => "path",
},
]}) do
diff --git a/samples/server/petstore/ruby-sinatra/api/store_api.rb b/samples/server/petstore/ruby-sinatra/api/store_api.rb
index e6fa2551e3a..7d1b54b2b79 100644
--- a/samples/server/petstore/ruby-sinatra/api/store_api.rb
+++ b/samples/server/petstore/ruby-sinatra/api/store_api.rb
@@ -5,14 +5,14 @@ MyApp.add_route('DELETE', '/v2/store/order/{orderId}', {
"resourcePath" => "/Store",
"summary" => "Delete purchase order by ID",
"nickname" => "delete_order",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/store/order/{orderId}",
"notes" => "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
"parameters" => [
{
"name" => "order_id",
"description" => "ID of the order that needs to be deleted",
- "dataType" => "string",
+ "dataType" => "String",
"paramType" => "path",
},
]}) do
@@ -27,7 +27,7 @@ MyApp.add_route('GET', '/v2/store/inventory', {
"resourcePath" => "/Store",
"summary" => "Returns pet inventories by status",
"nickname" => "get_inventory",
- "responseClass" => "map[string,int]",
+ "responseClass" => "Hash",
"endpoint" => "/store/inventory",
"notes" => "Returns a map of status codes to quantities",
"parameters" => [
@@ -43,14 +43,14 @@ MyApp.add_route('GET', '/v2/store/order/{orderId}', {
"resourcePath" => "/Store",
"summary" => "Find purchase order by ID",
"nickname" => "get_order_by_id",
- "responseClass" => "Order",
+ "responseClass" => "Order",
"endpoint" => "/store/order/{orderId}",
"notes" => "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
"parameters" => [
{
"name" => "order_id",
"description" => "ID of pet that needs to be fetched",
- "dataType" => "int",
+ "dataType" => "Integer",
"paramType" => "path",
},
]}) do
@@ -65,7 +65,7 @@ MyApp.add_route('POST', '/v2/store/order', {
"resourcePath" => "/Store",
"summary" => "Place an order for a pet",
"nickname" => "place_order",
- "responseClass" => "Order",
+ "responseClass" => "Order",
"endpoint" => "/store/order",
"notes" => "",
"parameters" => [
diff --git a/samples/server/petstore/ruby-sinatra/api/user_api.rb b/samples/server/petstore/ruby-sinatra/api/user_api.rb
index f2f159ead6d..e180ccb70e6 100644
--- a/samples/server/petstore/ruby-sinatra/api/user_api.rb
+++ b/samples/server/petstore/ruby-sinatra/api/user_api.rb
@@ -5,7 +5,7 @@ MyApp.add_route('POST', '/v2/user', {
"resourcePath" => "/User",
"summary" => "Create user",
"nickname" => "create_user",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/user",
"notes" => "This can only be done by the logged in user.",
"parameters" => [
@@ -27,14 +27,14 @@ MyApp.add_route('POST', '/v2/user/createWithArray', {
"resourcePath" => "/User",
"summary" => "Creates list of users with given input array",
"nickname" => "create_users_with_array_input",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/user/createWithArray",
"notes" => "",
"parameters" => [
{
"name" => "body",
"description" => "List of user object",
- "dataType" => "array[User]",
+ "dataType" => "Array",
"paramType" => "body",
}
]}) do
@@ -49,14 +49,14 @@ MyApp.add_route('POST', '/v2/user/createWithList', {
"resourcePath" => "/User",
"summary" => "Creates list of users with given input array",
"nickname" => "create_users_with_list_input",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/user/createWithList",
"notes" => "",
"parameters" => [
{
"name" => "body",
"description" => "List of user object",
- "dataType" => "array[User]",
+ "dataType" => "Array",
"paramType" => "body",
}
]}) do
@@ -71,14 +71,14 @@ MyApp.add_route('DELETE', '/v2/user/{username}', {
"resourcePath" => "/User",
"summary" => "Delete user",
"nickname" => "delete_user",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/user/{username}",
"notes" => "This can only be done by the logged in user.",
"parameters" => [
{
"name" => "username",
"description" => "The name that needs to be deleted",
- "dataType" => "string",
+ "dataType" => "String",
"paramType" => "path",
},
]}) do
@@ -93,14 +93,14 @@ MyApp.add_route('GET', '/v2/user/{username}', {
"resourcePath" => "/User",
"summary" => "Get user by user name",
"nickname" => "get_user_by_name",
- "responseClass" => "User",
+ "responseClass" => "User",
"endpoint" => "/user/{username}",
"notes" => "",
"parameters" => [
{
"name" => "username",
"description" => "The name that needs to be fetched. Use user1 for testing.",
- "dataType" => "string",
+ "dataType" => "String",
"paramType" => "path",
},
]}) do
@@ -115,21 +115,21 @@ MyApp.add_route('GET', '/v2/user/login', {
"resourcePath" => "/User",
"summary" => "Logs user into the system",
"nickname" => "login_user",
- "responseClass" => "string",
+ "responseClass" => "String",
"endpoint" => "/user/login",
"notes" => "",
"parameters" => [
{
"name" => "username",
"description" => "The user name for login",
- "dataType" => "string",
+ "dataType" => "String",
"allowableValues" => "",
"paramType" => "query",
},
{
"name" => "password",
"description" => "The password for login in clear text",
- "dataType" => "string",
+ "dataType" => "String",
"allowableValues" => "",
"paramType" => "query",
},
@@ -145,7 +145,7 @@ MyApp.add_route('GET', '/v2/user/logout', {
"resourcePath" => "/User",
"summary" => "Logs out current logged in user session",
"nickname" => "logout_user",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/user/logout",
"notes" => "",
"parameters" => [
@@ -161,14 +161,14 @@ MyApp.add_route('PUT', '/v2/user/{username}', {
"resourcePath" => "/User",
"summary" => "Updated user",
"nickname" => "update_user",
- "responseClass" => "void",
+ "responseClass" => "void",
"endpoint" => "/user/{username}",
"notes" => "This can only be done by the logged in user.",
"parameters" => [
{
"name" => "username",
"description" => "name that need to be deleted",
- "dataType" => "string",
+ "dataType" => "String",
"paramType" => "path",
},
{
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java
index 56ac6a180fd..5bc21a6e60b 100644
--- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java
@@ -13,7 +13,8 @@ import javax.validation.constraints.*;
/**
* Animal
*/
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),