mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-05 15:06:10 +00:00
Compare commits
12 Commits
travis_tes
...
v3.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
100ec449fe | ||
|
|
790f3d46aa | ||
|
|
7404ecb11e | ||
|
|
a714bf4720 | ||
|
|
9eeedede49 | ||
|
|
3408866b79 | ||
|
|
804094bf51 | ||
|
|
869b17fe29 | ||
|
|
867aaa4c27 | ||
|
|
d43801a9b7 | ||
|
|
7eb2acaf71 | ||
|
|
0bffdf2463 |
27
.travis.yml
27
.travis.yml
@@ -124,27 +124,10 @@ after_success:
|
||||
popd;
|
||||
fi;
|
||||
fi;
|
||||
## docker build and push images to DockerHub (openapi-generator-online, openapi-generator-cli)
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then
|
||||
read -r MVN_VERSION_FOR_DOCKER_TAG < target/ci/version-for-docker-tag.txt;
|
||||
echo "Tag for Docker derived from maven version -> $MVN_VERSION_FOR_DOCKER_TAG";
|
||||
echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin;
|
||||
if [ ! -z "$TRAVIS_TAG" ]; then
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-online;
|
||||
docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-cli;
|
||||
elif [ "$TRAVIS_BRANCH" == "master" ]; then
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-online;
|
||||
docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-cli;
|
||||
else
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-online;
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-cli;
|
||||
fi;
|
||||
if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "3.1.x" ] || [ "$TRAVIS_BRANCH" == "4.0.x" ]; then
|
||||
docker push $DOCKER_GENERATOR_IMAGE_NAME;
|
||||
echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME";
|
||||
docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME;
|
||||
echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME";
|
||||
fi;
|
||||
fi;
|
||||
## docker: build and push openapi-generator-online to DockerHub
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME && echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME"; fi; fi
|
||||
## docker: build cli image and push to Docker Hub
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME && echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi
|
||||
|
||||
env:
|
||||
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<url>https://github.com/openapi-tools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapi-tools/openapi-generator.git</connection>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x
|
||||
28
README.md
28
README.md
@@ -81,7 +81,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
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.1.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
|
||||
3.1.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0/)| TBD | 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
|
||||
[3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
@@ -120,7 +120,7 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
||||
</dependency>
|
||||
```
|
||||
* See the different versions of the [openapi-generator-maven-plugin](https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin) artifact available on maven central.
|
||||
* [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.adoc)
|
||||
* [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md)
|
||||
|
||||
**Gradle plugin:**
|
||||
```xml
|
||||
@@ -137,16 +137,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.0.3/openapi-generator-cli-3.0.3.jar`
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.1.0/openapi-generator-cli-3.1.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.3/openapi-generator-cli-3.0.3.jar -O openapi-generator-cli.jar
|
||||
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
|
||||
```
|
||||
|
||||
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.0.3/openapi-generator-cli-3.0.3.jar
|
||||
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
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -193,22 +193,6 @@ To reinstall with the latest master, run `brew reinstall --HEAD openapi-generato
|
||||
- [https://hub.docker.com/r/openapitools/openapi-generator-cli/](https://hub.docker.com/r/openapitools/openapi-generator-cli/) (official CLI)
|
||||
- [https://hub.docker.com/r/openapitools/openapi-generator-online/](https://hub.docker.com/r/openapitools/openapi-generator-online/) (official web service)
|
||||
|
||||
#### Docker tags
|
||||
|
||||
`lastest` Tag contains the continuously built version from our `master` branch.
|
||||
|
||||
`v0.0.0` Tags correspond to a released version in this git repository. Examples:
|
||||
|
||||
* `v3.0.0` Tag
|
||||
* `v3.0.1` Tag
|
||||
* `v3.0.2` Tag
|
||||
|
||||
`0.0.x` Tags correspond to continuously built versions (after each commit), regardless of the branch it is built from. Examples:
|
||||
|
||||
* `3.0.x` Tag: contains first `3.0.2-SNAPSHOT` and after the `3.0.2` release it contains `3.0.3-SNAPSHOT` and so on.
|
||||
* `3.1.x` Tag: contains first `3.1.0-SNAPSHOT` and after the `3.1.0` release it contains `3.1.1-SNAPSHOT` and so on.
|
||||
* `4.0.x` Tag: contains first `4.0.0-SNAPSHOT` and after the `4.0.0` release it contains `4.0.1-SNAPSHOT` and so on.
|
||||
|
||||
|
||||
#### OpenAPI Generator CLI Docker Image
|
||||
|
||||
@@ -586,7 +570,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Elixir | |
|
||||
| Elm | |
|
||||
| Erlang | @tsloughter (2017/11) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) |
|
||||
| Groovy | |
|
||||
| Haskell | |
|
||||
| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) |
|
||||
|
||||
@@ -25,6 +25,9 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/go/go-petstore-withXml"
|
||||
rm -rf samples/client/petstore/go/go-petstore-withXml
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore-withXml -DpackageName=petstore,withXml=true $@"
|
||||
|
||||
@@ -25,6 +25,9 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/go/go-petstore"
|
||||
rm -rf samples/client/petstore/go/go-petstore
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore -DpackageName=petstore $@"
|
||||
|
||||
@@ -25,6 +25,11 @@ sleep 5
|
||||
./bin/php-slim-petstore-server.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
|
||||
./bin/typescript-fetch-petstore-all.sh > /dev/null 2>&1
|
||||
./bin/typescript-node-petstore-all.sh > /dev/null 2>&1
|
||||
./bin/typescript-inversify-petstore.sh > /dev/null 2>&1
|
||||
|
||||
|
||||
# Check:
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -g typescript-angular -o samples\client\petstore\typescript-angular-v2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -4,9 +4,6 @@ If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\default --additional-properties ngVersion=6.0.0
|
||||
REM it is same like like setting -D providedInRoot=true
|
||||
REM set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin\typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm -D providedInRoot=true --additional-properties ngVersion=6.0.0
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm --additional-properties ngVersion=6.0.0
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -4,9 +4,6 @@ If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\default --additional-properties ngVersion=6.0.0
|
||||
REM it is same like like setting -D providedInRoot=true
|
||||
REM set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default -D providedInRoot=true --additional-properties ngVersion=6.0.0
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default --additional-properties ngVersion=6.0.0
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@ECHO OFF
|
||||
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
@@ -7,8 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
|
||||
echo
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify\builds\default
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
2
bin/windows/typescript-node-petstore-all.bat
Normal file
2
bin/windows/typescript-node-petstore-all.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
call .\bin\windows\typescript-node-petstore.bat
|
||||
call .\bin\windows\typescript-node-petstore-with-npm.bat
|
||||
0
bin/windows/typescript-node-with-npm.bat → bin/windows/typescript-node-petstore-with-npm.bat
Executable file → Normal file
0
bin/windows/typescript-node-with-npm.bat → bin/windows/typescript-node-petstore-with-npm.bat
Executable file → Normal file
0
bin/windows/typescript-node.bat → bin/windows/typescript-node-petstore.bat
Executable file → Normal file
0
bin/windows/typescript-node.bat → bin/windows/typescript-node-petstore.bat
Executable file → Normal file
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openApiGeneratorVersion=3.1.0-SNAPSHOT
|
||||
openApiGeneratorVersion=3.1.0
|
||||
|
||||
# BEGIN placeholders
|
||||
# these are just placeholders to allow contributors to build directly
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
|
||||
@@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine
|
||||
|
||||
WORKDIR /generator
|
||||
|
||||
COPY target/openapi-generator-online-3.1.0-SNAPSHOT.jar /generator/openapi-generator-online.jar
|
||||
COPY target/openapi-generator-online-3.1.0.jar /generator/openapi-generator-online.jar
|
||||
|
||||
ENV GENERATOR_HOST=http://localhost
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>openapi-generator-online</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -265,6 +265,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
// Not using the supertype invocation, because we want to UpperCamelize
|
||||
// the type.
|
||||
String openAPIType = getSchemaType(p);
|
||||
String ref = p.get$ref();
|
||||
if(ref != null && !ref.isEmpty()) {
|
||||
String tryRefV2 = "#/definitions/" + openAPIType;
|
||||
String tryRefV3 = "#/components/schemas/" + openAPIType;
|
||||
if(ref.equals(tryRefV2) || ref.equals(tryRefV3)) {
|
||||
return toModelName(openAPIType);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeMapping.containsKey(openAPIType)) {
|
||||
return typeMapping.get(openAPIType);
|
||||
}
|
||||
@@ -283,8 +292,12 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
@Override
|
||||
public String getSchemaType(Schema p) {
|
||||
String openAPIType = super.getSchemaType(p);
|
||||
String ref = p.get$ref();
|
||||
String type = null;
|
||||
if (typeMapping.containsKey(openAPIType)) {
|
||||
|
||||
if(ref != null && !ref.isEmpty()) {
|
||||
type = openAPIType;
|
||||
} else if (typeMapping.containsKey(openAPIType)) {
|
||||
type = typeMapping.get(openAPIType);
|
||||
if (languageSpecificPrimitives.contains(type))
|
||||
return (type);
|
||||
|
||||
@@ -57,18 +57,6 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public NodeJSServerCodegen() {
|
||||
super();
|
||||
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append(System.lineSeparator()).append(System.lineSeparator())
|
||||
.append("=======================================================================================")
|
||||
.append(System.lineSeparator())
|
||||
.append("Currently, Node.js server doesn't work as its dependency doesn't support OpenAPI Spec3.")
|
||||
.append(System.lineSeparator())
|
||||
.append("For further details, see https://github.com/OpenAPITools/openapi-generator/issues/34")
|
||||
.append(System.lineSeparator())
|
||||
.append("=======================================================================================")
|
||||
.append(System.lineSeparator()).append(System.lineSeparator());
|
||||
LOGGER.warn(message.toString());
|
||||
|
||||
// set the output folder here
|
||||
outputFolder = "generated-code/nodejs";
|
||||
|
||||
@@ -310,6 +298,18 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append(System.lineSeparator()).append(System.lineSeparator())
|
||||
.append("=======================================================================================")
|
||||
.append(System.lineSeparator())
|
||||
.append("Currently, Node.js server doesn't work as its dependency doesn't support OpenAPI Spec3.")
|
||||
.append(System.lineSeparator())
|
||||
.append("For further details, see https://github.com/OpenAPITools/openapi-generator/issues/34")
|
||||
.append(System.lineSeparator())
|
||||
.append("=======================================================================================")
|
||||
.append(System.lineSeparator()).append(System.lineSeparator());
|
||||
LOGGER.warn(message.toString());
|
||||
|
||||
if (additionalProperties.containsKey(GOOGLE_CLOUD_FUNCTIONS)) {
|
||||
setGoogleCloudFunctions(
|
||||
Boolean.valueOf(additionalProperties.get(GOOGLE_CLOUD_FUNCTIONS).toString()));
|
||||
|
||||
@@ -48,13 +48,11 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||
variableNamingConvention = "camelCase";
|
||||
artifactVersion = "1.0.0";
|
||||
packagePath = ""; // empty packagePath (top folder)
|
||||
invokerPackage = camelize("OpenAPIServer");
|
||||
modelPackage = packagePath + "\\Models";
|
||||
apiPackage = packagePath;
|
||||
setInvokerPackage("OpenAPIServer");
|
||||
apiPackage = invokerPackage + "\\" + apiDirName;
|
||||
modelPackage = invokerPackage + "\\" + modelDirName;
|
||||
outputFolder = "generated-code" + File.separator + "slim";
|
||||
|
||||
// no api files
|
||||
apiTemplateFiles.clear();
|
||||
// no test files
|
||||
apiTestTemplateFiles.clear();
|
||||
// no doc files
|
||||
@@ -63,11 +61,9 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||
|
||||
embeddedTemplateDir = templateDir = "php-slim-server";
|
||||
|
||||
// additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||
additionalProperties.put(CodegenConstants.GROUP_ID, groupId);
|
||||
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
|
||||
// additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
|
||||
|
||||
|
||||
// override cliOptions from AbstractPhpCodegen
|
||||
for (CliOption co : cliOptions) {
|
||||
if (co.getOpt().equals(AbstractPhpCodegen.VARIABLE_NAMING_CONVENTION)) {
|
||||
@@ -76,12 +72,6 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
supportingFiles.add(new SupportingFile("README.mustache", packagePath.replace('/', File.separatorChar), "README.md"));
|
||||
supportingFiles.add(new SupportingFile("composer.json", packagePath.replace('/', File.separatorChar), "composer.json"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", packagePath.replace('/', File.separatorChar), "index.php"));
|
||||
supportingFiles.add(new SupportingFile(".htaccess", packagePath.replace('/', File.separatorChar), ".htaccess"));
|
||||
supportingFiles.add(new SupportingFile(".gitignore", packagePath.replace('/', File.separatorChar), ".gitignore"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,6 +89,37 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
|
||||
return "Generates a PHP Slim Framework server library.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiFileFolder() {
|
||||
if (apiPackage.matches("^" + invokerPackage + "\\\\*(.+)")) {
|
||||
// need to strip out invokerPackage from path
|
||||
return (outputFolder + File.separator + toPackagePath(apiPackage.replaceFirst("^" + invokerPackage + "\\\\*(.+)", "$1"), srcBasePath));
|
||||
}
|
||||
return (outputFolder + File.separator + toPackagePath(apiPackage, srcBasePath));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
if (modelPackage.matches("^" + invokerPackage + "\\\\*(.+)")) {
|
||||
// need to strip out invokerPackage from path
|
||||
return (outputFolder + File.separator + toPackagePath(modelPackage.replaceFirst("^" + invokerPackage + "\\\\*(.+)", "$1"), srcBasePath));
|
||||
}
|
||||
return (outputFolder + File.separator + toPackagePath(modelPackage, srcBasePath));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md"));
|
||||
supportingFiles.add(new SupportingFile("composer.mustache", getPackagePath(), "composer.json"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", getPackagePath(), "index.php"));
|
||||
supportingFiles.add(new SupportingFile(".htaccess", getPackagePath(), ".htaccess"));
|
||||
supportingFiles.add(new SupportingFile(".gitignore", getPackagePath(), ".gitignore"));
|
||||
supportingFiles.add(new SupportingFile("AbstractApiController.mustache", toSrcPath(invokerPackage, srcBasePath), "AbstractApiController.php"));
|
||||
supportingFiles.add(new SupportingFile("SlimRouter.mustache", toSrcPath(invokerPackage, srcBasePath), "SlimRouter.php"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
||||
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Abstract Api Controller
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package {{invokerPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://github.com/openapitools/openapi-generator
|
||||
*/
|
||||
|
||||
/**
|
||||
{{#appName}}
|
||||
* {{{appName}}}
|
||||
*
|
||||
{{/appName}}
|
||||
{{#appDescription}}
|
||||
* {{{appDescription}}}
|
||||
{{/appDescription}}
|
||||
{{#version}}
|
||||
* OpenAPI spec version: {{{version}}}
|
||||
{{/version}}
|
||||
{{#infoEmail}}
|
||||
* Contact: {{{infoEmail}}}
|
||||
{{/infoEmail}}
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the openapi generator program.
|
||||
* https://github.com/openapitools/openapi-generator
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
namespace {{invokerPackage}};
|
||||
|
||||
/**
|
||||
* ApiServer Class Doc Comment
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package {{invokerPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://github.com/openapitools/openapi-generator
|
||||
*/
|
||||
abstract class AbstractApiController {
|
||||
|
||||
/**
|
||||
* @var \Interop\Container\ContainerInterface Slim app container instance
|
||||
*/
|
||||
protected $container;
|
||||
|
||||
/**
|
||||
* Route Controller constructor receives container
|
||||
*
|
||||
* @param \Interop\Container\ContainerInterface $container Slim app container instance
|
||||
*/
|
||||
public function __construct($container) {
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* SlimRouter
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package {{invokerPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://github.com/openapitools/openapi-generator
|
||||
*/
|
||||
|
||||
/**{{#apiInfo}}{{#appName}}
|
||||
* {{{appName}}}
|
||||
*
|
||||
{{/appName}}
|
||||
{{#appDescription}}
|
||||
* {{{appDescription}}}
|
||||
{{/appDescription}}
|
||||
{{#version}}
|
||||
* OpenAPI spec version: {{{version}}}
|
||||
{{/version}}
|
||||
{{#infoEmail}}
|
||||
* Contact: {{{infoEmail}}}
|
||||
{{/infoEmail}}
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the openapi generator program.
|
||||
* https://github.com/openapitools/openapi-generator
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
namespace {{invokerPackage}};
|
||||
|
||||
{{#apis}}
|
||||
use {{apiPackage}}\{{classname}};
|
||||
{{/apis}}
|
||||
use Slim\App;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* SlimRouter Class Doc Comment
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package {{apiPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://github.com/openapitools/openapi-generator
|
||||
*/
|
||||
class SlimRouter {
|
||||
|
||||
/**
|
||||
* @var $slimApp Slim\App instance
|
||||
*/
|
||||
private $slimApp;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @param ContainerInterface|array $container Either a ContainerInterface or an associative array of app settings
|
||||
* @throws InvalidArgumentException when no container is provided that implements ContainerInterface
|
||||
*/
|
||||
public function __construct($container = []) {
|
||||
$app = new App($container);
|
||||
|
||||
{{#apis}}
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
$app->{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', {{classname}}::class . ':{{operationId}}');
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
{{/apis}}
|
||||
|
||||
$this->slimApp = $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Slim Framework instance
|
||||
* @return App
|
||||
*/
|
||||
public function getSlimApp() {
|
||||
return $this->slimApp;
|
||||
}
|
||||
}
|
||||
{{/apiInfo}}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* {{classname}}
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package {{apiPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://github.com/openapitools/openapi-generator
|
||||
*/
|
||||
|
||||
/**
|
||||
{{#appName}}
|
||||
* {{{appName}}}
|
||||
*
|
||||
{{/appName}}
|
||||
{{#appDescription}}
|
||||
* {{{appDescription}}}
|
||||
{{/appDescription}}
|
||||
{{#version}}
|
||||
* OpenAPI spec version: {{{version}}}
|
||||
{{/version}}
|
||||
{{#infoEmail}}
|
||||
* Contact: {{{infoEmail}}}
|
||||
{{/infoEmail}}
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the openapi generator program.
|
||||
* https://github.com/openapitools/openapi-generator
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
namespace {{apiPackage}};
|
||||
|
||||
use {{invokerPackage}}\AbstractApiController;
|
||||
|
||||
/**
|
||||
* {{classname}} Class Doc Comment
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package {{apiPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://github.com/openapitools/openapi-generator
|
||||
*/
|
||||
class {{classname}} extends AbstractApiController {
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
/**
|
||||
* {{httpMethod}} {{operationId}}
|
||||
* Summary: {{summary}}
|
||||
* Notes: {{notes}}
|
||||
{{#hasProduces}}
|
||||
* Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]
|
||||
{{/hasProduces}}
|
||||
*
|
||||
* @param \Psr\Http\Message\ServerRequestInterface $request Request
|
||||
* @param \Psr\Http\Message\ResponseInterface $response Response
|
||||
* @param array|null $args Path arguments
|
||||
*/
|
||||
public function {{operationId}}($request, $response, $args) {
|
||||
{{#hasHeaderParams}}
|
||||
$headers = $request->getHeaders();
|
||||
{{#headerParams}}
|
||||
${{paramName}} = $request->hasHeader('{{baseName}}') ? $headers['{{baseName}}'] : null;
|
||||
{{/headerParams}}
|
||||
{{/hasHeaderParams}}
|
||||
{{#hasPathParams}}
|
||||
{{#pathParams}}
|
||||
${{paramName}} = $args['{{baseName}}'];
|
||||
{{/pathParams}}
|
||||
{{/hasPathParams}}
|
||||
{{#hasQueryParams}}
|
||||
$queryParams = $request->getQueryParams();
|
||||
{{#queryParams}}
|
||||
${{paramName}} = $request->getQueryParam('{{baseName}}');
|
||||
{{/queryParams}}
|
||||
{{/hasQueryParams}}
|
||||
{{#hasFormParams}}
|
||||
{{#formParams}}
|
||||
{{^isFile}}
|
||||
${{paramName}} = $request->getParsedBodyParam('{{baseName}}');
|
||||
{{/isFile}}
|
||||
{{#isFile}}
|
||||
${{paramName}} = (key_exists('{{baseName}}', $request->getUploadedFiles())) ? $request->getUploadedFiles()['{{baseName}}'] : null;
|
||||
{{/isFile}}
|
||||
{{/formParams}}
|
||||
{{/hasFormParams}}
|
||||
{{#hasBodyParam}}
|
||||
$body = $request->getParsedBody();
|
||||
{{/hasBodyParam}}
|
||||
$response->write('How about implementing {{nickname}} as a {{httpMethod}} method ?');
|
||||
return $response;
|
||||
}
|
||||
{{#hasMore}}{{/hasMore}}
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"minimum-stability": "RC",
|
||||
"require": {
|
||||
"slim/slim": "3.*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"minimum-stability": "RC",
|
||||
"require": {
|
||||
"slim/slim": "3.*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "{{escapedInvokerPackage}}\\": "{{srcBasePath}}/" }
|
||||
}
|
||||
}
|
||||
@@ -6,52 +6,9 @@
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
$app = new Slim\App();
|
||||
|
||||
{{#apis}}{{#operations}}{{#operation}}
|
||||
/**
|
||||
* {{httpMethod}} {{nickname}}
|
||||
* Summary: {{summary}}
|
||||
* Notes: {{notes}}
|
||||
{{#hasProduces}}
|
||||
* Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]
|
||||
{{/hasProduces}}
|
||||
*/
|
||||
$app->{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', function($request, $response, $args) {
|
||||
{{#hasHeaderParams}}
|
||||
$headers = $request->getHeaders();
|
||||
{{#headerParams}}
|
||||
${{paramName}} = $request->hasHeader('{{baseName}}') ? $headers['{{baseName}}'] : null;
|
||||
{{/headerParams}}
|
||||
{{/hasHeaderParams}}
|
||||
{{#hasPathParams}}
|
||||
{{#pathParams}}
|
||||
${{paramName}} = $args['{{baseName}}'];
|
||||
{{/pathParams}}
|
||||
{{/hasPathParams}}
|
||||
{{#hasQueryParams}}
|
||||
$queryParams = $request->getQueryParams();
|
||||
{{#queryParams}}
|
||||
${{paramName}} = $request->getQueryParam('{{baseName}}');
|
||||
{{/queryParams}}
|
||||
{{/hasQueryParams}}
|
||||
{{#hasFormParams}}
|
||||
{{#formParams}}
|
||||
{{^isFile}}
|
||||
${{paramName}} = $request->getParsedBodyParam('{{baseName}}');
|
||||
{{/isFile}}
|
||||
{{#isFile}}
|
||||
${{paramName}} = (key_exists('{{baseName}}', $request->getUploadedFiles())) ? $request->getUploadedFiles()['{{baseName}}'] : null;
|
||||
{{/isFile}}
|
||||
{{/formParams}}
|
||||
{{/hasFormParams}}
|
||||
{{#hasBodyParam}}
|
||||
$body = $request->getParsedBody();
|
||||
{{/hasBodyParam}}
|
||||
$response->write('How about implementing {{nickname}} as a {{httpMethod}} method ?');
|
||||
return $response;
|
||||
});
|
||||
|
||||
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||
use {{invokerPackage}}\SlimRouter;
|
||||
{{/apiInfo}}
|
||||
|
||||
$router = new SlimRouter();
|
||||
$app = $router->getSlimApp();
|
||||
$app->run();
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
<?php
|
||||
{{#models}}{{#model}}/*
|
||||
{{#models}}{{#model}}/**
|
||||
* {{classname}}
|
||||
*/
|
||||
namespace {{package}};
|
||||
namespace {{modelPackage}};
|
||||
|
||||
/*
|
||||
/**
|
||||
* {{classname}}
|
||||
*/
|
||||
class {{classname}} {
|
||||
{{#vars}}/* @var {{dataType}} ${{name}} {{#description}}{{description}}{{/description}} */
|
||||
|
||||
{{#vars}}
|
||||
/** @var {{dataType}} ${{name}} {{#description}}{{description}}{{/description}}*/
|
||||
private ${{name}};
|
||||
|
||||
{{/vars}}
|
||||
}
|
||||
{{/model}}{{/models}}
|
||||
@@ -254,6 +254,22 @@ public class GoModelTest {
|
||||
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
|
||||
}
|
||||
|
||||
@Test(description = "convert file type and file schema models")
|
||||
public void filePropertyTest() {
|
||||
final DefaultCodegen codegen = new GoClientCodegen();
|
||||
final Schema model1 = new Schema().type("file");
|
||||
Assert.assertEquals(codegen.getSchemaType(model1), "*os.File");
|
||||
Assert.assertEquals(codegen.getTypeDeclaration(model1), "*os.File");
|
||||
|
||||
final Schema model2 = new Schema().$ref("#/definitions/File");
|
||||
Assert.assertEquals(codegen.getSchemaType(model2), "File");
|
||||
Assert.assertEquals(codegen.getTypeDeclaration(model2), "File");
|
||||
|
||||
final Schema model3 = new Schema().$ref("#/components/schemas/File");
|
||||
Assert.assertEquals(codegen.getSchemaType(model3), "File");
|
||||
Assert.assertEquals(codegen.getTypeDeclaration(model3), "File");
|
||||
}
|
||||
|
||||
@DataProvider(name = "modelNames")
|
||||
public static Object[][] primeNumbers() {
|
||||
return new Object[][] {
|
||||
|
||||
@@ -947,6 +947,23 @@ paths:
|
||||
description: successful operation
|
||||
schema:
|
||||
$ref: '#/definitions/Client'
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
tags:
|
||||
- fake
|
||||
description: 'For this test, the body for this request much reference a schema named `File`.'
|
||||
operationId: testBodyWithFileSchema
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/FileSchemaTestClass'
|
||||
consumes:
|
||||
- application/json
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'/fake/{petId}/uploadImageWithRequiredFile':
|
||||
post:
|
||||
tags:
|
||||
@@ -1474,7 +1491,7 @@ definitions:
|
||||
# - Cat
|
||||
# - Dog
|
||||
OuterEnum:
|
||||
type: "string"
|
||||
type: string
|
||||
enum:
|
||||
- "placed"
|
||||
- "approved"
|
||||
@@ -1498,3 +1515,19 @@ definitions:
|
||||
StringBooleanMap:
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
FileSchemaTestClass:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
$ref: "#/definitions/File"
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/File"
|
||||
File:
|
||||
type: object
|
||||
desription: 'Must be named `File` for test.'
|
||||
properties:
|
||||
sourceURI:
|
||||
description: 'Test capitalization'
|
||||
type: string
|
||||
|
||||
@@ -912,6 +912,23 @@ paths:
|
||||
$ref: '#/components/schemas/Client'
|
||||
requestBody:
|
||||
$ref: '#/components/requestBodies/Client'
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
tags:
|
||||
- fake
|
||||
description: >-
|
||||
For this test, the body for this request much reference a schema named
|
||||
`File`.
|
||||
operationId: testBodyWithFileSchema
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FileSchemaTestClass'
|
||||
required: true
|
||||
'/fake/{petId}/uploadImageWithRequiredFile':
|
||||
post:
|
||||
tags:
|
||||
@@ -1375,6 +1392,12 @@ components:
|
||||
enum:
|
||||
- UPPER
|
||||
- lower
|
||||
direct_map:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
indirect_map:
|
||||
$ref: '#/components/schemas/StringBooleanMap'
|
||||
ArrayTest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1453,6 +1476,25 @@ components:
|
||||
OuterBoolean:
|
||||
type: boolean
|
||||
x-codegen-body-parameter-name: boolean_post_body
|
||||
StringBooleanMap:
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
FileSchemaTestClass:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
$ref: '#/components/schemas/File'
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
File:
|
||||
type: object
|
||||
description: Must be named `File` for test.
|
||||
properties:
|
||||
sourceURI:
|
||||
description: Test capitalization
|
||||
type: string
|
||||
_special_model.name_:
|
||||
properties:
|
||||
'$special[property.name]':
|
||||
|
||||
37
pom.xml
37
pom.xml
@@ -9,7 +9,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.1.0</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
@@ -101,41 +101,6 @@
|
||||
<directory>target</directory>
|
||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>parse-version</id>
|
||||
<goals>
|
||||
<goal>parse-version</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/CI/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.revelc.code</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
sw "./go-petstore"
|
||||
|
||||
29
samples/client/petstore/go/fake_api_test.go
Normal file
29
samples/client/petstore/go/fake_api_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
sw "./go-petstore"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// TestPutBodyWithFileSchema ensures a model with the name 'File'
|
||||
// gets converted properly to the petstore.File struct vs. *os.File
|
||||
// as specified in typeMapping for 'File'.
|
||||
func TestPutBodyWithFileSchema(t *testing.T) {
|
||||
return // early return to test compilation
|
||||
|
||||
schema := sw.FileSchemaTestClass{
|
||||
File: sw.File{SourceURI: "https://example.com/image.png"},
|
||||
Files: []sw.File{{SourceURI: "https://example.com/image.png"}}}
|
||||
|
||||
r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Error while adding pet")
|
||||
t.Log(err)
|
||||
}
|
||||
if r.StatusCode != 200 {
|
||||
t.Log(r)
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,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 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -83,6 +84,8 @@ Class | Method | HTTP request | Description
|
||||
- [EnumArrays](docs/EnumArrays.md)
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [File](docs/File.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [List](docs/List.md)
|
||||
|
||||
@@ -973,6 +973,22 @@ paths:
|
||||
summary: To test special tags
|
||||
tags:
|
||||
- $another-fake?
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
description: For this test, the body for this request much reference a schema named `File`.
|
||||
operationId: testBodyWithFileSchema
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FileSchemaTestClass'
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: Success
|
||||
tags:
|
||||
- fake
|
||||
/fake/{petId}/uploadImageWithRequiredFile:
|
||||
post:
|
||||
operationId: uploadFileWithRequiredFile
|
||||
@@ -1413,6 +1429,21 @@ components:
|
||||
OuterBoolean:
|
||||
type: boolean
|
||||
x-codegen-body-parameter-name: boolean_post_body
|
||||
FileSchemaTestClass:
|
||||
example:
|
||||
file:
|
||||
sourceURI: sourceURI
|
||||
files:
|
||||
- sourceURI: sourceURI
|
||||
- sourceURI: sourceURI
|
||||
properties:
|
||||
file:
|
||||
$ref: '#/components/schemas/File'
|
||||
files:
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
type: array
|
||||
type: object
|
||||
Animal:
|
||||
discriminator:
|
||||
propertyName: className
|
||||
@@ -1475,6 +1506,14 @@ components:
|
||||
items:
|
||||
$ref: '#/components/schemas/Animal'
|
||||
type: array
|
||||
File:
|
||||
example:
|
||||
sourceURI: sourceURI
|
||||
properties:
|
||||
sourceURI:
|
||||
description: Test capitalization
|
||||
type: string
|
||||
type: object
|
||||
Pet:
|
||||
example:
|
||||
photoUrls:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -414,6 +414,73 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param fileSchemaTestClass
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||
if localVarHttpContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
if localVarHttpHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &fileSchemaTestClass
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHttpResponse, err := a.client.callAPI(r)
|
||||
if err != nil || localVarHttpResponse == nil {
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite |
|
||||
[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number |
|
||||
[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string |
|
||||
[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema |
|
||||
[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params |
|
||||
[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model
|
||||
[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -38,7 +39,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**bool**
|
||||
[**bool**](boolean.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -108,7 +109,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**float32**
|
||||
[**float32**](number.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -156,6 +157,34 @@ No authorization required
|
||||
|
||||
[[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)
|
||||
|
||||
# **TestBodyWithFileSchema**
|
||||
> TestBodyWithFileSchema(ctx, fileSchemaTestClass)
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **TestBodyWithQueryParams**
|
||||
> TestBodyWithQueryParams(ctx, query, user)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# OuterNumber
|
||||
# File
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**SourceURI** | **string** | Test capitalization | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**File** | [**File**](File.md) | | [optional]
|
||||
**Files** | [**[]File**](File.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# ModelApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Code** | **int32** | | [optional] [default to null]
|
||||
**Type_** | **string** | | [optional] [default to null]
|
||||
**Message** | **string** | | [optional] [default to null]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
/*
|
||||
* Swagger Petstore
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type OuterNumber struct {
|
||||
type File struct {
|
||||
// Test capitalization
|
||||
SourceURI string `json:"sourceURI,omitempty" xml:"sourceURI"`
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type FileSchemaTestClass struct {
|
||||
File File `json:"file,omitempty" xml:"file"`
|
||||
Files []File `json:"files,omitempty" xml:"files"`
|
||||
}
|
||||
@@ -35,6 +35,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 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -83,6 +84,8 @@ Class | Method | HTTP request | Description
|
||||
- [EnumArrays](docs/EnumArrays.md)
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [File](docs/File.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [List](docs/List.md)
|
||||
|
||||
@@ -973,6 +973,22 @@ paths:
|
||||
summary: To test special tags
|
||||
tags:
|
||||
- $another-fake?
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
description: For this test, the body for this request much reference a schema named `File`.
|
||||
operationId: testBodyWithFileSchema
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FileSchemaTestClass'
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: Success
|
||||
tags:
|
||||
- fake
|
||||
/fake/{petId}/uploadImageWithRequiredFile:
|
||||
post:
|
||||
operationId: uploadFileWithRequiredFile
|
||||
@@ -1413,6 +1429,21 @@ components:
|
||||
OuterBoolean:
|
||||
type: boolean
|
||||
x-codegen-body-parameter-name: boolean_post_body
|
||||
FileSchemaTestClass:
|
||||
example:
|
||||
file:
|
||||
sourceURI: sourceURI
|
||||
files:
|
||||
- sourceURI: sourceURI
|
||||
- sourceURI: sourceURI
|
||||
properties:
|
||||
file:
|
||||
$ref: '#/components/schemas/File'
|
||||
files:
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
type: array
|
||||
type: object
|
||||
Animal:
|
||||
discriminator:
|
||||
propertyName: className
|
||||
@@ -1475,6 +1506,14 @@ components:
|
||||
items:
|
||||
$ref: '#/components/schemas/Animal'
|
||||
type: array
|
||||
File:
|
||||
example:
|
||||
sourceURI: sourceURI
|
||||
properties:
|
||||
sourceURI:
|
||||
description: Test capitalization
|
||||
type: string
|
||||
type: object
|
||||
Pet:
|
||||
example:
|
||||
photoUrls:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -414,6 +414,73 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param fileSchemaTestClass
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||
if localVarHttpContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHttpContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
if localVarHttpHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &fileSchemaTestClass
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHttpResponse, err := a.client.callAPI(r)
|
||||
if err != nil || localVarHttpResponse == nil {
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||
localVarHttpResponse.Body.Close()
|
||||
if err != nil {
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite |
|
||||
[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number |
|
||||
[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string |
|
||||
[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema |
|
||||
[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params |
|
||||
[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model
|
||||
[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -38,7 +39,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**bool**
|
||||
[**bool**](boolean.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -108,7 +109,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**float32**
|
||||
[**float32**](number.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -156,6 +157,34 @@ No authorization required
|
||||
|
||||
[[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)
|
||||
|
||||
# **TestBodyWithFileSchema**
|
||||
> TestBodyWithFileSchema(ctx, fileSchemaTestClass)
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
(empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
# **TestBodyWithQueryParams**
|
||||
> TestBodyWithQueryParams(ctx, query, user)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# OuterBoolean
|
||||
# File
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**SourceURI** | **string** | Test capitalization | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**File** | [**File**](File.md) | | [optional]
|
||||
**Files** | [**[]File**](File.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
/*
|
||||
* Swagger Petstore
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type OuterBoolean struct {
|
||||
type File struct {
|
||||
// Test capitalization
|
||||
SourceURI string `json:"sourceURI,omitempty"`
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
/*
|
||||
* Swagger Petstore
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type OuterString struct {
|
||||
type FileSchemaTestClass struct {
|
||||
File File `json:"file,omitempty"`
|
||||
Files []File `json:"files,omitempty"`
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
sw "./go-petstore"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/antihax/optional"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
sw "./go-petstore"
|
||||
)
|
||||
|
||||
var client *sw.APIClient
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
sw "./go-petstore"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func TestPlaceOrder(t *testing.T) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
sw "./go-petstore"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
sw "./go-petstore"
|
||||
)
|
||||
|
||||
func TestCreateUser(t *testing.T) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.openapitools.client.EncodingUtils;
|
||||
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;
|
||||
@@ -73,6 +74,18 @@ public interface FakeApi extends ApiClient.Api {
|
||||
})
|
||||
String fakeOuterStringSerialize(String body);
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
*/
|
||||
@RequestLine("PUT /fake/body-with-file-schema")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
|
||||
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;
|
||||
@@ -366,6 +367,90 @@ public class FakeApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* <p><b>200</b> - Success
|
||||
* @param fileSchemaTestClass The fileSchemaTestClass parameter
|
||||
* @throws IOException if an error occurs while attempting to invoke the API
|
||||
**/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws IOException {
|
||||
testBodyWithFileSchemaForHttpResponse(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* <p><b>200</b> - Success
|
||||
* @param fileSchemaTestClass The fileSchemaTestClass parameter
|
||||
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
|
||||
* @throws IOException if an error occurs while attempting to invoke the API
|
||||
**/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass, Map<String, Object> params) throws IOException {
|
||||
testBodyWithFileSchemaForHttpResponse(fileSchemaTestClass, params);
|
||||
}
|
||||
|
||||
public HttpResponse testBodyWithFileSchemaForHttpResponse(FileSchemaTestClass fileSchemaTestClass) throws IOException {
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");
|
||||
|
||||
String url = uriBuilder.build().toString();
|
||||
GenericUrl genericUrl = new GenericUrl(url);
|
||||
|
||||
HttpContent content = apiClient.new JacksonJsonHttpContent(fileSchemaTestClass);
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
|
||||
}
|
||||
|
||||
public HttpResponse testBodyWithFileSchemaForHttpResponse(java.io.InputStream fileSchemaTestClass, String mediaType) throws IOException {
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");
|
||||
|
||||
String url = uriBuilder.build().toString();
|
||||
GenericUrl genericUrl = new GenericUrl(url);
|
||||
|
||||
HttpContent content = fileSchemaTestClass == null ?
|
||||
apiClient.new JacksonJsonHttpContent(null) :
|
||||
new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, fileSchemaTestClass);
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
|
||||
}
|
||||
|
||||
public HttpResponse testBodyWithFileSchemaForHttpResponse(FileSchemaTestClass fileSchemaTestClass, Map<String, Object> params) throws IOException {
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");
|
||||
|
||||
// Copy the params argument if present, to allow passing in immutable maps
|
||||
Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
|
||||
|
||||
for (Map.Entry<String, Object> entry: allParams.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
|
||||
if (key != null && value != null) {
|
||||
if (value instanceof Collection) {
|
||||
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
|
||||
} else if (value instanceof Object[]) {
|
||||
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
|
||||
} else {
|
||||
uriBuilder = uriBuilder.queryParam(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String url = uriBuilder.build().toString();
|
||||
GenericUrl genericUrl = new GenericUrl(url);
|
||||
|
||||
HttpContent content = apiClient.new JacksonJsonHttpContent(fileSchemaTestClass);
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p><b>200</b> - Success
|
||||
* @param query The query parameter
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.openapitools.client.Pair;
|
||||
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;
|
||||
@@ -202,6 +203,47 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType;
|
||||
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;
|
||||
@@ -229,6 +230,57 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return ObjectUtils.equals(this.file, fileSchemaTestClass.file) &&
|
||||
ObjectUtils.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.hashCodeMulti(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
@@ -229,6 +230,57 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType;
|
||||
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;
|
||||
@@ -229,6 +230,57 @@ public class FakeApi {
|
||||
GenericType<String> localVarReturnType = new GenericType<String>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
@JsonProperty("file")
|
||||
private java.io.File file = null;
|
||||
|
||||
@JsonProperty("files")
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.io.IOException;
|
||||
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;
|
||||
@@ -528,6 +529,124 @@ public class FakeApi {
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithFileSchema
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
||||
@Override
|
||||
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
||||
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.build();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private com.squareup.okhttp.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)");
|
||||
}
|
||||
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
return call;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null, null);
|
||||
return apiClient.execute(call);
|
||||
}
|
||||
|
||||
/**
|
||||
* (asynchronously)
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback<Void> callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
apiClient.executeAsync(call, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithQueryParams
|
||||
* @param query (required)
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Parcel;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass implements Parcelable {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeValue(file);
|
||||
out.writeValue(files);
|
||||
}
|
||||
|
||||
FileSchemaTestClass(Parcel in) {
|
||||
file = (java.io.File)in.readValue(java.io.File.class.getClassLoader());
|
||||
files = (List<java.io.File>)in.readValue(java.io.File.class.getClassLoader());
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<FileSchemaTestClass> CREATOR = new Parcelable.Creator<FileSchemaTestClass>() {
|
||||
public FileSchemaTestClass createFromParcel(Parcel in) {
|
||||
return new FileSchemaTestClass(in);
|
||||
}
|
||||
public FileSchemaTestClass[] newArray(int size) {
|
||||
return new FileSchemaTestClass[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -196,6 +197,50 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiException;
|
||||
//import org.openapitools.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.io.IOException;
|
||||
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;
|
||||
@@ -528,6 +529,124 @@ public class FakeApi {
|
||||
apiClient.executeAsync(call, localVarReturnType, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithFileSchema
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param progressListener Progress listener
|
||||
* @param progressRequestListener Progress request listener
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
if(progressListener != null) {
|
||||
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
|
||||
@Override
|
||||
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
|
||||
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
|
||||
return originalResponse.newBuilder()
|
||||
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
.build();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private com.squareup.okhttp.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)");
|
||||
}
|
||||
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
return call;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null, null);
|
||||
return apiClient.execute(call);
|
||||
}
|
||||
|
||||
/**
|
||||
* (asynchronously)
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
*/
|
||||
public com.squareup.okhttp.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback<Void> callback) throws ApiException {
|
||||
|
||||
ProgressResponseBody.ProgressListener progressListener = null;
|
||||
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
||||
|
||||
if (callback != null) {
|
||||
progressListener = new ProgressResponseBody.ProgressListener() {
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
callback.onDownloadProgress(bytesRead, contentLength, done);
|
||||
}
|
||||
};
|
||||
|
||||
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
||||
@Override
|
||||
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
||||
callback.onUploadProgress(bytesWritten, contentLength, done);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
com.squareup.okhttp.Call call = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, progressListener, progressRequestListener);
|
||||
apiClient.executeAsync(call, callback);
|
||||
return call;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithQueryParams
|
||||
* @param query (required)
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file = null;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -180,6 +181,48 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testBodyWithFileSchema()
|
||||
.body(fileSchemaTestClass).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
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;
|
||||
@@ -69,6 +70,10 @@ public class FakeApi {
|
||||
return new FakeOuterStringSerializeOper(reqSpec);
|
||||
}
|
||||
|
||||
public TestBodyWithFileSchemaOper testBodyWithFileSchema() {
|
||||
return new TestBodyWithFileSchemaOper(reqSpec);
|
||||
}
|
||||
|
||||
public TestBodyWithQueryParamsOper testBodyWithQueryParams() {
|
||||
return new TestBodyWithQueryParamsOper(reqSpec);
|
||||
}
|
||||
@@ -415,6 +420,73 @@ public class FakeApi {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
*
|
||||
* @see #body (required)
|
||||
*/
|
||||
public class TestBodyWithFileSchemaOper {
|
||||
|
||||
public static final String REQ_URI = "/fake/body-with-file-schema";
|
||||
|
||||
private RequestSpecBuilder reqSpec;
|
||||
|
||||
private ResponseSpecBuilder respSpec;
|
||||
|
||||
public TestBodyWithFileSchemaOper() {
|
||||
this.reqSpec = new RequestSpecBuilder();
|
||||
reqSpec.setContentType("application/json");
|
||||
reqSpec.setAccept("application/json");
|
||||
this.respSpec = new ResponseSpecBuilder();
|
||||
}
|
||||
|
||||
public TestBodyWithFileSchemaOper(RequestSpecBuilder reqSpec) {
|
||||
this.reqSpec = reqSpec;
|
||||
reqSpec.setContentType("application/json");
|
||||
reqSpec.setAccept("application/json");
|
||||
this.respSpec = new ResponseSpecBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-file-schema
|
||||
* @param handler handler
|
||||
* @param <T> type
|
||||
* @return type
|
||||
*/
|
||||
public <T> T execute(Function<Response, T> handler) {
|
||||
return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(PUT, REQ_URI));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileSchemaTestClass (FileSchemaTestClass) (required)
|
||||
* @return operation
|
||||
*/
|
||||
public TestBodyWithFileSchemaOper body(FileSchemaTestClass fileSchemaTestClass) {
|
||||
reqSpec.setBody(fileSchemaTestClass);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customise request specification
|
||||
* @param consumer consumer
|
||||
* @return operation
|
||||
*/
|
||||
public TestBodyWithFileSchemaOper reqSpec(Consumer<RequestSpecBuilder> consumer) {
|
||||
consumer.accept(reqSpec);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customise response specification
|
||||
* @param consumer consumer
|
||||
* @return operation
|
||||
*/
|
||||
public TestBodyWithFileSchemaOper respSpec(Consumer<ResponseSpecBuilder> consumer) {
|
||||
consumer.accept(respSpec);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user