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/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/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
index 098aafad782..08ae8593db8 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
@@ -1117,7 +1117,7 @@ public class DefaultCodegen implements CodegenConfig {
* Return the example value of the parameter.
*
* @param codegenParameter Codegen parameter
- * @param parameter Parameter
+ * @param parameter Parameter
*/
public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) {
if (parameter.getExample() != null) {
@@ -1127,7 +1127,7 @@ public class DefaultCodegen implements CodegenConfig {
if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) {
Example example = parameter.getExamples().values().iterator().next();
- if(example.getValue() != null) {
+ if (example.getValue() != null) {
codegenParameter.example = example.getValue().toString();
return;
}
@@ -1146,7 +1146,7 @@ public class DefaultCodegen implements CodegenConfig {
* Return the example value of the parameter.
*
* @param codegenParameter Codegen parameter
- * @param requestBody Request body
+ * @param requestBody Request body
*/
public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) {
Content content = requestBody.getContent();
@@ -1164,7 +1164,7 @@ public class DefaultCodegen implements CodegenConfig {
if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty()) {
Example example = mediaType.getExamples().values().iterator().next();
- if(example.getValue() != null) {
+ if (example.getValue() != null) {
codegenParameter.example = example.getValue().toString();
return;
}
@@ -1625,7 +1625,7 @@ public class DefaultCodegen implements CodegenConfig {
m.isInteger = Boolean.TRUE;
}
}
- if (ModelUtils.isStringSchema(schema)){
+ if (ModelUtils.isStringSchema(schema)) {
m.isString = Boolean.TRUE;
}
@@ -4412,15 +4412,32 @@ public class DefaultCodegen implements CodegenConfig {
if (schema.getAdditionalProperties() != null) {// http body is map
LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue.");
} else if (codegenProperty != null) {
+ String codegenModelName, codegenModelDescription;
+
+ if (codegenModel != null) {
+ codegenModelName = codegenModel.classname;
+ codegenModelDescription = codegenModel.description;
+ } else {
+ LOGGER.warn("The following schema has undefined (null) baseType. " +
+ "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " +
+ "A correct 'consumes' for form parameters should be " +
+ "'application/x-www-form-urlencoded' or 'multipart/form-data'");
+ LOGGER.warn("schema: " + schema);
+ LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE");
+ codegenModelName = "UNKNOWN_BASE_TYPE";
+ codegenModelDescription = "UNKNOWN_DESCRIPTION";
+ }
+
if (StringUtils.isEmpty(bodyParameterName)) {
- codegenParameter.baseName = codegenModel.classname;
+ codegenParameter.baseName = codegenModelName;
} else {
codegenParameter.baseName = bodyParameterName;
}
+
codegenParameter.paramName = toParamName(codegenParameter.baseName);
- codegenParameter.baseType = codegenModel.classname;
- codegenParameter.dataType = getTypeDeclaration(codegenModel.classname);
- codegenParameter.description = codegenModel.description;
+ codegenParameter.baseType = codegenModelName;
+ codegenParameter.dataType = getTypeDeclaration(codegenModelName);
+ codegenParameter.description = codegenModelDescription;
imports.add(codegenParameter.baseType);
if (codegenProperty.complexType != null) {
@@ -4504,6 +4521,6 @@ public class DefaultCodegen implements CodegenConfig {
}
public boolean isDataTypeString(String dataType) {
- return "String".equals(dataType);
+ return "String".equals(dataType);
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
index 38b670dd991..a782f23f42d 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
@@ -127,6 +127,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
typeMapping.put("string", "string");
typeMapping.put("byte", "int");
typeMapping.put("boolean", "bool");
+ typeMapping.put("date", "\\DateTime");
typeMapping.put("Date", "\\DateTime");
typeMapping.put("DateTime", "\\DateTime");
typeMapping.put("file", "\\SplFileObject");
@@ -170,17 +171,25 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
+
+ // Update the invokerPackage for the default apiPackage and modelPackage
+ apiPackage = invokerPackage + "\\" + apiDirName;
+ modelPackage = invokerPackage + "\\" + modelDirName;
} else {
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
}
- if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) {
- additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage);
+ if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) {
+ // Update model package to contain the specified model package name and the invoker package
+ modelPackage = invokerPackage + "\\" + (String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE);
}
+ additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage);
- if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
- additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
+ if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
+ // Update api package to contain the specified api package name and the invoker package
+ apiPackage = invokerPackage + "\\" + (String) additionalProperties.get(CodegenConstants.API_PACKAGE);
}
+ additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
// if (additionalProperties.containsKey(COMPOSER_PROJECT_NAME)) {
// this.setComposerProjectName((String) additionalProperties.get(COMPOSER_PROJECT_NAME));
@@ -329,7 +338,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
} else if (ModelUtils.isMapSchema(p)) {
Schema inner = (Schema) p.getAdditionalProperties();
return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
- } else if (!StringUtils.isEmpty(p.get$ref())) { // model
+ } else if (StringUtils.isNotBlank(p.get$ref())) { // model
String type = super.getTypeDeclaration(p);
return (!languageSpecificPrimitives.contains(type))
? "\\" + modelPackage + "\\" + type : type;
@@ -542,11 +551,11 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
type = p.dataType;
}
- if ("String".equalsIgnoreCase(type)) {
+ if ("String".equalsIgnoreCase(type) || p.isString) {
if (example == null) {
- example = p.paramName + "_example";
+ example = "'" + p.paramName + "_example'";
}
- example = "\"" + escapeText(example) + "\"";
+ example = escapeText(example);
} else if ("Integer".equals(type) || "int".equals(type)) {
if (example == null) {
example = "56";
@@ -559,21 +568,23 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
if (example == null) {
example = "True";
}
- } else if ("\\SplFileObject".equalsIgnoreCase(type)) {
+ } else if ("\\SplFileObject".equalsIgnoreCase(type) || p.isFile) {
if (example == null) {
- example = "/path/to/file";
+ example = "/path/to/file.txt";
}
example = "\"" + escapeText(example) + "\"";
- } else if ("Date".equalsIgnoreCase(type)) {
+ } else if ("\\Date".equalsIgnoreCase(type)) {
if (example == null) {
example = "2013-10-20";
}
example = "new \\DateTime(\"" + escapeText(example) + "\")";
- } else if ("DateTime".equalsIgnoreCase(type)) {
+ } else if ("\\DateTime".equalsIgnoreCase(type)) {
if (example == null) {
example = "2013-10-20T19:20:30+01:00";
}
example = "new \\DateTime(\"" + escapeText(example) + "\")";
+ } else if ("object".equals(type)) {
+ example = "new \\stdClass";
} else if (!languageSpecificPrimitives.contains(type)) {
// type is a model class, e.g. User
example = "new " + getTypeDeclaration(type) + "()";
@@ -631,8 +642,8 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
enumName = enumName.replaceFirst("^_", "");
enumName = enumName.replaceFirst("_$", "");
- if (enumName.matches("\\d.*")) { // starts with number
- return "_" + enumName;
+ if (isReservedWord(enumName) || enumName.matches("\\d.*")) { // reserved word or starts with number
+ return escapeReservedWord(enumName);
} else {
return enumName;
}
@@ -642,6 +653,9 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
public String toEnumName(CodegenProperty property) {
String enumName = underscore(toModelName(property.name)).toUpperCase();
+ // remove [] for array or map of enum
+ enumName = enumName.replace("[]", "");
+
if (enumName.matches("\\d.*")) { // starts with number
return "_" + enumName;
} else {
@@ -660,6 +674,8 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
Map operations = (Map) objs.get("operations");
List operationList = (List) operations.get("operation");
for (CodegenOperation op : operationList) {
+ // for API test method name
+ // e.g. public function test{{vendorExtensions.x-testOperationId}}()
op.vendorExtensions.put("x-testOperationId", camelize(op.operationId));
}
return objs;
@@ -673,7 +689,17 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
@Override
public String escapeUnsafeCharacters(String input) {
- return input.replace("*/", "");
+ return input.replace("*/", "*_/").replace("/*", "/_*");
+ }
+
+ @Override
+ public String escapeText(String input) {
+ if (input == null) {
+ return input;
+ }
+
+ // Trim the string to avoid leading and trailing spaces.
+ return super.escapeText(input).trim();
}
protected String extractSimpleName(String phpClassName) {
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java
new file mode 100644
index 00000000000..5848febe0b2
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.languages;
+
+import io.swagger.v3.oas.models.media.ArraySchema;
+import io.swagger.v3.oas.models.media.Schema;
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.utils.ModelUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+
+abstract class AbstractRubyCodegen extends DefaultCodegen implements CodegenConfig {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractRubyCodegen.class);
+
+ AbstractRubyCodegen() {
+ super();
+
+ setReservedWordsLowerCase(
+ Arrays.asList(
+ "__FILE__", "and", "def", "end", "in", "or", "self", "unless", "__LINE__",
+ "begin", "defined?", "ensure", "module", "redo", "super", "until", "BEGIN",
+ "break", "do", "false", "next", "rescue", "then", "when", "END", "case",
+ "else", "for", "nil", "retry", "true", "while", "alias", "class", "elsif",
+ "if", "not", "return", "undef", "yield")
+ );
+
+ languageSpecificPrimitives.clear();
+ languageSpecificPrimitives.add("String");
+ languageSpecificPrimitives.add("Integer");
+ languageSpecificPrimitives.add("Float");
+ languageSpecificPrimitives.add("Date");
+ languageSpecificPrimitives.add("DateTime");
+ languageSpecificPrimitives.add("Array");
+ languageSpecificPrimitives.add("Hash");
+ languageSpecificPrimitives.add("File");
+ languageSpecificPrimitives.add("Object");
+
+ typeMapping.clear();
+ typeMapping.put("string", "String");
+ typeMapping.put("char", "String");
+ typeMapping.put("int", "Integer");
+ typeMapping.put("integer", "Integer");
+ typeMapping.put("long", "Integer");
+ typeMapping.put("short", "Integer");
+ typeMapping.put("float", "Float");
+ typeMapping.put("double", "Float");
+ typeMapping.put("number", "Float");
+ typeMapping.put("date", "Date");
+ typeMapping.put("DateTime", "DateTime");
+ typeMapping.put("array", "Array");
+ typeMapping.put("List", "Array");
+ typeMapping.put("map", "Hash");
+ typeMapping.put("object", "Object");
+ typeMapping.put("file", "File");
+ typeMapping.put("binary", "String");
+ typeMapping.put("ByteArray", "String");
+ typeMapping.put("UUID", "String");
+ }
+
+ @Override
+ public String escapeReservedWord(String name) {
+ if (this.reservedWordsMappings().containsKey(name)) {
+ return this.reservedWordsMappings().get(name);
+ }
+ return "_" + name;
+ }
+
+ @Override
+ public String getTypeDeclaration(Schema schema) {
+ if (ModelUtils.isArraySchema(schema)) {
+ Schema inner = ((ArraySchema) schema).getItems();
+ return getSchemaType(schema) + "<" + getTypeDeclaration(inner) + ">";
+ } else if (ModelUtils.isMapSchema(schema)) {
+ Schema inner = (Schema) schema.getAdditionalProperties();
+ return getSchemaType(schema) + "";
+ }
+
+ return super.getTypeDeclaration(schema);
+ }
+
+ @Override
+ public String toDefaultValue(Schema p) {
+ if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) {
+ if (p.getDefault() != null) {
+ return p.getDefault().toString();
+ }
+ } else if (ModelUtils.isStringSchema(p)) {
+ if (p.getDefault() != null) {
+ return "'" + escapeText((String) p.getDefault()) + "'";
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String toVarName(String name) {
+ // sanitize name
+ name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
+ // if it's all uppper case, convert to lower case
+ if (name.matches("^[A-Z_]*$")) {
+ name = name.toLowerCase();
+ }
+
+ // camelize (lower first character) the variable name
+ // petId => pet_id
+ name = underscore(name);
+
+ // for reserved word or word starting with number, append _
+ if (isReservedWord(name) || name.matches("^\\d.*")) {
+ name = escapeReservedWord(name);
+ }
+
+ return name;
+ }
+
+ @Override
+ public String toParamName(String name) {
+ // should be the same as variable name
+ return toVarName(name);
+ }
+
+ @Override
+ public String toOperationId(String operationId) {
+ // method name cannot use reserved keyword, e.g. return
+ if (isReservedWord(operationId)) {
+ String newOperationId = underscore("call_" + operationId);
+ LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
+ return newOperationId;
+ }
+
+ return underscore(operationId);
+ }
+
+ @Override
+ public String escapeQuotationMark(String input) {
+ // remove ' to avoid code injection
+ return input.replace("'", "");
+ }
+
+ @Override
+ public String escapeUnsafeCharacters(String input) {
+ return input.replace("=end", "=_end").replace("=begin", "=_begin");
+ }
+}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java
index 8cf9a14af6d..4212923bc4d 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java
@@ -300,7 +300,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
return getSchemaType(p) + "";
} else if (ModelUtils.isStringSchema(p)
|| ModelUtils.isDateSchema(p) || ModelUtils.isDateTimeSchema(p)
- || ModelUtils.isFileSchema(p)
+ || ModelUtils.isFileSchema(p) || ModelUtils.isUUIDSchema(p)
|| languageSpecificPrimitives.contains(openAPIType)) {
return toModelName(openAPIType);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java
index db5b2abdb04..5d17ba457b3 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpClientCodegen.java
@@ -18,57 +18,28 @@
package org.openapitools.codegen.languages;
import org.openapitools.codegen.CliOption;
-import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.CodegenConstants;
-import org.openapitools.codegen.CodegenOperation;
-import org.openapitools.codegen.CodegenParameter;
-import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.CodegenType;
-import org.openapitools.codegen.DefaultCodegen;
import org.openapitools.codegen.SupportingFile;
-import org.openapitools.codegen.utils.ModelUtils;
import java.io.File;
-import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import java.util.HashSet;
-import java.util.regex.Matcher;
import org.apache.commons.lang3.StringUtils;
-import io.swagger.v3.oas.models.OpenAPI;
-import io.swagger.v3.oas.models.Operation;
-import io.swagger.v3.oas.models.media.*;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
+public class PhpClientCodegen extends AbstractPhpCodegen {
@SuppressWarnings("hiding")
private static final Logger LOGGER = LoggerFactory.getLogger(PhpClientCodegen.class);
- public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention";
- public static final String PACKAGE_PATH = "packagePath";
- public static final String SRC_BASE_PATH = "srcBasePath";
public static final String COMPOSER_VENDOR_NAME = "composerVendorName";
public static final String COMPOSER_PROJECT_NAME = "composerProjectName";
- protected String invokerPackage = "OpenAPI\\Client";
protected String composerVendorName = null;
protected String composerProjectName = null;
- protected String packagePath = "OpenAPIClient-php";
- protected String artifactVersion = null;
- protected String srcBasePath = "lib";
- protected String testBasePath = "test";
- protected String docsBasePath = "docs";
- protected String apiDirName = "Api";
- protected String modelDirName = "Model";
- protected String variableNamingConvention = "snake_case";
- protected String apiDocPath = docsBasePath + "/" + apiDirName;
- protected String modelDocPath = docsBasePath + "/" + modelDirName;
public PhpClientCodegen() {
super();
@@ -77,144 +48,30 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
// at the moment
importMapping.clear();
+ setInvokerPackage("OpenAPI\\Client");
+ setApiPackage(getInvokerPackage() + "\\" + apiDirName);
+ setModelPackage(getInvokerPackage() + "\\" + modelDirName);
+ setPackagePath("OpenAPIClient-php");
supportsInheritance = true;
- outputFolder = "generated-code" + File.separator + "php";
- modelTemplateFiles.put("model.mustache", ".php");
- apiTemplateFiles.put("api.mustache", ".php");
+ setOutputDir("generated-code" + File.separator + "php");
modelTestTemplateFiles.put("model_test.mustache", ".php");
- apiTestTemplateFiles.put("api_test.mustache", ".php");
embeddedTemplateDir = templateDir = "php";
- apiPackage = invokerPackage + "\\" + apiDirName;
- modelPackage = invokerPackage + "\\" + modelDirName;
-
- modelDocTemplateFiles.put("model_doc.mustache", ".md");
- apiDocTemplateFiles.put("api_doc.mustache", ".md");
// default HIDE_GENERATION_TIMESTAMP to true
hideGenerationTimestamp = Boolean.TRUE;
- setReservedWordsLowerCase(
- Arrays.asList(
- // local variables used in api methods (endpoints)
- "resourcePath", "httpBody", "queryParams", "headerParams",
- "formParams", "_header_accept", "_tempBody",
-
- // PHP reserved words
- "__halt_compiler", "abstract", "and", "array", "as", "break", "callable", "case", "catch", "class", "clone", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "eval", "exit", "extends", "final", "for", "foreach", "function", "global", "goto", "if", "implements", "include", "include_once", "instanceof", "insteadof", "interface", "isset", "list", "namespace", "new", "or", "print", "private", "protected", "public", "require", "require_once", "return", "static", "switch", "throw", "trait", "try", "unset", "use", "var", "while", "xor")
- );
-
- // ref: http://php.net/manual/en/language.types.intro.php
- languageSpecificPrimitives = new HashSet(
- Arrays.asList(
- "bool",
- "boolean",
- "int",
- "integer",
- "double",
- "float",
- "string",
- "object",
- "DateTime",
- "mixed",
- "number",
- "void",
- "byte")
- );
-
- instantiationTypes.put("array", "array");
- instantiationTypes.put("map", "map");
-
-
// provide primitives to mustache template
List sortedLanguageSpecificPrimitives = new ArrayList(languageSpecificPrimitives);
Collections.sort(sortedLanguageSpecificPrimitives);
String primitives = "'" + StringUtils.join(sortedLanguageSpecificPrimitives, "', '") + "'";
additionalProperties.put("primitives", primitives);
- // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
- typeMapping = new HashMap();
- typeMapping.put("integer", "int");
- typeMapping.put("long", "int");
- typeMapping.put("number", "float");
- typeMapping.put("float", "float");
- typeMapping.put("double", "double");
- typeMapping.put("string", "string");
- typeMapping.put("byte", "int");
- typeMapping.put("boolean", "bool");
- typeMapping.put("date", "\\DateTime");
- typeMapping.put("Date", "\\DateTime");
- typeMapping.put("DateTime", "\\DateTime");
- typeMapping.put("file", "\\SplFileObject");
- typeMapping.put("map", "map");
- typeMapping.put("array", "array");
- typeMapping.put("list", "array");
- typeMapping.put("object", "object");
- typeMapping.put("binary", "\\SplFileObject");
- typeMapping.put("ByteArray", "string");
- typeMapping.put("UUID", "string");
-
- cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
- cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
- cliOptions.add(new CliOption(VARIABLE_NAMING_CONVENTION, "naming convention of variable name, e.g. camelCase.")
- .defaultValue("snake_case"));
- cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay\\Pets"));
- cliOptions.add(new CliOption(PACKAGE_PATH, "The main package name for classes. e.g. GeneratedPetstore"));
- cliOptions.add(new CliOption(SRC_BASE_PATH, "The directory under packagePath to serve as source root."));
cliOptions.add(new CliOption(COMPOSER_VENDOR_NAME, "The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets. IMPORTANT NOTE (2016/03): composerVendorName will be deprecated and replaced by gitUserId in the next openapi-generator release"));
- cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC));
cliOptions.add(new CliOption(COMPOSER_PROJECT_NAME, "The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client. IMPORTANT NOTE (2016/03): composerProjectName will be deprecated and replaced by gitRepoId in the next openapi-generator release"));
- cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC));
- cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, "The version to use in the composer package version field. e.g. 1.2.3"));
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.ALLOW_UNICODE_IDENTIFIERS_DESC)
.defaultValue(Boolean.TRUE.toString()));
}
- public String getPackagePath() {
- return packagePath;
- }
-
- public String toPackagePath(String packageName, String basePath) {
- return (getPackagePath() + File.separatorChar + toSrcPath(packageName, basePath));
- }
-
- public String toSrcPath(String packageName, String basePath) {
- packageName = packageName.replace(invokerPackage, ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
- if (basePath != null && basePath.length() > 0) {
- basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar; // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
- }
-
- String regFirstPathSeparator;
- if ("/".equals(File.separator)) { // for mac, linux
- regFirstPathSeparator = "^/";
- } else { // for windows
- regFirstPathSeparator = "^\\\\";
- }
-
- String regLastPathSeparator;
- if ("/".equals(File.separator)) { // for mac, linux
- regLastPathSeparator = "/$";
- } else { // for windows
- regLastPathSeparator = "\\\\$";
- }
-
- return (basePath
- // Replace period, backslash, forward slash with file separator in package name
- + packageName.replaceAll("[\\.\\\\/]", Matcher.quoteReplacement(File.separator))
- // Trim prefix file separators from package path
- .replaceAll(regFirstPathSeparator, ""))
- // Trim trailing file separators from the overall path
- .replaceAll(regLastPathSeparator + "$", "");
- }
-
- @Override
- public String escapeText(String input) {
- if (input != null) {
- // Trim the string to avoid leading and trailing spaces.
- return super.escapeText(input).trim();
- }
- return input;
- }
-
@Override
public CodegenType getTag() {
return CodegenType.CLIENT;
@@ -234,89 +91,18 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
public void processOpts() {
super.processOpts();
- if (additionalProperties.containsKey(PACKAGE_PATH)) {
- this.setPackagePath((String) additionalProperties.get(PACKAGE_PATH));
- } else {
- additionalProperties.put(PACKAGE_PATH, packagePath);
- }
-
- if (additionalProperties.containsKey(SRC_BASE_PATH)) {
- this.setSrcBasePath((String) additionalProperties.get(SRC_BASE_PATH));
- } else {
- additionalProperties.put(SRC_BASE_PATH, srcBasePath);
- }
-
- if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
- this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
-
- // Update the invokerPackage for the default apiPackage and modelPackage
- apiPackage = invokerPackage + "\\" + apiDirName;
- modelPackage = invokerPackage + "\\" + modelDirName;
- } else {
- additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
- }
-
- if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) {
- // Update model package to contain the specified model package name and the invoker package
- modelPackage = invokerPackage + "\\" + (String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE);
- }
- additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage);
-
- if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
- // Update model package to contain the specified model package name and the invoker package
- apiPackage = invokerPackage + "\\" + (String) additionalProperties.get(CodegenConstants.API_PACKAGE);
- }
- additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
-
if (additionalProperties.containsKey(COMPOSER_PROJECT_NAME)) {
this.setComposerProjectName((String) additionalProperties.get(COMPOSER_PROJECT_NAME));
} else {
additionalProperties.put(COMPOSER_PROJECT_NAME, composerProjectName);
}
- if (additionalProperties.containsKey(CodegenConstants.GIT_USER_ID)) {
- this.setGitUserId((String) additionalProperties.get(CodegenConstants.GIT_USER_ID));
- } else {
- additionalProperties.put(CodegenConstants.GIT_USER_ID, gitUserId);
- }
-
if (additionalProperties.containsKey(COMPOSER_VENDOR_NAME)) {
this.setComposerVendorName((String) additionalProperties.get(COMPOSER_VENDOR_NAME));
} else {
additionalProperties.put(COMPOSER_VENDOR_NAME, composerVendorName);
}
- if (additionalProperties.containsKey(CodegenConstants.GIT_REPO_ID)) {
- this.setGitRepoId((String) additionalProperties.get(CodegenConstants.GIT_REPO_ID));
- } else {
- additionalProperties.put(CodegenConstants.GIT_REPO_ID, gitRepoId);
- }
-
- if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) {
- this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION));
- } else {
- additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
- }
-
- if (additionalProperties.containsKey(VARIABLE_NAMING_CONVENTION)) {
- this.setParameterNamingConvention((String) additionalProperties.get(VARIABLE_NAMING_CONVENTION));
- }
-
- additionalProperties.put("escapedInvokerPackage", invokerPackage.replace("\\", "\\\\"));
-
- // make api and model src path available in mustache template
- additionalProperties.put("apiSrcPath", "./" + toSrcPath(apiPackage, srcBasePath));
- additionalProperties.put("modelSrcPath", "./" + toSrcPath(modelPackage, srcBasePath));
- additionalProperties.put("apiTestPath", "./" + testBasePath + "/" + apiDirName);
- additionalProperties.put("modelTestPath", "./" + testBasePath + "/" + modelDirName);
-
- // make api and model doc path available in mustache template
- additionalProperties.put("apiDocPath", apiDocPath);
- additionalProperties.put("modelDocPath", modelDocPath);
-
- // make test path available in mustache template
- additionalProperties.put("testBasePath", testBasePath);
-
supportingFiles.add(new SupportingFile("ApiException.mustache", toPackagePath(invokerPackage, srcBasePath), "ApiException.php"));
supportingFiles.add(new SupportingFile("Configuration.mustache", toPackagePath(invokerPackage, srcBasePath), "Configuration.php"));
supportingFiles.add(new SupportingFile("ObjectSerializer.mustache", toPackagePath(invokerPackage, srcBasePath), "ObjectSerializer.php"));
@@ -330,124 +116,6 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
supportingFiles.add(new SupportingFile("git_push.sh.mustache", getPackagePath(), "git_push.sh"));
}
- @Override
- public String escapeReservedWord(String name) {
- if (this.reservedWordsMappings().containsKey(name)) {
- return this.reservedWordsMappings().get(name);
- }
- return "_" + name;
- }
-
- @Override
- public String apiFileFolder() {
- return (outputFolder + "/" + toPackagePath(apiPackage, srcBasePath));
- }
-
- @Override
- public String modelFileFolder() {
- return (outputFolder + "/" + toPackagePath(modelPackage, srcBasePath));
- }
-
- @Override
- public String apiTestFileFolder() {
- return (outputFolder + "/" + getPackagePath() + "/" + testBasePath + "/" + apiDirName);
- }
-
- @Override
- public String modelTestFileFolder() {
- return (outputFolder + "/" + getPackagePath() + "/" + testBasePath + "/" + modelDirName);
- }
-
- @Override
- public String apiDocFileFolder() {
- return (outputFolder + "/" + getPackagePath() + "/" + apiDocPath);
- }
-
- @Override
- public String modelDocFileFolder() {
- return (outputFolder + "/" + getPackagePath() + "/" + modelDocPath);
- }
-
- @Override
- public String toModelDocFilename(String name) {
- return toModelName(name);
- }
-
- @Override
- public String toApiDocFilename(String name) {
- return toApiName(name);
- }
-
- @Override
- public String getTypeDeclaration(Schema p) {
- if (ModelUtils.isArraySchema(p)) {
- ArraySchema ap = (ArraySchema) p;
- Schema inner = ap.getItems();
- return getTypeDeclaration(inner) + "[]";
- } else if (ModelUtils.isMapSchema(p)) {
- Schema inner = (Schema) p.getAdditionalProperties();
- return getSchemaType(p) + "[string," + getTypeDeclaration(inner) + "]";
- } else if (StringUtils.isNotBlank(p.get$ref())) {
- String type = super.getTypeDeclaration(p);
- return (!languageSpecificPrimitives.contains(type))
- ? "\\" + modelPackage + "\\" + type : type;
- }
- return super.getTypeDeclaration(p);
- }
-
- @Override
- public String getTypeDeclaration(String name) {
- if (!languageSpecificPrimitives.contains(name)) {
- return "\\" + modelPackage + "\\" + name;
- }
- return super.getTypeDeclaration(name);
- }
-
- @Override
- public String getSchemaType(Schema p) {
- String openAPIType = super.getSchemaType(p);
-
- String type = null;
- if (typeMapping.containsKey(openAPIType)) {
- type = typeMapping.get(openAPIType);
- if (languageSpecificPrimitives.contains(type)) {
- return type;
- } else if (instantiationTypes.containsKey(type)) {
- return type;
- }
- } else {
- type = openAPIType;
- }
- if (type == null) {
- return null;
- }
- return toModelName(type);
- }
-
- public String getInvokerPackage() {
- return invokerPackage;
- }
-
- public void setInvokerPackage(String invokerPackage) {
- this.invokerPackage = invokerPackage;
- }
-
- public void setArtifactVersion(String artifactVersion) {
- this.artifactVersion = artifactVersion;
- }
-
- public void setPackagePath(String packagePath) {
- this.packagePath = packagePath;
- }
-
- public void setSrcBasePath(String srcBasePath) {
- this.srcBasePath = srcBasePath;
- }
-
- public void setParameterNamingConvention(String variableNamingConvention) {
- this.variableNamingConvention = variableNamingConvention;
- }
-
public void setComposerVendorName(String composerVendorName) {
this.composerVendorName = composerVendorName;
}
@@ -455,291 +123,4 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
public void setComposerProjectName(String composerProjectName) {
this.composerProjectName = composerProjectName;
}
-
- @Override
- public String toVarName(String name) {
- // sanitize name
- name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
-
- if ("camelCase".equals(variableNamingConvention)) {
- // return the name in camelCase style
- // phone_number => phoneNumber
- name = camelize(name, true);
- } else { // default to snake case
- // return the name in underscore style
- // PhoneNumber => phone_number
- name = underscore(name);
- }
-
- // parameter name starting with number won't compile
- // need to escape it by appending _ at the beginning
- if (name.matches("^\\d.*")) {
- name = "_" + name;
- }
-
- return name;
- }
-
- @Override
- public String toParamName(String name) {
- // should be the same as variable name
- return toVarName(name);
- }
-
- @Override
- public String toModelName(String name) {
- // remove [
- name = name.replaceAll("\\]", "");
-
- // Note: backslash ("\\") is allowed for e.g. "\\DateTime"
- name = name.replaceAll("[^\\w\\\\]+", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
-
- // remove dollar sign
- name = name.replaceAll("$", "");
-
- // model name cannot use reserved keyword
- if (isReservedWord(name)) {
- LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name));
- name = "model_" + name; // e.g. return => ModelReturn (after camelize)
- }
-
- // model name starts with number
- if (name.matches("^\\d.*")) {
- LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name));
- name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
- }
-
- // add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime)
- if (!name.matches("^\\\\.*")) {
- if (!StringUtils.isEmpty(modelNamePrefix)) {
- name = modelNamePrefix + "_" + name;
- }
-
- if (!StringUtils.isEmpty(modelNameSuffix)) {
- name = name + "_" + modelNameSuffix;
- }
- }
-
- // camelize the model name
- // phone_number => PhoneNumber
- return camelize(name);
- }
-
- @Override
- public String toModelFilename(String name) {
- // should be the same as the model name
- return toModelName(name);
- }
-
- @Override
- public String toModelTestFilename(String name) {
- // should be the same as the model name
- return toModelName(name) + "Test";
- }
-
- @Override
- public String toOperationId(String operationId) {
- // throw exception if method name is empty
- if (StringUtils.isEmpty(operationId)) {
- throw new RuntimeException("Empty method name (operationId) not allowed");
- }
-
- // method name cannot use reserved keyword, e.g. return
- if (isReservedWord(operationId)) {
- LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId), true));
- operationId = "call_" + operationId;
- }
-
- return camelize(sanitizeName(operationId), true);
- }
-
- /**
- * Return the default value of the property
- *
- * @param p property schema
- * @return string presentation of the default value of the property
- */
- @Override
- public String toDefaultValue(Schema p) {
- if (ModelUtils.isBooleanSchema(p)) {
- if (p.getDefault() != null) {
- return p.getDefault().toString();
- }
- } else if (ModelUtils.isDateSchema(p)) {
- // TODO
- } else if (ModelUtils.isDateTimeSchema(p)) {
- // TODO
- } else if (ModelUtils.isNumberSchema(p)) {
- if (p.getDefault() != null) {
- return p.getDefault().toString();
- }
- } else if (ModelUtils.isIntegerSchema(p)) {
- if (p.getDefault() != null) {
- return p.getDefault().toString();
- }
- } else if (ModelUtils.isStringSchema(p)) {
- if (p.getDefault() != null) {
- return "'" + p.getDefault() + "'";
- }
- }
-
- return null;
- }
-
- @Override
- public void setParameterExampleValue(CodegenParameter p) {
- String example;
-
- if (p.defaultValue == null) {
- example = p.example;
- } else {
- example = p.defaultValue;
- }
-
- String type = p.baseType;
- if (type == null) {
- type = p.dataType;
- }
-
- if ("String".equalsIgnoreCase(type) || p.isString) {
- if (example == null) {
- example = "'" + p.paramName + "_example'";
- }
- example = escapeText(example);
- } else if ("Integer".equals(type) || "int".equals(type)) {
- if (example == null) {
- example = "56";
- }
- } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "3.4";
- }
- } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "True";
- }
- } else if ("\\SplFileObject".equalsIgnoreCase(type) || p.isFile) {
- if (example == null) {
- example = "/path/to/file.txt";
- }
- example = "\"" + escapeText(example) + "\"";
- } else if ("\\Date".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "2013-10-20";
- }
- example = "new \\DateTime(\"" + escapeText(example) + "\")";
- } else if ("\\DateTime".equalsIgnoreCase(type)) {
- if (example == null) {
- example = "2013-10-20T19:20:30+01:00";
- }
- example = "new \\DateTime(\"" + escapeText(example) + "\")";
- } else if ("object".equals(type)) {
- example = "new \\stdClass";
- } else if (!languageSpecificPrimitives.contains(type)) {
- // type is a model class, e.g. User
- example = "new " + getTypeDeclaration(type) + "()";
- } else {
- LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
- }
-
- if (example == null) {
- example = "NULL";
- } else if (Boolean.TRUE.equals(p.isListContainer)) {
- example = "array(" + example + ")";
- } else if (Boolean.TRUE.equals(p.isMapContainer)) {
- example = "array('key' => " + example + ")";
- }
-
- p.example = example;
- }
-
- @Override
- public String toEnumValue(String value, String datatype) {
- if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) {
- return value;
- } else {
- return "\'" + escapeText(value) + "\'";
- }
- }
-
- @Override
- public String toEnumDefaultValue(String value, String datatype) {
- return datatype + "_" + value;
- }
-
- @Override
- public String toEnumVarName(String name, String datatype) {
- if (name.length() == 0) {
- return "EMPTY";
- }
-
- // number
- if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) {
- String varName = name;
- varName = varName.replaceAll("-", "MINUS_");
- varName = varName.replaceAll("\\+", "PLUS_");
- varName = varName.replaceAll("\\.", "_DOT_");
- return varName;
- }
-
- // for symbol, e.g. $, #
- if (getSymbolName(name) != null) {
- return getSymbolName(name).toUpperCase();
- }
-
- // string
- String enumName = sanitizeName(underscore(name).toUpperCase());
- enumName = enumName.replaceFirst("^_", "");
- enumName = enumName.replaceFirst("_$", "");
-
- if (isReservedWord(enumName) || enumName.matches("\\d.*")) { // reserved word or starts with number
- return escapeReservedWord(enumName);
- } else {
- return enumName;
- }
- }
-
- @Override
- public String toEnumName(CodegenProperty property) {
- String enumName = underscore(toModelName(property.name)).toUpperCase();
-
- // remove [] for array or map of enum
- enumName = enumName.replace("[]", "");
-
- if (enumName.matches("\\d.*")) { // starts with number
- return "_" + enumName;
- } else {
- return enumName;
- }
- }
-
- @Override
- public Map postProcessModels(Map objs) {
- // process enum in models
- return postProcessModelsEnum(objs);
- }
-
- @Override
- public Map postProcessOperationsWithModels(Map objs, 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/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/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/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/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java
index df8647e65a4..099d2369e95 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java
@@ -44,6 +44,7 @@ public class PythonClientOptionsProvider implements OptionsProvider {
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
+ .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false")
.put(CodegenConstants.LIBRARY, "urllib3")
.build();
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java
index 62151e6c510..3aa56146ae3 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java
@@ -71,10 +71,10 @@ public class AbstractPhpCodegenTest {
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
- Assert.assertEquals(codegen.modelPackage(), "PHPmodel");
- Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "PHPmodel");
- Assert.assertEquals(codegen.apiPackage(), "PHPapi");
- Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "PHPapi");
+ Assert.assertEquals(codegen.modelPackage(), "PHPinvoker\\PHPmodel");
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "PHPinvoker\\PHPmodel");
+ Assert.assertEquals(codegen.apiPackage(), "PHPinvoker\\PHPapi");
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "PHPinvoker\\PHPapi");
Assert.assertEquals(codegen.getInvokerPackage(), "PHPinvoker");
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "PHPinvoker");
}
diff --git a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache
index b6d2dd8ec39..e31fd0f0677 100644
--- a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache
+++ b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache
@@ -34,6 +34,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
@@ -42,6 +47,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
}
// Rename the aar correctly
@@ -85,6 +91,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
@@ -93,6 +104,7 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
{{/java8}}
+ {{/supportJava6}}
install {
repositories.mavenInstaller {
diff --git a/samples/client/petstore-security-test/php/.openapi-generator/VERSION b/samples/client/petstore-security-test/php/.openapi-generator/VERSION
index 0628777500b..dde25ef08e8 100644
--- a/samples/client/petstore-security-test/php/.openapi-generator/VERSION
+++ b/samples/client/petstore-security-test/php/.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/client/petstore-security-test/php/OpenAPIClient-php/README.md b/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md
index e2de901f88f..72e324853a6 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md
@@ -61,7 +61,7 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
-$unknown_base_type = new \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE(); // object |
+$unknown_base_type = new \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE(); // \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE |
try {
$apiInstance->testCodeInjectEndRnNR($unknown_base_type);
@@ -74,7 +74,7 @@ try {
## Documentation for API Endpoints
-All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
+All URIs are relative to *http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore-security-test/php/OpenAPIClient-php/docs/Api/FakeApi.md
index 5a3f6e363f3..dae9ffabe9b 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/docs/Api/FakeApi.md
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/docs/Api/FakeApi.md
@@ -1,6 +1,6 @@
# OpenAPI\Client\FakeApi
-All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
+All URIs are relative to *http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
Method | HTTP request | Description
------------- | ------------- | -------------
@@ -22,7 +22,7 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
-$unknown_base_type = new \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE(); // object |
+$unknown_base_type = new \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE(); // \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE |
try {
$apiInstance->testCodeInjectEndRnNR($unknown_base_type);
@@ -36,7 +36,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **unknown_base_type** | [**object**](../Model/UNKNOWN_BASE_TYPE.md)| | [optional]
+ **unknown_base_type** | [**\OpenAPI\Client\Model\UNKNOWN_BASE_TYPE**](../Model/UNKNOWN_BASE_TYPE.md)| | [optional]
### Return type
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php
index 7032e80950c..4399e72af7b 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php
@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
@@ -92,7 +92,7 @@ class FakeApi
*
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
*
- * @param object $unknown_base_type unknown_base_type (optional)
+ * @param \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE $unknown_base_type unknown_base_type (optional)
*
* @throws \OpenAPI\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@@ -108,7 +108,7 @@ class FakeApi
*
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
*
- * @param object $unknown_base_type (optional)
+ * @param \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE $unknown_base_type (optional)
*
* @throws \OpenAPI\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
@@ -160,7 +160,7 @@ class FakeApi
*
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
*
- * @param object $unknown_base_type (optional)
+ * @param \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE $unknown_base_type (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@@ -180,7 +180,7 @@ class FakeApi
*
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
*
- * @param object $unknown_base_type (optional)
+ * @param \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE $unknown_base_type (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
@@ -216,7 +216,7 @@ class FakeApi
/**
* Create request for operation 'testCodeInjectEndRnNR'
*
- * @param object $unknown_base_type (optional)
+ * @param \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE $unknown_base_type (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php
index 05fb9552d74..b880234a1da 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php
@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php
index 2d768effac8..706eb1bf1ae 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php
@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
@@ -81,7 +81,7 @@ class Configuration
*
* @var string
*/
- protected $host = 'petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
+ protected $host = 'http://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
/**
* User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php
index 1b89fb42845..3499cc7158d 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php
@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php
index 67e8631bb2f..09b88fa9478 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php
@@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php
index 25fcb651d0b..4893a9af19e 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php
@@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php
index cf0e7a9de8e..c346ebf3576 100644
--- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php
+++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php
@@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
- * OpenAPI Generator version: 3.1.0-SNAPSHOT
+ * OpenAPI Generator version: 3.1.1-SNAPSHOT
*/
/**
diff --git a/samples/client/petstore/java/jersey2-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md
index 43a4c27ae42..ba58700f55e 100644
--- a/samples/client/petstore/java/jersey2-java6/README.md
+++ b/samples/client/petstore/java/jersey2-java6/README.md
@@ -12,7 +12,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
## Requirements
Building the API client library requires:
-1. Java 1.7+
+1. Java 1.6+
2. Maven/Gradle
## Installation
@@ -108,6 +108,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -123,6 +124,7 @@ Class | Method | HTTP request | Description
*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
@@ -154,6 +156,7 @@ Class | Method | HTTP request | Description
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [FormatTest](docs/FormatTest.md)
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [MapTest](docs/MapTest.md)
@@ -169,6 +172,7 @@ Class | Method | HTTP request | Description
- [Pet](docs/Pet.md)
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [SpecialModelName](docs/SpecialModelName.md)
+ - [StringBooleanMap](docs/StringBooleanMap.md)
- [Tag](docs/Tag.md)
- [User](docs/User.md)
diff --git a/samples/client/petstore/java/jersey2-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle
index 2676ce5ac1e..21ecdd4241c 100644
--- a/samples/client/petstore/java/jersey2-java6/build.gradle
+++ b/samples/client/petstore/java/jersey2-java6/build.gradle
@@ -6,7 +6,9 @@ version = '1.0.0'
buildscript {
repositories {
- jcenter()
+ jcenter {
+ url "http://jcenter.bintray.com/"
+ }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
@@ -15,7 +17,9 @@ buildscript {
}
repositories {
- jcenter()
+ jcenter {
+ url "http://jcenter.bintray.com/"
+ }
}
@@ -32,8 +36,8 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 25
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_7
- targetCompatibility JavaVersion.VERSION_1_7
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
}
// Rename the aar correctly
@@ -77,8 +81,8 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
- sourceCompatibility = JavaVersion.VERSION_1_7
- targetCompatibility = JavaVersion.VERSION_1_7
+ sourceCompatibility = JavaVersion.VERSION_1_6
+ targetCompatibility = JavaVersion.VERSION_1_6
install {
repositories.mavenInstaller {
@@ -93,12 +97,13 @@ 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"
jersey_version = "2.6"
commons_io_version=2.5
commons_lang3_version=3.6
junit_version = "4.12"
+ threetenbp_version = "2.6.4"
}
dependencies {
@@ -111,7 +116,7 @@ dependencies {
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:$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-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt
index 43d1633ed87..3d85a70e1d7 100644
--- a/samples/client/petstore/java/jersey2-java6/build.sbt
+++ b/samples/client/petstore/java/jersey2-java6/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.6",
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.6",
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6",
- "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",
"org.apache.commons" % "commons-lang3" % "3.6",
diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml
index a61c7c12307..46ee931b3d4 100644
--- a/samples/client/petstore/java/jersey2-java6/pom.xml
+++ b/samples/client/petstore/java/jersey2-java6/pom.xml
@@ -139,8 +139,8 @@
maven-compiler-plugin
3.6.1
- 1.7
- 1.7
+ 1.6
+ 1.6
@@ -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/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/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/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 @@
+patch('/v2/another-fake/dummy', 'AnotherFakeApi@testSpecialTags');
$app->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 假端點 偽のエンドポイント 가짜 엔드 포인트
*/
$app->post('/v2/fake', 'FakeApi@testEndpointParameters');
diff --git a/samples/server/petstore/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION
index 0628777500b..4395ff59232 100644
--- a/samples/server/petstore/php-slim/.openapi-generator/VERSION
+++ b/samples/server/petstore/php-slim/.openapi-generator/VERSION
@@ -1 +1 @@
-3.1.0-SNAPSHOT
\ No newline at end of file
+3.2.0-SNAPSHOT
\ No newline at end of file
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",
},
{