forked from loafle/openapi-generator-original
Compare commits
2 Commits
v4.1.1
...
java_fix_e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a049e4c271 | ||
|
|
eee7a40629 |
@@ -94,8 +94,6 @@ before_install:
|
|||||||
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
|
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
|
||||||
# - . ~/otp/18.2.1/activate && erl -version
|
# - . ~/otp/18.2.1/activate && erl -version
|
||||||
#- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
|
#- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
|
||||||
# install valgrind for C++ memory test
|
|
||||||
- sudo apt-get install valgrind
|
|
||||||
# install Qt 5.10
|
# install Qt 5.10
|
||||||
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
|
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
|
|||||||
@@ -2,27 +2,12 @@ kind: pipeline
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# test Dart 2.x petstore client
|
|
||||||
- name: dart2x-test
|
|
||||||
image: google/dart
|
|
||||||
commands:
|
|
||||||
- (cd samples/client/petstore/dart-jaguar/openapi && pub get && pub run build_runner build --delete-conflicting-outputs)
|
|
||||||
- (cd samples/client/petstore/dart-jaguar/flutter_petstore/openapi && pub get && pub run build_runner build --delete-conflicting-outputs)
|
|
||||||
- (cd samples/client/petstore/dart2/openapi && pub get && pub run test)
|
|
||||||
# test Java 11 HTTP client
|
# test Java 11 HTTP client
|
||||||
- name: java11-test
|
- name: java11-test
|
||||||
image: openjdk:11.0
|
image: hirokimatsumoto/alpine-openjdk-11
|
||||||
commands:
|
commands:
|
||||||
- ./mvnw clean install
|
- ./mvnw clean install
|
||||||
- ./mvnw --quiet verify -Psamples.droneio
|
- ./mvnw --quiet verify -Psamples.droneio
|
||||||
# test all generators with fake petstore spec (2.0, 3.0)
|
|
||||||
- /bin/bash bin/utils/test-fake-petstore-for-all.sh
|
|
||||||
# generate test scripts
|
|
||||||
- /bin/bash bin/tests/run-all-test
|
|
||||||
# generate all petstore samples (client, servers, doc)
|
|
||||||
- /bin/bash bin/run-all-petstore
|
|
||||||
# generate all petstore samples (openapi3)
|
|
||||||
- /bin/bash bin/openapi3/run-all-petstore
|
|
||||||
# test ocaml petstore client
|
# test ocaml petstore client
|
||||||
- name: ocaml-test
|
- name: ocaml-test
|
||||||
image: ocaml/opam2:4.07
|
image: ocaml/opam2:4.07
|
||||||
|
|||||||
@@ -14,6 +14,14 @@ if [ "$NODE_INDEX" = "1" ]; then
|
|||||||
mvn --quiet verify -Psamples.circleci
|
mvn --quiet verify -Psamples.circleci
|
||||||
mvn --quiet javadoc:javadoc -Psamples.circleci
|
mvn --quiet javadoc:javadoc -Psamples.circleci
|
||||||
|
|
||||||
|
# generate all petstore samples (client, servers, doc)
|
||||||
|
./bin/run-all-petstore
|
||||||
|
# generate all petstore samples (openapi3)
|
||||||
|
./bin/openapi3/run-all-petstore
|
||||||
|
# generate test scripts
|
||||||
|
./bin/tests/run-all-test
|
||||||
|
# test all generators with fake petstore spec (2.0, 3.0)
|
||||||
|
./bin/utils/test-fake-petstore-for-all.sh
|
||||||
elif [ "$NODE_INDEX" = "2" ]; then
|
elif [ "$NODE_INDEX" = "2" ]; then
|
||||||
# run ensure-up-to-date sample script on SNAPSHOT version only
|
# run ensure-up-to-date sample script on SNAPSHOT version only
|
||||||
project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
|
project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
|
||||||
@@ -21,6 +29,12 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
|||||||
echo "Running node $NODE_INDEX to test ensure-up-to-date"
|
echo "Running node $NODE_INDEX to test ensure-up-to-date"
|
||||||
java -version
|
java -version
|
||||||
|
|
||||||
|
# install elm-format for formatting elm code
|
||||||
|
npm install -g elm-format
|
||||||
|
|
||||||
|
# symlink elm-format
|
||||||
|
sudo ln -s /opt/circleci/.nvm/versions/node/v12.1.0/bin/elm-format /usr/local/bin/elm-format
|
||||||
|
|
||||||
./bin/utils/ensure-up-to-date
|
./bin/utils/ensure-up-to-date
|
||||||
fi
|
fi
|
||||||
#elif [ "$NODE_INDEX" = "3" ]; then
|
#elif [ "$NODE_INDEX" = "3" ]; then
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
<project>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>org.openapitools</groupId>
|
|
||||||
<artifactId>TypeScriptFetchBuildPrefixParameterInterfacesPestoreClientTests</artifactId>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<name>TS Fetch Petstore Client (with namespacing for parameter interfaces)</name>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
|
||||||
<version>1.2.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>npm-install</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>npm</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>install</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>npm-build</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>npm</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>run</argument>
|
|
||||||
<argument>build</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>npm-test</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>npm</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>test</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
24
README.md
24
README.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.1.1`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.1.0`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||||
@@ -66,7 +66,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
|||||||
| | Languages/Frameworks |
|
| | Languages/Frameworks |
|
||||||
|-|-|
|
|-|-|
|
||||||
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
|
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
|
||||||
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
|
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
|
||||||
**API documentation generators** | **HTML**, **Confluence Wiki**
|
**API documentation generators** | **HTML**, **Confluence Wiki**
|
||||||
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
||||||
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**
|
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**
|
||||||
@@ -108,8 +108,8 @@ OpenAPI Generator Version | Release Date | Notes
|
|||||||
---------------------------- | ------------ | -----
|
---------------------------- | ------------ | -----
|
||||||
5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback)
|
5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback)
|
||||||
4.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.0-SNAPSHOT/)| 09.10.2019 | Minor release (breaking changes with fallbacks)
|
4.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.0-SNAPSHOT/)| 09.10.2019 | Minor release (breaking changes with fallbacks)
|
||||||
4.1.1 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.1/)| 23.08.2019 | Patch release (bug fixes, enhancements)
|
4.1.1 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.1-SNAPSHOT/)| 23.08.2019 | Patch release (bug fixes, enhancements)
|
||||||
[4.1.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.1) (latest stable release) | 09.08.2019 | Minor release (breaking changes with fallbacks)
|
[4.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.0) (latest stable release) | 09.08.2019 | Minor release (breaking changes with fallbacks)
|
||||||
|
|
||||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||||
|
|
||||||
@@ -165,16 +165,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
|||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
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/4.1.1/openapi-generator-cli-4.1.1.jar`
|
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar`
|
||||||
|
|
||||||
For **Mac/Linux** users:
|
For **Mac/Linux** users:
|
||||||
```sh
|
```sh
|
||||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.1/openapi-generator-cli-4.1.1.jar -O openapi-generator-cli.jar
|
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.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.
|
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/4.1.1/openapi-generator-cli-4.1.1.jar
|
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||||
@@ -389,10 +389,10 @@ openapi-generator version
|
|||||||
```
|
```
|
||||||
|
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
Or install a particular OpenAPI Generator version (e.g. v4.1.1):
|
Or install a particular OpenAPI Generator version (e.g. v4.1.0):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install @openapitools/openapi-generator-cli@cli-4.1.1 -g
|
npm install @openapitools/openapi-generator-cli@cli-4.1.0 -g
|
||||||
```
|
```
|
||||||
|
|
||||||
Or install it as dev-dependency:
|
Or install it as dev-dependency:
|
||||||
@@ -416,7 +416,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
|||||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||||
|
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.1/openapi-generator-cli-4.1.1.jar)
|
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar)
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
|
|
||||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||||
@@ -569,7 +569,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
|||||||
- [Klarna](https://www.klarna.com/)
|
- [Klarna](https://www.klarna.com/)
|
||||||
- [Metaswitch](https://www.metaswitch.com/)
|
- [Metaswitch](https://www.metaswitch.com/)
|
||||||
- [Myworkout](https://myworkout.com)
|
- [Myworkout](https://myworkout.com)
|
||||||
- [Paxos](https://www.paxos.com)
|
|
||||||
- [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager)
|
- [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager)
|
||||||
- [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch)
|
- [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch)
|
||||||
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
|
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
|
||||||
@@ -627,8 +626,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
|||||||
- 2019-07-08 - [OpenAPI Generator にコントリビュートしたら社名が載った話。(CAM) - CAM TECH BLOG](https://tech.cam-inc.co.jp/entry/2019/07/08/140000) by [CAM, Inc.](https://www.cam-inc.co.jp/)
|
- 2019-07-08 - [OpenAPI Generator にコントリビュートしたら社名が載った話。(CAM) - CAM TECH BLOG](https://tech.cam-inc.co.jp/entry/2019/07/08/140000) by [CAM, Inc.](https://www.cam-inc.co.jp/)
|
||||||
- 2019-07-14 - [OpenAPI GeneratorでPythonのクライアントライブラリを作成した](https://qiita.com/yuji38kwmt/items/dfb929316a1335a161c0) by [yuji38kwmt](https://qiita.com/yuji38kwmt)
|
- 2019-07-14 - [OpenAPI GeneratorでPythonのクライアントライブラリを作成した](https://qiita.com/yuji38kwmt/items/dfb929316a1335a161c0) by [yuji38kwmt](https://qiita.com/yuji38kwmt)
|
||||||
- 2019-07-19 - [Developer Experience (DX) for Open-Source Projects: How to Engage Developers and Build a Growing Developer Community](https://speakerdeck.com/wing328/developer-experience-dx-for-open-source-projects-english-japanese) by [William Cheng](https://twitter.com/wing328), [中野暁人](https://github.com/ackintosh) at [Open Source Summit Japan 2019](https://events.linuxfoundation.org/events/open-source-summit-japan-2019/)
|
- 2019-07-19 - [Developer Experience (DX) for Open-Source Projects: How to Engage Developers and Build a Growing Developer Community](https://speakerdeck.com/wing328/developer-experience-dx-for-open-source-projects-english-japanese) by [William Cheng](https://twitter.com/wing328), [中野暁人](https://github.com/ackintosh) at [Open Source Summit Japan 2019](https://events.linuxfoundation.org/events/open-source-summit-japan-2019/)
|
||||||
- 2019-08-14 - [Our OpenAPI journey with Standardizing SDKs](https://bitmovin.com/our-openapi-journey-with-standardizing-sdks/) by [Sebastian Burgstaller](https://bitmovin.com/author/sburgstaller/) at [Bitmovin](https://www.bitmovin.com)
|
|
||||||
- 2019-08-24 - [SwaggerドキュメントからOpenAPI Generatorを使ってモックサーバー作成](https://qiita.com/masayoshi0222/items/4845e4c715d04587c104) by [坂本正義](https://qiita.com/masayoshi0222)
|
|
||||||
|
|
||||||
## [6 - About Us](#table-of-contents)
|
## [6 - About Us](#table-of-contents)
|
||||||
|
|
||||||
@@ -758,7 +755,6 @@ Here is a list of template creators:
|
|||||||
* Configuration
|
* Configuration
|
||||||
* Apache2: @stkrwork
|
* Apache2: @stkrwork
|
||||||
* Schema
|
* Schema
|
||||||
* Avro: @sgadouar
|
|
||||||
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||||
* MySQL: @ybelenko
|
* MySQL: @ybelenko
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
|||||||
|
|
||||||
if [ ! -f "$executable" ]
|
if [ ! -f "$executable" ]
|
||||||
then
|
then
|
||||||
./mvnw -B clean package
|
mvn -B clean package
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
@@ -30,7 +30,7 @@ ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o sampl
|
|||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
|
||||||
./mvnw clean package -f samples/meta-codegen/pom.xml
|
mvn clean package -f samples/meta-codegen/pom.xml
|
||||||
|
|
||||||
ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen/usage $@"
|
ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen/usage $@"
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SCRIPT="$0"
|
|
||||||
echo "# START SCRIPT: $SCRIPT"
|
|
||||||
|
|
||||||
while [ -h "$SCRIPT" ] ; do
|
|
||||||
ls=`ls -ld "$SCRIPT"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
SCRIPT="$link"
|
|
||||||
else
|
|
||||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -d "${APP_DIR}" ]; then
|
|
||||||
APP_DIR=`dirname "$SCRIPT"`/..
|
|
||||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
|
||||||
fi
|
|
||||||
|
|
||||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
|
||||||
|
|
||||||
if [ ! -f "$executable" ]
|
|
||||||
then
|
|
||||||
mvn clean package
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/avro-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g avro-schema -o samples/openapi3/schema/petstore/avro-schema $@"
|
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
|
||||||
@@ -4,4 +4,3 @@
|
|||||||
./bin/openapi3/typescript-fetch-petstore-with-npm-version.sh
|
./bin/openapi3/typescript-fetch-petstore-with-npm-version.sh
|
||||||
./bin/openapi3/typescript-fetch-petstore-interfaces.sh
|
./bin/openapi3/typescript-fetch-petstore-interfaces.sh
|
||||||
./bin/openapi3/typescript-fetch-petstore.sh
|
./bin/openapi3/typescript-fetch-petstore.sh
|
||||||
./bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SCRIPT="$0"
|
|
||||||
echo "# START SCRIPT: $SCRIPT"
|
|
||||||
|
|
||||||
while [ -h "$SCRIPT" ] ; do
|
|
||||||
ls=`ls -ld "$SCRIPT"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
SCRIPT="$link"
|
|
||||||
else
|
|
||||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -d "${APP_DIR}" ]; then
|
|
||||||
APP_DIR=`dirname "$SCRIPT"`/..
|
|
||||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
|
||||||
fi
|
|
||||||
|
|
||||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
|
||||||
|
|
||||||
if [ ! -f "$executable" ]
|
|
||||||
then
|
|
||||||
mvn clean package
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|
||||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true $@"
|
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
|
||||||
@@ -2,6 +2,5 @@
|
|||||||
"gemName": "petstore",
|
"gemName": "petstore",
|
||||||
"moduleName": "Petstore",
|
"moduleName": "Petstore",
|
||||||
"library": "faraday",
|
"library": "faraday",
|
||||||
"gemVersion": "1.0.0",
|
"gemVersion": "1.0.0"
|
||||||
"strictSpecBehavior": false
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,5 @@
|
|||||||
"gemName": "petstore",
|
"gemName": "petstore",
|
||||||
"library": "typhoeus",
|
"library": "typhoeus",
|
||||||
"moduleName": "Petstore",
|
"moduleName": "Petstore",
|
||||||
"gemVersion": "1.0.0",
|
"gemVersion": "1.0.0"
|
||||||
"strictSpecBehavior": false
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,5 +4,4 @@
|
|||||||
./bin/typescript-fetch-petstore-with-npm-version.sh
|
./bin/typescript-fetch-petstore-with-npm-version.sh
|
||||||
./bin/typescript-fetch-petstore-interfaces.sh
|
./bin/typescript-fetch-petstore-interfaces.sh
|
||||||
./bin/typescript-fetch-petstore.sh
|
./bin/typescript-fetch-petstore.sh
|
||||||
./bin/typescript-fetch-petstore-multiple-parameters.sh
|
./bin/typescript-fetch-petstore-multiple-parameters.sh
|
||||||
./bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"npmName": "@openapitools/typescript-fetch-petstore",
|
|
||||||
"npmVersion": "1.0.0",
|
|
||||||
"npmRepository" : "https://skimdb.npmjs.com/registry",
|
|
||||||
"snapshot" : false,
|
|
||||||
"prefixParameterInterfaces": true
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SCRIPT="$0"
|
|
||||||
echo "# START SCRIPT: $SCRIPT"
|
|
||||||
|
|
||||||
while [ -h "$SCRIPT" ] ; do
|
|
||||||
ls=`ls -ld "$SCRIPT"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
SCRIPT="$link"
|
|
||||||
else
|
|
||||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -d "${APP_DIR}" ]; then
|
|
||||||
APP_DIR=`dirname "$SCRIPT"`/..
|
|
||||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
|
||||||
fi
|
|
||||||
|
|
||||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
|
||||||
|
|
||||||
if [ ! -f "$executable" ]
|
|
||||||
then
|
|
||||||
mvn -B clean package
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
|
||||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-prefix-parameter-interfaces.json -o samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces $@"
|
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
|
||||||
|
|
||||||
cp CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml
|
|
||||||
@@ -59,9 +59,6 @@ declare -a scripts=(
|
|||||||
"./bin/apex-petstore.sh"
|
"./bin/apex-petstore.sh"
|
||||||
"./bin/perl-petstore-all.sh"
|
"./bin/perl-petstore-all.sh"
|
||||||
"./bin/dart-jaguar-petstore.sh"
|
"./bin/dart-jaguar-petstore.sh"
|
||||||
"./bin/dart-flutter-petstore.sh"
|
|
||||||
"./bin/dart-petstore.sh"
|
|
||||||
"./bin/dart2-petstore.sh"
|
|
||||||
#"./bin/elm-petstore-all.sh"
|
#"./bin/elm-petstore-all.sh"
|
||||||
"./bin/meta-codegen.sh"
|
"./bin/meta-codegen.sh"
|
||||||
# OTHERS
|
# OTHERS
|
||||||
|
|||||||
@@ -5,4 +5,3 @@ call bin\windows\typescript-fetch-petstore-target-es6.bat
|
|||||||
call bin\windows\typescript-fetch-petstore-with-npm-version.bat
|
call bin\windows\typescript-fetch-petstore-with-npm-version.bat
|
||||||
call bin\windows\typescript-fetch-petstore-interfaces.bat
|
call bin\windows\typescript-fetch-petstore-interfaces.bat
|
||||||
call bin\windows\typescript-fetch-petstore-multiple-parameters.bat
|
call bin\windows\typescript-fetch-petstore-multiple-parameters.bat
|
||||||
call bin\windows\typescript-fetch-petstore-prefix-parameter-interfaces.bat
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
@ECHO OFF
|
|
||||||
|
|
||||||
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-fetch -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true
|
|
||||||
|
|
||||||
java %JAVA_OPTS% -jar %executable% %ags%
|
|
||||||
@@ -125,7 +125,6 @@ The following generators are available:
|
|||||||
|
|
||||||
|
|
||||||
## SCHEMA generators
|
## SCHEMA generators
|
||||||
* [avro-schema (beta)](generators/avro-schema)
|
|
||||||
* [mysql-schema](generators/mysql-schema)
|
* [mysql-schema](generators/mysql-schema)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
---
|
|
||||||
id: generator-opts-schema-avro-schema
|
|
||||||
title: Config Options for avro-schema
|
|
||||||
sidebar_label: avro-schema
|
|
||||||
---
|
|
||||||
|
|
||||||
| Option | Description | Values | Default |
|
|
||||||
| ------ | ----------- | ------ | ------- |
|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
|
||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|
||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|
||||||
|packageName|package for generated classes (where supported)| |null|
|
|
||||||
@@ -12,7 +12,7 @@ sidebar_label: csharp-netcore
|
|||||||
|sourceFolder|source folder for generated code| |src|
|
|sourceFolder|source folder for generated code| |src|
|
||||||
|packageGuid|The GUID that will be associated with the C# project| |null|
|
|packageGuid|The GUID that will be associated with the C# project| |null|
|
||||||
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|
||||||
|targetFramework|The target .NET framework version.|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dl>|netstandard2.0|
|
|targetFramework|The target .NET framework version.|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dl>|v4.6.1|
|
||||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|
||||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
@@ -26,4 +26,3 @@ sidebar_label: csharp-netcore
|
|||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|
||||||
|validatable|Generates self-validatable models.| |true|
|
|validatable|Generates self-validatable models.| |true|
|
||||||
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false|
|
|
||||||
|
|||||||
@@ -13,5 +13,4 @@ sidebar_label: go-experimental
|
|||||||
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|
||||||
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false|
|
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false|
|
||||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||||
|enumClassPrefix|Prefix enum with class name| |false|
|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|
|||||||
@@ -13,5 +13,4 @@ sidebar_label: go
|
|||||||
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|
||||||
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false|
|
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false|
|
||||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||||
|enumClassPrefix|Prefix enum with class name| |false|
|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|
|||||||
@@ -19,4 +19,3 @@ sidebar_label: typescript-fetch
|
|||||||
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
||||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true|
|
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true|
|
||||||
|prefixParameterInterfaces|Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.| |false|
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ id: swagger-codegen-migration
|
|||||||
title: Migrating from Swagger Codegen
|
title: Migrating from Swagger Codegen
|
||||||
---
|
---
|
||||||
|
|
||||||
OpenAPI Generator is a fork of `swagger-codegen` between version `2.3.1` and `2.4.0`. For the reasons behind the fork, please refer to the [Q&A](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/qna.md).
|
OpenAPI Generator is a fork of `swagger-codegen` between version `2.3.1` and `2.4.0`.
|
||||||
This community-driven version called "OpenAPI Generator" provides similar functionalities and can be used as drop-in replacement.
|
This community-driven version called "OpenAPI Generator" provides similar functionalities and can be used as drop-in replacement.
|
||||||
This guide explains the major differences in order to help you with the migration.
|
This guide explains the major differences in order to help you with the migration.
|
||||||
|
|
||||||
@@ -22,7 +22,6 @@ This guide explains the major differences in order to help you with the migratio
|
|||||||
- [New fully qualified name for the classes](#new-fully-qualified-name-for-the-classes)
|
- [New fully qualified name for the classes](#new-fully-qualified-name-for-the-classes)
|
||||||
- [Body parameter name](#body-parameter-name)
|
- [Body parameter name](#body-parameter-name)
|
||||||
- [Default basePath](#default-basepath)
|
- [Default basePath](#default-basepath)
|
||||||
- [Nullable](#nullable)
|
|
||||||
|
|
||||||
## New docker images
|
## New docker images
|
||||||
|
|
||||||
@@ -251,7 +250,3 @@ If your API client is using named parameters in the function call (e.g. Perl req
|
|||||||
## Default basePath
|
## Default basePath
|
||||||
|
|
||||||
The default `basePath` has been changed from `https://localhost` to `http://localhost` (http without s)
|
The default `basePath` has been changed from `https://localhost` to `http://localhost` (http without s)
|
||||||
|
|
||||||
## Nullable
|
|
||||||
|
|
||||||
OpenAPI spec v3 has better support for `nullable`. If you're still using OpenAPI/Swagger spec v2, please use `x-nullable: true` instead.
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -421,27 +421,13 @@ public final class GeneratorSettings implements Serializable {
|
|||||||
builder.artifactId = copy.getArtifactId();
|
builder.artifactId = copy.getArtifactId();
|
||||||
builder.artifactVersion = copy.getArtifactVersion();
|
builder.artifactVersion = copy.getArtifactVersion();
|
||||||
builder.library = copy.getLibrary();
|
builder.library = copy.getLibrary();
|
||||||
if (copy.getInstantiationTypes() != null) {
|
builder.instantiationTypes = new HashMap<>(copy.getInstantiationTypes());
|
||||||
builder.instantiationTypes.putAll(copy.getInstantiationTypes());
|
builder.typeMappings = new HashMap<>(copy.getTypeMappings());
|
||||||
}
|
builder.additionalProperties = new HashMap<>(copy.getAdditionalProperties());
|
||||||
if (copy.getTypeMappings() != null) {
|
builder.importMappings = new HashMap<>(copy.getImportMappings());
|
||||||
builder.typeMappings.putAll(copy.getTypeMappings());
|
builder.languageSpecificPrimitives = new HashSet<>(copy.getLanguageSpecificPrimitives());
|
||||||
}
|
builder.reservedWordMappings = new HashMap<>(copy.getReservedWordMappings());
|
||||||
if (copy.getAdditionalProperties() != null) {
|
builder.serverVariables = new HashMap<>(copy.getServerVariables());
|
||||||
builder.additionalProperties.putAll(copy.getAdditionalProperties());
|
|
||||||
}
|
|
||||||
if (copy.getImportMappings() != null) {
|
|
||||||
builder.importMappings.putAll(copy.getImportMappings());
|
|
||||||
}
|
|
||||||
if (copy.getLanguageSpecificPrimitives() != null) {
|
|
||||||
builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives());
|
|
||||||
}
|
|
||||||
if (copy.getReservedWordMappings() != null) {
|
|
||||||
builder.reservedWordMappings.putAll(copy.getReservedWordMappings());
|
|
||||||
}
|
|
||||||
if (copy.getServerVariables() != null) {
|
|
||||||
builder.serverVariables.putAll(copy.getServerVariables());
|
|
||||||
}
|
|
||||||
builder.gitUserId = copy.getGitUserId();
|
builder.gitUserId = copy.getGitUserId();
|
||||||
builder.gitRepoId = copy.getGitRepoId();
|
builder.gitRepoId = copy.getGitRepoId();
|
||||||
builder.releaseNote = copy.getReleaseNote();
|
builder.releaseNote = copy.getReleaseNote();
|
||||||
|
|||||||
@@ -33,48 +33,38 @@ import java.util.Objects;
|
|||||||
public class WorkflowSettings {
|
public class WorkflowSettings {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowSettings.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowSettings.class);
|
||||||
public static final String DEFAULT_OUTPUT_DIR = ".";
|
|
||||||
public static final boolean DEFAULT_VERBOSE = false;
|
|
||||||
public static final boolean DEFAULT_SKIP_OVERWRITE = false;
|
|
||||||
public static final boolean DEFAULT_REMOVE_OPERATION_ID_PREFIX = false;
|
|
||||||
public static final boolean DEFAULT_LOG_TO_STDERR = false;
|
|
||||||
public static final boolean DEFAULT_VALIDATE_SPEC = true;
|
|
||||||
public static final boolean DEFAULT_ENABLE_POST_PROCESS_FILE = false;
|
|
||||||
public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false;
|
|
||||||
public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true;
|
|
||||||
public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache";
|
|
||||||
public static final ImmutableMap<String, String> DEFAULT_SYSTEM_PROPERTIES = ImmutableMap.of();
|
|
||||||
|
|
||||||
private String inputSpec;
|
private String inputSpec;
|
||||||
private String outputDir = DEFAULT_OUTPUT_DIR;
|
private String outputDir;
|
||||||
private boolean verbose = DEFAULT_VERBOSE;
|
private boolean verbose;
|
||||||
private boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE;
|
private boolean skipOverwrite;
|
||||||
private boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX;
|
private boolean removeOperationIdPrefix;
|
||||||
private boolean logToStderr = DEFAULT_LOG_TO_STDERR;
|
private boolean logToStderr;
|
||||||
private boolean validateSpec = DEFAULT_VALIDATE_SPEC;
|
private boolean validateSpec;
|
||||||
private boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE;
|
private boolean enablePostProcessFile;
|
||||||
private boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE;
|
private boolean enableMinimalUpdate;
|
||||||
private boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR;
|
private boolean strictSpecBehavior;
|
||||||
private String templateDir;
|
private String templateDir;
|
||||||
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
|
private String templatingEngineName;
|
||||||
private String ignoreFileOverride;
|
private String ignoreFileOverride;
|
||||||
private ImmutableMap<String, String> systemProperties = DEFAULT_SYSTEM_PROPERTIES;
|
private ImmutableMap<String, String> systemProperties;
|
||||||
|
|
||||||
private WorkflowSettings(Builder builder) {
|
private WorkflowSettings(Builder builder) {
|
||||||
this.inputSpec = builder.inputSpec;
|
setDefaults();
|
||||||
this.outputDir = builder.outputDir;
|
inputSpec = builder.inputSpec;
|
||||||
this.verbose = builder.verbose;
|
outputDir = builder.outputDir;
|
||||||
this.skipOverwrite = builder.skipOverwrite;
|
verbose = builder.verbose;
|
||||||
this.removeOperationIdPrefix = builder.removeOperationIdPrefix;
|
skipOverwrite = builder.skipOverwrite;
|
||||||
this.logToStderr = builder.logToStderr;
|
removeOperationIdPrefix = builder.removeOperationIdPrefix;
|
||||||
this.validateSpec = builder.validateSpec;
|
logToStderr = builder.logToStderr;
|
||||||
this.enablePostProcessFile = builder.enablePostProcessFile;
|
validateSpec = builder.validateSpec;
|
||||||
this.enableMinimalUpdate = builder.enableMinimalUpdate;
|
enablePostProcessFile = builder.enablePostProcessFile;
|
||||||
this.strictSpecBehavior = builder.strictSpecBehavior;
|
enableMinimalUpdate = builder.enableMinimalUpdate;
|
||||||
this.templateDir = builder.templateDir;
|
strictSpecBehavior = builder.strictSpecBehavior;
|
||||||
this.templatingEngineName = builder.templatingEngineName;
|
templateDir = builder.templateDir;
|
||||||
this.ignoreFileOverride = builder.ignoreFileOverride;
|
templatingEngineName = builder.templatingEngineName;
|
||||||
this.systemProperties = ImmutableMap.copyOf(builder.systemProperties);
|
ignoreFileOverride = builder.ignoreFileOverride;
|
||||||
|
systemProperties = ImmutableMap.copyOf(builder.systemProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,7 +72,14 @@ public class WorkflowSettings {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public WorkflowSettings() {
|
public WorkflowSettings() {
|
||||||
|
setDefaults();
|
||||||
|
systemProperties = ImmutableMap.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDefaults(){
|
||||||
|
validateSpec = true;
|
||||||
|
strictSpecBehavior = true;
|
||||||
|
outputDir = ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Builder newBuilder() {
|
public static Builder newBuilder() {
|
||||||
@@ -90,7 +87,7 @@ public class WorkflowSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Builder newBuilder(WorkflowSettings copy) {
|
public static Builder newBuilder(WorkflowSettings copy) {
|
||||||
Builder builder = newBuilder();
|
Builder builder = new Builder();
|
||||||
builder.inputSpec = copy.getInputSpec();
|
builder.inputSpec = copy.getInputSpec();
|
||||||
builder.outputDir = copy.getOutputDir();
|
builder.outputDir = copy.getOutputDir();
|
||||||
builder.verbose = copy.isVerbose();
|
builder.verbose = copy.isVerbose();
|
||||||
@@ -260,24 +257,24 @@ public class WorkflowSettings {
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
private String inputSpec;
|
private String inputSpec;
|
||||||
private String outputDir = DEFAULT_OUTPUT_DIR;
|
private String outputDir;
|
||||||
private Boolean verbose = DEFAULT_VERBOSE;
|
private boolean verbose;
|
||||||
private Boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE;
|
private boolean skipOverwrite;
|
||||||
private Boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX;
|
private boolean removeOperationIdPrefix;
|
||||||
private Boolean logToStderr = DEFAULT_LOG_TO_STDERR;
|
private boolean logToStderr;
|
||||||
private Boolean validateSpec = DEFAULT_VALIDATE_SPEC;
|
private boolean validateSpec;
|
||||||
private Boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE;
|
private boolean enablePostProcessFile;
|
||||||
private Boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE;
|
private boolean enableMinimalUpdate;
|
||||||
private Boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR;
|
private boolean strictSpecBehavior;
|
||||||
private String templateDir;
|
private String templateDir;
|
||||||
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
|
private String templatingEngineName;
|
||||||
private String ignoreFileOverride;
|
private String ignoreFileOverride;
|
||||||
private Map<String, String> systemProperties = new HashMap<>();;
|
private Map<String, String> systemProperties;
|
||||||
|
|
||||||
private Builder() {
|
private Builder() {
|
||||||
|
systemProperties = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@code inputSpec} and returns a reference to this Builder so that the methods can be chained together.
|
* Sets the {@code inputSpec} and returns a reference to this Builder so that the methods can be chained together.
|
||||||
*
|
*
|
||||||
@@ -285,9 +282,7 @@ public class WorkflowSettings {
|
|||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withInputSpec(String inputSpec) {
|
public Builder withInputSpec(String inputSpec) {
|
||||||
if (inputSpec != null) {
|
this.inputSpec = inputSpec;
|
||||||
this.inputSpec = inputSpec;
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,11 +293,7 @@ public class WorkflowSettings {
|
|||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withOutputDir(String outputDir) {
|
public Builder withOutputDir(String outputDir) {
|
||||||
if (outputDir != null ) {
|
this.outputDir = Paths.get(outputDir).toAbsolutePath().toString();;
|
||||||
this.outputDir = Paths.get(outputDir).toAbsolutePath().toString();
|
|
||||||
} else {
|
|
||||||
this.outputDir = DEFAULT_OUTPUT_DIR;
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,8 +303,8 @@ public class WorkflowSettings {
|
|||||||
* @param verbose the {@code verbose} to set
|
* @param verbose the {@code verbose} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withVerbose(Boolean verbose) {
|
public Builder withVerbose(boolean verbose) {
|
||||||
this.verbose = verbose != null ? verbose : Boolean.valueOf(DEFAULT_VERBOSE);
|
this.verbose = verbose;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,8 +314,8 @@ public class WorkflowSettings {
|
|||||||
* @param skipOverwrite the {@code skipOverwrite} to set
|
* @param skipOverwrite the {@code skipOverwrite} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withSkipOverwrite(Boolean skipOverwrite) {
|
public Builder withSkipOverwrite(boolean skipOverwrite) {
|
||||||
this.skipOverwrite = skipOverwrite != null ? skipOverwrite : Boolean.valueOf(DEFAULT_SKIP_OVERWRITE);
|
this.skipOverwrite = skipOverwrite;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,8 +325,8 @@ public class WorkflowSettings {
|
|||||||
* @param removeOperationIdPrefix the {@code removeOperationIdPrefix} to set
|
* @param removeOperationIdPrefix the {@code removeOperationIdPrefix} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withRemoveOperationIdPrefix(Boolean removeOperationIdPrefix) {
|
public Builder withRemoveOperationIdPrefix(boolean removeOperationIdPrefix) {
|
||||||
this.removeOperationIdPrefix = removeOperationIdPrefix != null ? removeOperationIdPrefix : Boolean.valueOf(DEFAULT_REMOVE_OPERATION_ID_PREFIX);
|
this.removeOperationIdPrefix = removeOperationIdPrefix;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,8 +336,8 @@ public class WorkflowSettings {
|
|||||||
* @param logToStderr the {@code logToStderr} to set
|
* @param logToStderr the {@code logToStderr} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withLogToStderr(Boolean logToStderr) {
|
public Builder withLogToStderr(boolean logToStderr) {
|
||||||
this.logToStderr = logToStderr != null ? logToStderr : Boolean.valueOf(DEFAULT_LOG_TO_STDERR);
|
this.logToStderr = logToStderr;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,8 +347,8 @@ public class WorkflowSettings {
|
|||||||
* @param validateSpec the {@code validateSpec} to set
|
* @param validateSpec the {@code validateSpec} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withValidateSpec(Boolean validateSpec) {
|
public Builder withValidateSpec(boolean validateSpec) {
|
||||||
this.validateSpec = validateSpec != null ? validateSpec : Boolean.valueOf(DEFAULT_VALIDATE_SPEC);
|
this.validateSpec = validateSpec;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,8 +358,8 @@ public class WorkflowSettings {
|
|||||||
* @param enablePostProcessFile the {@code enablePostProcessFile} to set
|
* @param enablePostProcessFile the {@code enablePostProcessFile} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withEnablePostProcessFile(Boolean enablePostProcessFile) {
|
public Builder withEnablePostProcessFile(boolean enablePostProcessFile) {
|
||||||
this.enablePostProcessFile = enablePostProcessFile != null ? enablePostProcessFile : Boolean.valueOf(DEFAULT_ENABLE_POST_PROCESS_FILE);
|
this.enablePostProcessFile = enablePostProcessFile;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,8 +369,8 @@ public class WorkflowSettings {
|
|||||||
* @param enableMinimalUpdate the {@code enableMinimalUpdate} to set
|
* @param enableMinimalUpdate the {@code enableMinimalUpdate} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withEnableMinimalUpdate(Boolean enableMinimalUpdate) {
|
public Builder withEnableMinimalUpdate(boolean enableMinimalUpdate) {
|
||||||
this.enableMinimalUpdate = enableMinimalUpdate != null ? enableMinimalUpdate : Boolean.valueOf(DEFAULT_ENABLE_MINIMAL_UPDATE);
|
this.enableMinimalUpdate = enableMinimalUpdate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,8 +380,8 @@ public class WorkflowSettings {
|
|||||||
* @param strictSpecBehavior the {@code strictSpecBehavior} to set
|
* @param strictSpecBehavior the {@code strictSpecBehavior} to set
|
||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withStrictSpecBehavior(Boolean strictSpecBehavior) {
|
public Builder withStrictSpecBehavior(boolean strictSpecBehavior) {
|
||||||
this.strictSpecBehavior = strictSpecBehavior != null ? strictSpecBehavior : Boolean.valueOf(DEFAULT_STRICT_SPEC_BEHAVIOR);
|
this.strictSpecBehavior = strictSpecBehavior;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +392,9 @@ public class WorkflowSettings {
|
|||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withTemplateDir(String templateDir) {
|
public Builder withTemplateDir(String templateDir) {
|
||||||
if (templateDir != null) {
|
if (templateDir == null) {
|
||||||
|
this.templateDir = null;
|
||||||
|
} else {
|
||||||
File f = new File(templateDir);
|
File f = new File(templateDir);
|
||||||
|
|
||||||
// check to see if the folder exists
|
// check to see if the folder exists
|
||||||
@@ -423,7 +416,7 @@ public class WorkflowSettings {
|
|||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withTemplatingEngineName(String templatingEngineName) {
|
public Builder withTemplatingEngineName(String templatingEngineName) {
|
||||||
this.templatingEngineName = templatingEngineName != null ? templatingEngineName : DEFAULT_TEMPLATING_ENGINE_NAME;
|
this.templatingEngineName = templatingEngineName;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,9 +438,7 @@ public class WorkflowSettings {
|
|||||||
* @return a reference to this Builder
|
* @return a reference to this Builder
|
||||||
*/
|
*/
|
||||||
public Builder withSystemProperties(Map<String, String> systemProperties) {
|
public Builder withSystemProperties(Map<String, String> systemProperties) {
|
||||||
if (systemProperties != null) {
|
this.systemProperties = systemProperties;
|
||||||
this.systemProperties = systemProperties;
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.openapitools.codegen.config;
|
|
||||||
|
|
||||||
import org.testng.annotations.Test;
|
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
|
|
||||||
import static org.testng.Assert.*;
|
|
||||||
|
|
||||||
public class WorkflowSettingsTest {
|
|
||||||
@Test
|
|
||||||
public void defaultValuesNotOverriddenByNulls(){
|
|
||||||
WorkflowSettings settings = WorkflowSettings.newBuilder()
|
|
||||||
.withOutputDir(null)
|
|
||||||
.withVerbose(null)
|
|
||||||
.withSkipOverwrite(null)
|
|
||||||
.withRemoveOperationIdPrefix(null)
|
|
||||||
.withLogToStderr(null)
|
|
||||||
.withValidateSpec(null)
|
|
||||||
.withEnablePostProcessFile(null)
|
|
||||||
.withEnableMinimalUpdate(null)
|
|
||||||
.withStrictSpecBehavior(null)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
assertEquals(settings.getOutputDir(), ".");
|
|
||||||
assertFalse(settings.isVerbose());
|
|
||||||
assertFalse(settings.isSkipOverwrite());
|
|
||||||
assertFalse(settings.isRemoveOperationIdPrefix());
|
|
||||||
assertFalse(settings.isLogToStderr());
|
|
||||||
assertTrue(settings.isValidateSpec());
|
|
||||||
assertFalse(settings.isEnablePostProcessFile());
|
|
||||||
assertFalse(settings.isEnableMinimalUpdate());
|
|
||||||
assertTrue(settings.isStrictSpecBehavior());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertOnChangesToDefaults(WorkflowSettings defaults) {
|
|
||||||
WorkflowSettings settings = WorkflowSettings.newBuilder()
|
|
||||||
.withOutputDir("output")
|
|
||||||
.withVerbose(true)
|
|
||||||
.withSkipOverwrite(true)
|
|
||||||
.withRemoveOperationIdPrefix(true)
|
|
||||||
.withLogToStderr(true)
|
|
||||||
.withValidateSpec(false)
|
|
||||||
.withEnablePostProcessFile(true)
|
|
||||||
.withEnableMinimalUpdate(true)
|
|
||||||
.withStrictSpecBehavior(false)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
assertNotEquals(defaults.getOutputDir(), settings.getOutputDir());
|
|
||||||
assertEquals(settings.getOutputDir(), Paths.get("output").toAbsolutePath().toString());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isVerbose(), settings.isVerbose());
|
|
||||||
assertTrue(settings.isVerbose());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isSkipOverwrite(), settings.isSkipOverwrite());
|
|
||||||
assertTrue(settings.isSkipOverwrite());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isRemoveOperationIdPrefix(), settings.isRemoveOperationIdPrefix());
|
|
||||||
assertTrue(settings.isRemoveOperationIdPrefix());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isLogToStderr(), settings.isLogToStderr());
|
|
||||||
assertTrue(settings.isLogToStderr());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isValidateSpec(), settings.isValidateSpec());
|
|
||||||
assertFalse(settings.isValidateSpec());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isEnablePostProcessFile(), settings.isEnablePostProcessFile());
|
|
||||||
assertTrue(settings.isEnablePostProcessFile());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isEnableMinimalUpdate(), settings.isEnableMinimalUpdate());
|
|
||||||
assertTrue(settings.isEnableMinimalUpdate());
|
|
||||||
|
|
||||||
assertNotEquals(defaults.isStrictSpecBehavior(), settings.isStrictSpecBehavior());
|
|
||||||
assertFalse(settings.isStrictSpecBehavior());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void defaultValuesCanBeChangedClassConstructor(){
|
|
||||||
WorkflowSettings defaults = new WorkflowSettings();
|
|
||||||
assertOnChangesToDefaults(defaults);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void defaultValuesCanBeChangedBuilder(){
|
|
||||||
WorkflowSettings defaults = WorkflowSettings.newBuilder().build();
|
|
||||||
assertOnChangesToDefaults(defaults);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate
|
|||||||
[source,group]
|
[source,group]
|
||||||
----
|
----
|
||||||
plugins {
|
plugins {
|
||||||
id "org.openapi.generator" version "4.1.1"
|
id "org.openapi.generator" version "4.1.0"
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ buildscript {
|
|||||||
// url "https://plugins.gradle.org/m2/"
|
// url "https://plugins.gradle.org/m2/"
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.1"
|
classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,7 +621,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||||
classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.1') {
|
classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.0') {
|
||||||
exclude group: 'com.google.guava'
|
exclude group: 'com.google.guava'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=4.1.1
|
openApiGeneratorVersion=4.1.1-SNAPSHOT
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
|
||||||
# BEGIN placeholders
|
# BEGIN placeholders
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ gradle generateGoWithInvalidSpec
|
|||||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gradle -PopenApiGeneratorVersion=4.1.1 openApiValidate
|
gradle -PopenApiGeneratorVersion=4.1.0 openApiValidate
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=4.1.1
|
openApiGeneratorVersion=4.1.0
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
@@ -268,12 +268,6 @@
|
|||||||
<!-- <version>${testng-version}</version> -->
|
<!-- <version>${testng-version}</version> -->
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.javaparser</groupId>
|
|
||||||
<artifactId>javaparser-core</artifactId>
|
|
||||||
<version>3.14.11</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.reflections</groupId>
|
<groupId>org.reflections</groupId>
|
||||||
<artifactId>reflections</artifactId>
|
<artifactId>reflections</artifactId>
|
||||||
@@ -300,7 +294,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>2.23.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -308,7 +308,4 @@ public class CodegenConstants {
|
|||||||
|
|
||||||
public static final String EXCEPTION_ON_FAILURE = "returnExceptionOnFailure";
|
public static final String EXCEPTION_ON_FAILURE = "returnExceptionOnFailure";
|
||||||
public static final String EXCEPTION_ON_FAILURE_DESC = "Throw an exception on non success response codes";
|
public static final String EXCEPTION_ON_FAILURE_DESC = "Throw an exception on non success response codes";
|
||||||
|
|
||||||
public static final String ENUM_CLASS_PREFIX = "enumClassPrefix";
|
|
||||||
public static final String ENUM_CLASS_PREFIX_DESC = "Prefix enum with class name";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2659,13 +2659,11 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
CodegenParameter bodyParam = null;
|
CodegenParameter bodyParam = null;
|
||||||
RequestBody requestBody = operation.getRequestBody();
|
RequestBody requestBody = operation.getRequestBody();
|
||||||
if (requestBody != null) {
|
if (requestBody != null) {
|
||||||
String contentType = getContentType(requestBody);
|
if (getContentType(requestBody) != null &&
|
||||||
if (contentType != null &&
|
(getContentType(requestBody).toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") ||
|
||||||
(contentType.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") ||
|
getContentType(requestBody).toLowerCase(Locale.ROOT).startsWith("multipart/form-data"))) {
|
||||||
contentType.toLowerCase(Locale.ROOT).startsWith("multipart"))) {
|
|
||||||
// process form parameters
|
// process form parameters
|
||||||
formParams = fromRequestBodyToFormParameters(requestBody, imports);
|
formParams = fromRequestBodyToFormParameters(requestBody, imports);
|
||||||
op.isMultipart = contentType.toLowerCase(Locale.ROOT).startsWith("multipart");
|
|
||||||
for (CodegenParameter cp : formParams) {
|
for (CodegenParameter cp : formParams) {
|
||||||
postProcessParameter(cp);
|
postProcessParameter(cp);
|
||||||
}
|
}
|
||||||
@@ -4465,8 +4463,8 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
for (String consume : consumesInfo) {
|
for (String consume : consumesInfo) {
|
||||||
if (consume != null &&
|
if (consume != null &&
|
||||||
(consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") ||
|
consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") ||
|
||||||
consume.toLowerCase(Locale.ROOT).startsWith("multipart"))) {
|
consume.toLowerCase(Locale.ROOT).startsWith("multipart/form-data")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4909,7 +4907,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
LOGGER.warn("The following schema has undefined (null) baseType. " +
|
LOGGER.warn("The following schema has undefined (null) baseType. " +
|
||||||
"It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " +
|
"It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " +
|
||||||
"A correct 'consumes' for form parameters should be " +
|
"A correct 'consumes' for form parameters should be " +
|
||||||
"'application/x-www-form-urlencoded' or 'multipart/?'");
|
"'application/x-www-form-urlencoded' or 'multipart/form-data'");
|
||||||
LOGGER.warn("schema: " + schema);
|
LOGGER.warn("schema: " + schema);
|
||||||
LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE");
|
LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE");
|
||||||
codegenModelName = "UNKNOWN_BASE_TYPE";
|
codegenModelName = "UNKNOWN_BASE_TYPE";
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ public class CodegenConfigurator {
|
|||||||
DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class);
|
DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class);
|
||||||
CodegenConfigurator configurator = new CodegenConfigurator();
|
CodegenConfigurator configurator = new CodegenConfigurator();
|
||||||
configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(settings.getGeneratorSettings());
|
configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(settings.getGeneratorSettings());
|
||||||
configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(settings.getWorkflowSettings());
|
|
||||||
return configurator;
|
return configurator;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOGGER.error("Unable to deserialize config file: " + configFile, ex);
|
LOGGER.error("Unable to deserialize config file: " + configFile, ex);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
|
|
||||||
protected boolean withGoCodegenComment = false;
|
protected boolean withGoCodegenComment = false;
|
||||||
protected boolean withXml = false;
|
protected boolean withXml = false;
|
||||||
protected boolean enumClassPrefix = false;
|
|
||||||
|
|
||||||
protected String packageName = "openapi";
|
protected String packageName = "openapi";
|
||||||
|
|
||||||
@@ -619,10 +618,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
this.withXml = withXml;
|
this.withXml = withXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnumClassPrefix(boolean enumClassPrefix) {
|
|
||||||
this.enumClassPrefix = enumClassPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toDefaultValue(Schema schema) {
|
public String toDefaultValue(Schema schema) {
|
||||||
if (schema.getDefault() != null) {
|
if (schema.getDefault() != null) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import com.google.common.base.CaseFormat;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
@@ -984,6 +985,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
model.imports.add("ApiModelProperty");
|
model.imports.add("ApiModelProperty");
|
||||||
model.imports.add("ApiModel");
|
model.imports.add("ApiModel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// store java constant property name in vendor extension, remove dollar sign from the constant name
|
||||||
|
property.vendorExtensions.put("x-java-const-name", CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase.replaceAll("\\$", "")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,135 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
|
||||||
|
|
||||||
import org.openapitools.codegen.*;
|
|
||||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
|
||||||
import org.openapitools.codegen.meta.Stability;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
|
||||||
|
|
||||||
public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig {
|
|
||||||
private static final String AVRO = "avro-schema";
|
|
||||||
protected String packageName = "model";
|
|
||||||
|
|
||||||
public AvroSchemaCodegen() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
|
||||||
.stability(Stability.BETA)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
outputFolder = "generated-code/avro-schema";
|
|
||||||
modelTemplateFiles.put("model.mustache", ".avsc");
|
|
||||||
apiPackage = "api";
|
|
||||||
modelPackage = "model";
|
|
||||||
importMapping.clear();
|
|
||||||
embeddedTemplateDir = templateDir = AVRO;
|
|
||||||
|
|
||||||
// default HIDE_GENERATION_TIMESTAMP to true
|
|
||||||
hideGenerationTimestamp = Boolean.TRUE;
|
|
||||||
|
|
||||||
languageSpecificPrimitives = new HashSet<>(
|
|
||||||
Arrays.asList("null", "boolean", "int", "integer", "long", "float", "double", "bytes", "string",
|
|
||||||
"BigDecimal", "UUID", "number", "date", "DateTime")
|
|
||||||
);
|
|
||||||
defaultIncludes = new HashSet<>(languageSpecificPrimitives);
|
|
||||||
|
|
||||||
instantiationTypes.put("array", "Array");
|
|
||||||
instantiationTypes.put("list", "Array");
|
|
||||||
instantiationTypes.put("map", "Object");
|
|
||||||
typeMapping.clear();
|
|
||||||
typeMapping.put("number", "double");
|
|
||||||
typeMapping.put("DateTime", "string");
|
|
||||||
typeMapping.put("date", "string");
|
|
||||||
typeMapping.put("short", "int");
|
|
||||||
typeMapping.put("char", "string");
|
|
||||||
typeMapping.put("integer", "int");
|
|
||||||
typeMapping.put("ByteArray", "bytes");
|
|
||||||
typeMapping.put("binary", "File");
|
|
||||||
typeMapping.put("file", "File");
|
|
||||||
typeMapping.put("UUID", "string");
|
|
||||||
typeMapping.put("BigDecimal", "string");
|
|
||||||
|
|
||||||
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, CodegenConstants.PACKAGE_NAME_DESC));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processOpts() {
|
|
||||||
super.processOpts();
|
|
||||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
|
||||||
packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
additionalProperties.put("packageName", packageName);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CodegenType getTag() {
|
|
||||||
return CodegenType.SCHEMA;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "avro-schema";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHelp() {
|
|
||||||
return "Generates a Avro model (beta).";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String modelFileFolder() {
|
|
||||||
return outputFolder + File.separator;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
|
||||||
return postProcessModelsEnum(objs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setNonArrayMapProperty(CodegenProperty property, String type) {
|
|
||||||
super.setNonArrayMapProperty(property, type);
|
|
||||||
if (property.isModel) {
|
|
||||||
property.dataType = camelize(modelNamePrefix + property.dataType + modelNameSuffix);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeUnsafeCharacters(String input) {
|
|
||||||
// do nothing as it's a schema conversion
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// do nothing as it's a schema conversion
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -65,7 +65,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
// Defines TargetFrameworkVersion in csproj files
|
// Defines TargetFrameworkVersion in csproj files
|
||||||
protected String targetFramework = defaultFramework.name;
|
protected String targetFramework = defaultFramework.dotNetFrameworkVersion;
|
||||||
|
|
||||||
// Defines nuget identifiers for target framework
|
// Defines nuget identifiers for target framework
|
||||||
protected String targetFrameworkNuget = targetFramework;
|
protected String targetFrameworkNuget = targetFramework;
|
||||||
@@ -78,8 +78,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
// By default, generated code is considered public
|
// By default, generated code is considered public
|
||||||
protected boolean nonPublicApi = Boolean.FALSE;
|
protected boolean nonPublicApi = Boolean.FALSE;
|
||||||
|
|
||||||
protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE;
|
|
||||||
|
|
||||||
public CSharpNetCoreClientCodegen() {
|
public CSharpNetCoreClientCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@@ -208,10 +206,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
CodegenConstants.VALIDATABLE_DESC,
|
CodegenConstants.VALIDATABLE_DESC,
|
||||||
this.validatable);
|
this.validatable);
|
||||||
|
|
||||||
addSwitch(CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS,
|
|
||||||
CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS_DESC,
|
|
||||||
this.caseInsensitiveResponseHeaders);
|
|
||||||
|
|
||||||
regexModifiers = new HashMap<>();
|
regexModifiers = new HashMap<>();
|
||||||
regexModifiers.put('i', "IgnoreCase");
|
regexModifiers.put('i', "IgnoreCase");
|
||||||
regexModifiers.put('m', "Multiline");
|
regexModifiers.put('m', "Multiline");
|
||||||
@@ -476,7 +470,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
}
|
}
|
||||||
clientPackage = "Client";
|
clientPackage = "Client";
|
||||||
|
|
||||||
String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name);
|
String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.dotNetFrameworkVersion);
|
||||||
FrameworkStrategy strategy = defaultFramework;
|
FrameworkStrategy strategy = defaultFramework;
|
||||||
for (FrameworkStrategy frameworkStrategy : frameworkStrategies) {
|
for (FrameworkStrategy frameworkStrategy : frameworkStrategies) {
|
||||||
if (framework.equals(frameworkStrategy.name)) {
|
if (framework.equals(frameworkStrategy.name)) {
|
||||||
@@ -487,7 +481,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
strategy.configureAdditionalProperties(additionalProperties);
|
strategy.configureAdditionalProperties(additionalProperties);
|
||||||
|
|
||||||
setTargetFrameworkNuget(strategy.getNugetFrameworkIdentifier());
|
setTargetFrameworkNuget(strategy.getNugetFrameworkIdentifier());
|
||||||
setTargetFramework(strategy.name);
|
setTargetFramework(strategy.dotNetFrameworkVersion);
|
||||||
|
|
||||||
if (strategy != FrameworkStrategy.NETSTANDARD_2_0) {
|
if (strategy != FrameworkStrategy.NETSTANDARD_2_0) {
|
||||||
LOGGER.warn("If using built-in templates-RestSharp only supports netstandard 2.0 or later.");
|
LOGGER.warn("If using built-in templates-RestSharp only supports netstandard 2.0 or later.");
|
||||||
@@ -646,10 +640,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
this.validatable = validatable;
|
this.validatable = validatable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
|
||||||
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toEnumVarName(String value, String datatype) {
|
public String toEnumVarName(String value, String datatype) {
|
||||||
if (value.length() == 0) {
|
if (value.length() == 0) {
|
||||||
@@ -810,7 +800,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void configureAdditionalProperties(final Map<String, Object> properties) {
|
protected void configureAdditionalProperties(final Map<String, Object> properties) {
|
||||||
properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.name);
|
properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.dotNetFrameworkVersion);
|
||||||
|
|
||||||
// not intended to be user-settable
|
// not intended to be user-settable
|
||||||
properties.put(TARGET_FRAMEWORK_IDENTIFIER, this.getTargetFrameworkIdentifier());
|
properties.put(TARGET_FRAMEWORK_IDENTIFIER, this.getTargetFrameworkIdentifier());
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
cliOptions.add(CliOption.newBoolean(CodegenConstants.IS_GO_SUBMODULE, CodegenConstants.IS_GO_SUBMODULE_DESC));
|
cliOptions.add(CliOption.newBoolean(CodegenConstants.IS_GO_SUBMODULE, CodegenConstants.IS_GO_SUBMODULE_DESC));
|
||||||
cliOptions.add(CliOption.newBoolean(WITH_GO_CODEGEN_COMMENT, "whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs"));
|
cliOptions.add(CliOption.newBoolean(WITH_GO_CODEGEN_COMMENT, "whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs"));
|
||||||
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)"));
|
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)"));
|
||||||
cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_CLASS_PREFIX, CodegenConstants.ENUM_CLASS_PREFIX_DESC));
|
|
||||||
|
|
||||||
// option to change the order of form/body parameter
|
// option to change the order of form/body parameter
|
||||||
cliOptions.add(CliOption.newBoolean(
|
cliOptions.add(CliOption.newBoolean(
|
||||||
@@ -114,13 +114,6 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalProperties.containsKey(CodegenConstants.ENUM_CLASS_PREFIX)) {
|
|
||||||
setEnumClassPrefix(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_CLASS_PREFIX).toString()));
|
|
||||||
if (enumClassPrefix) {
|
|
||||||
additionalProperties.put(CodegenConstants.ENUM_CLASS_PREFIX, "true");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (additionalProperties.containsKey(CodegenConstants.IS_GO_SUBMODULE)) {
|
if (additionalProperties.containsKey(CodegenConstants.IS_GO_SUBMODULE)) {
|
||||||
setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString()));
|
setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString()));
|
||||||
if (isGoSubmodule) {
|
if (isGoSubmodule) {
|
||||||
|
|||||||
@@ -33,11 +33,9 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
public static final String NPM_REPOSITORY = "npmRepository";
|
public static final String NPM_REPOSITORY = "npmRepository";
|
||||||
public static final String WITH_INTERFACES = "withInterfaces";
|
public static final String WITH_INTERFACES = "withInterfaces";
|
||||||
public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter";
|
public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter";
|
||||||
public static final String PREFIX_PARAMETER_INTERFACES = "prefixParameterInterfaces";
|
|
||||||
|
|
||||||
protected String npmRepository = null;
|
protected String npmRepository = null;
|
||||||
private boolean useSingleRequestParameter = true;
|
private boolean useSingleRequestParameter = true;
|
||||||
private boolean prefixParameterInterfaces = false;
|
|
||||||
protected boolean addedApiIndex = false;
|
protected boolean addedApiIndex = false;
|
||||||
protected boolean addedModelIndex = false;
|
protected boolean addedModelIndex = false;
|
||||||
|
|
||||||
@@ -61,7 +59,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
|
this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
|
||||||
this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||||
this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.TRUE.toString()));
|
this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.TRUE.toString()));
|
||||||
this.cliOptions.add(new CliOption(PREFIX_PARAMETER_INTERFACES, "Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,11 +94,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
}
|
}
|
||||||
writePropertyBack(USE_SINGLE_REQUEST_PARAMETER, getUseSingleRequestParameter());
|
writePropertyBack(USE_SINGLE_REQUEST_PARAMETER, getUseSingleRequestParameter());
|
||||||
|
|
||||||
if (additionalProperties.containsKey(PREFIX_PARAMETER_INTERFACES)) {
|
|
||||||
this.setPrefixParameterInterfaces(convertPropertyToBoolean(PREFIX_PARAMETER_INTERFACES));
|
|
||||||
}
|
|
||||||
writePropertyBack(PREFIX_PARAMETER_INTERFACES, getPrefixParameterInterfaces());
|
|
||||||
|
|
||||||
if (additionalProperties.containsKey(NPM_NAME)) {
|
if (additionalProperties.containsKey(NPM_NAME)) {
|
||||||
addNpmPackageGeneration();
|
addNpmPackageGeneration();
|
||||||
}
|
}
|
||||||
@@ -216,7 +208,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
this.addOperationModelImportInfomation(operations);
|
this.addOperationModelImportInfomation(operations);
|
||||||
this.updateOperationParameterEnumInformation(operations);
|
this.updateOperationParameterEnumInformation(operations);
|
||||||
this.addOperationObjectResponseInformation(operations);
|
this.addOperationObjectResponseInformation(operations);
|
||||||
this.addOperationPrefixParameterInterfacesInformation(operations);
|
|
||||||
return operations;
|
return operations;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,11 +254,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addOperationPrefixParameterInterfacesInformation(Map<String, Object> operations) {
|
|
||||||
Map<String, Object> _operations = (Map<String, Object>) operations.get("operations");
|
|
||||||
operations.put("prefixParameterInterfaces", getPrefixParameterInterfaces());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addExtraReservedWords() {
|
private void addExtraReservedWords() {
|
||||||
this.reservedWords.add("BASE_PATH");
|
this.reservedWords.add("BASE_PATH");
|
||||||
this.reservedWords.add("BaseAPI");
|
this.reservedWords.add("BaseAPI");
|
||||||
@@ -303,12 +289,4 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
private void setUseSingleRequestParameter(boolean useSingleRequestParameter) {
|
private void setUseSingleRequestParameter(boolean useSingleRequestParameter) {
|
||||||
this.useSingleRequestParameter = useSingleRequestParameter;
|
this.useSingleRequestParameter = useSingleRequestParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getPrefixParameterInterfaces() {
|
|
||||||
return prefixParameterInterfaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setPrefixParameterInterfaces(boolean prefixParameterInterfaces) {
|
|
||||||
this.prefixParameterInterfaces = prefixParameterInterfaces;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* If the field is required, always include it, even if it is null.
|
* If the field is required, always include it, even if it is null.
|
||||||
* Else use custom behaviour, IOW use whatever is defined on the object mapper
|
* Else use custom behaviour, IOW use whatever is defined on the object mapper
|
||||||
}}
|
}}
|
||||||
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
|
@JsonProperty(JSON_PROPERTY_{{vendorExtensions.x-java-const-name}})
|
||||||
@JsonInclude({{#isMapContainer}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMapContainer}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
|
@JsonInclude({{#isMapContainer}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMapContainer}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
|
||||||
{{#withXml}}
|
{{#withXml}}
|
||||||
{{^isContainer}}
|
{{^isContainer}}
|
||||||
@@ -16,4 +16,4 @@
|
|||||||
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
|
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
|
||||||
{{/isXmlWrapped}}
|
{{/isXmlWrapped}}
|
||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{/withXml}}
|
{{/withXml}}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {{invokerPackage}}.ApiClient;
|
|||||||
{{/imports}}
|
{{/imports}}
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.google.api.client.http.EmptyContent;
|
|
||||||
import com.google.api.client.http.GenericUrl;
|
import com.google.api.client.http.GenericUrl;
|
||||||
import com.google.api.client.http.HttpContent;
|
import com.google.api.client.http.HttpContent;
|
||||||
import com.google.api.client.http.InputStreamContent;
|
import com.google.api.client.http.InputStreamContent;
|
||||||
@@ -108,7 +107,7 @@ public class {{classname}} {
|
|||||||
String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}}
|
String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}}
|
||||||
GenericUrl genericUrl = new GenericUrl(localVarUrl);
|
GenericUrl genericUrl = new GenericUrl(localVarUrl);
|
||||||
|
|
||||||
HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}};
|
HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}};
|
||||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
|
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
|
||||||
}{{#bodyParam}}
|
}{{#bodyParam}}
|
||||||
|
|
||||||
@@ -180,7 +179,7 @@ public class {{classname}} {
|
|||||||
String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}}
|
String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}}
|
||||||
GenericUrl genericUrl = new GenericUrl(localVarUrl);
|
GenericUrl genericUrl = new GenericUrl(localVarUrl);
|
||||||
|
|
||||||
HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}};
|
HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}};
|
||||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
|
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -704,7 +704,7 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
|
Entity<?> entity = serialize(body, formParams, contentType);
|
||||||
|
|
||||||
Response response = null;
|
Response response = null;
|
||||||
|
|
||||||
@@ -716,13 +716,11 @@ public class ApiClient {
|
|||||||
} else if ("PUT".equals(method)) {
|
} else if ("PUT".equals(method)) {
|
||||||
response = invocationBuilder.put(entity);
|
response = invocationBuilder.put(entity);
|
||||||
} else if ("DELETE".equals(method)) {
|
} else if ("DELETE".equals(method)) {
|
||||||
response = invocationBuilder.method("DELETE", entity);
|
response = invocationBuilder.delete();
|
||||||
} else if ("PATCH".equals(method)) {
|
} else if ("PATCH".equals(method)) {
|
||||||
response = invocationBuilder.method("PATCH", entity);
|
response = invocationBuilder.method("PATCH", entity);
|
||||||
} else if ("HEAD".equals(method)) {
|
} else if ("HEAD".equals(method)) {
|
||||||
response = invocationBuilder.head();
|
response = invocationBuilder.head();
|
||||||
} else if ("OPTIONS".equals(method)) {
|
|
||||||
response = invocationBuilder.options();
|
|
||||||
} else if ("TRACE".equals(method)) {
|
} else if ("TRACE".equals(method)) {
|
||||||
response = invocationBuilder.trace();
|
response = invocationBuilder.trace();
|
||||||
} else {
|
} else {
|
||||||
@@ -776,8 +774,6 @@ public class ApiClient {
|
|||||||
clientConfig.register(json);
|
clientConfig.register(json);
|
||||||
clientConfig.register(JacksonFeature.class);
|
clientConfig.register(JacksonFeature.class);
|
||||||
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
|
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
|
||||||
// turn off compliance validation to be able to send payloads with DELETE calls
|
|
||||||
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
|
|
||||||
if (debugging) {
|
if (debugging) {
|
||||||
{{^supportJava6}}
|
{{^supportJava6}}
|
||||||
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
|
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
|
||||||
@@ -788,9 +784,6 @@ public class ApiClient {
|
|||||||
{{#supportJava6}}
|
{{#supportJava6}}
|
||||||
clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true));
|
clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true));
|
||||||
{{/supportJava6}}
|
{{/supportJava6}}
|
||||||
} else {
|
|
||||||
// suppress warnings for payloads with DELETE calls:
|
|
||||||
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
|
|
||||||
}
|
}
|
||||||
performAdditionalClientConfiguration(clientConfig);
|
performAdditionalClientConfiguration(clientConfig);
|
||||||
return ClientBuilder.newClient(clientConfig);
|
return ClientBuilder.newClient(clientConfig);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class {{classname}} {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
{{/isDeprecated}}
|
{{/isDeprecated}}
|
||||||
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||||
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}{{#required}}
|
||||||
// verify the required parameter '{{paramName}}' is set
|
// verify the required parameter '{{paramName}}' is set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
|
|||||||
@@ -252,17 +252,6 @@ public class ApiClient {
|
|||||||
return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath;
|
return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a custom scheme for the target service, for example 'https'.
|
|
||||||
*
|
|
||||||
* @param scheme The scheme of the target service
|
|
||||||
* @return This object.
|
|
||||||
*/
|
|
||||||
public ApiClient setScheme(String scheme){
|
|
||||||
this.scheme = scheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a custom request interceptor.
|
* Set a custom request interceptor.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class {{classname}} {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
{{/isDeprecated}}
|
{{/isDeprecated}}
|
||||||
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException {
|
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException {
|
||||||
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
|
||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
String localVarPath = "{{{path}}}"{{#pathParams}}
|
String localVarPath = "{{{path}}}"{{#pathParams}}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
|
|||||||
|
|
||||||
import {{invokerPackage}}.auth.Authentication;
|
import {{invokerPackage}}.auth.Authentication;
|
||||||
import {{invokerPackage}}.auth.HttpBasicAuth;
|
import {{invokerPackage}}.auth.HttpBasicAuth;
|
||||||
import {{invokerPackage}}.auth.HttpBearerAuth;
|
|
||||||
import {{invokerPackage}}.auth.ApiKeyAuth;
|
import {{invokerPackage}}.auth.ApiKeyAuth;
|
||||||
{{#hasOAuthMethods}}
|
{{#hasOAuthMethods}}
|
||||||
import {{invokerPackage}}.auth.OAuth;
|
import {{invokerPackage}}.auth.OAuth;
|
||||||
@@ -79,9 +78,8 @@ public class ApiClient {
|
|||||||
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}");
|
setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}");
|
||||||
|
|
||||||
// Setup authentications (key: authentication name, value: authentication).
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
|
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}
|
||||||
authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}}
|
authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}}
|
||||||
authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}}
|
|
||||||
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
|
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
|
||||||
authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
|
authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
@@ -663,13 +661,11 @@ public class ApiClient {
|
|||||||
} else if ("PUT".equals(method)) {
|
} else if ("PUT".equals(method)) {
|
||||||
response = invocationBuilder.put(entity);
|
response = invocationBuilder.put(entity);
|
||||||
} else if ("DELETE".equals(method)) {
|
} else if ("DELETE".equals(method)) {
|
||||||
response = invocationBuilder.method("DELETE", entity);
|
response = invocationBuilder.delete();
|
||||||
} else if ("PATCH".equals(method)) {
|
} else if ("PATCH".equals(method)) {
|
||||||
response = invocationBuilder.method("PATCH", entity);
|
response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity);
|
||||||
} else if ("HEAD".equals(method)) {
|
} else if ("HEAD".equals(method)) {
|
||||||
response = invocationBuilder.head();
|
response = invocationBuilder.head();
|
||||||
} else if ("OPTIONS".equals(method)) {
|
|
||||||
response = invocationBuilder.options();
|
|
||||||
} else if ("TRACE".equals(method)) {
|
} else if ("TRACE".equals(method)) {
|
||||||
response = invocationBuilder.trace();
|
response = invocationBuilder.trace();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class {{classname}} {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
{{/isDeprecated}}
|
{{/isDeprecated}}
|
||||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||||
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}{{#required}}
|
||||||
// verify the required parameter '{{paramName}}' is set
|
// verify the required parameter '{{paramName}}' is set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ public class ApiClient {
|
|||||||
|
|
||||||
updateParamsForAuth(authNames, queryParams, headerParams);
|
updateParamsForAuth(authNames, queryParams, headerParams);
|
||||||
|
|
||||||
if (accepts != null && accepts.length > 0) {
|
if (accepts != null) {
|
||||||
headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts));
|
headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,7 +579,7 @@ public class ApiClient {
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
resultContent = this.objectMapper.readValue(httpResponse.bodyAsString(), returnType);
|
resultContent = Json.mapper.readValue(httpResponse.bodyAsString(), returnType);
|
||||||
result = Future.succeededFuture(resultContent);
|
result = Future.succeededFuture(resultContent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
result = ApiException.fail(new DecodeException("Failed to decode:" + e.getMessage(), e));
|
result = ApiException.fail(new DecodeException("Failed to decode:" + e.getMessage(), e));
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
|
|||||||
{{/isXmlAttribute}}
|
{{/isXmlAttribute}}
|
||||||
{{/withXml}}
|
{{/withXml}}
|
||||||
{{#gson}}
|
{{#gson}}
|
||||||
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
|
public static final String SERIALIZED_NAME_{{vendorExtensions.x-java-const-name}} = "{{baseName}}";
|
||||||
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
|
@SerializedName(SERIALIZED_NAME_{{vendorExtensions.x-java-const-name}})
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
{{#jackson}}
|
{{#jackson}}
|
||||||
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
|
public static final String JSON_PROPERTY_{{vendorExtensions.x-java-const-name}} = "{{baseName}}";
|
||||||
{{/jackson}}
|
{{/jackson}}
|
||||||
{{#vendorExtensions.isJacksonOptionalNullable}}
|
{{#vendorExtensions.isJacksonOptionalNullable}}
|
||||||
{{#isContainer}}
|
{{#isContainer}}
|
||||||
@@ -197,7 +197,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
|
|||||||
|
|
||||||
{{^isReadOnly}}
|
{{^isReadOnly}}
|
||||||
{{#vendorExtensions.isJacksonOptionalNullable}}
|
{{#vendorExtensions.isJacksonOptionalNullable}}
|
||||||
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
|
@JsonProperty(JSON_PROPERTY_{{vendorExtensions.x-java-const-name}})
|
||||||
public void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
|
public void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
|
||||||
this.{{name}} = {{name}};
|
this.{{name}} = {{name}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ org.openapitools.codegen.languages.AndroidClientCodegen
|
|||||||
org.openapitools.codegen.languages.Apache2ConfigCodegen
|
org.openapitools.codegen.languages.Apache2ConfigCodegen
|
||||||
org.openapitools.codegen.languages.ApexClientCodegen
|
org.openapitools.codegen.languages.ApexClientCodegen
|
||||||
org.openapitools.codegen.languages.AspNetCoreServerCodegen
|
org.openapitools.codegen.languages.AspNetCoreServerCodegen
|
||||||
org.openapitools.codegen.languages.AvroSchemaCodegen
|
|
||||||
org.openapitools.codegen.languages.BashClientCodegen
|
org.openapitools.codegen.languages.BashClientCodegen
|
||||||
org.openapitools.codegen.languages.CLibcurlClientCodegen
|
org.openapitools.codegen.languages.CLibcurlClientCodegen
|
||||||
org.openapitools.codegen.languages.ClojureClientCodegen
|
org.openapitools.codegen.languages.ClojureClientCodegen
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
{{#models}}
|
|
||||||
{{#model}}
|
|
||||||
{
|
|
||||||
"namespace": "{{packageName}}",
|
|
||||||
"type": "{{#isEnum}}enum{{/isEnum}}{{^isEnum}}record{{/isEnum}}",
|
|
||||||
"doc": "{{{description}}}",
|
|
||||||
"name": "{{{classname}}}",
|
|
||||||
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}}
|
|
||||||
}
|
|
||||||
{{/model}}
|
|
||||||
{{/models}}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
"symbols": [{{#allowableValues}}{{#enumVars}}
|
|
||||||
{{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
|
||||||
]
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
"fields": [
|
|
||||||
{{#vars}}
|
|
||||||
{
|
|
||||||
"name": "{{baseName}}",
|
|
||||||
"type": {{^required}}["null", {{/required}}{{>typeProperty}}{{^required}}]{{/required}},
|
|
||||||
"doc": "{{{description}}}"
|
|
||||||
}{{^-last}},{{/-last}}
|
|
||||||
{{/vars}}
|
|
||||||
]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "{{dataType}}",
|
|
||||||
{{#items}}"items": "{{#isModel}}{{package}}.{{/isModel}}{{dataType}}"{{/items}}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "enum",
|
|
||||||
"name": "{{classname}}_{{name}}",
|
|
||||||
"symbols": [{{#allowableValues}}{{#enumVars}}
|
|
||||||
{{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{{^isEnum}}{{^isContainer}}{{#isPrimitiveType}}"{{dataType}}"{{/isPrimitiveType}}{{#isModel}}"{{package}}.{{dataType}}"{{/isModel}}{{/isContainer}}{{#isContainer}}{{>typeArray}}{{/isContainer}}{{/isEnum}}{{#isEnum}}{{>typeEnum}}{{/isEnum}}
|
|
||||||
@@ -347,7 +347,7 @@ namespace {{packageName}}.Client
|
|||||||
private ApiResponse<T> toApiResponse<T>({{#supportsAsync}}IRestResponse<T> response{{/supportsAsync}}{{^supportsAsync}}IRestResponse response, CustomJsonCodec des{{/supportsAsync}})
|
private ApiResponse<T> toApiResponse<T>({{#supportsAsync}}IRestResponse<T> response{{/supportsAsync}}{{^supportsAsync}}IRestResponse response, CustomJsonCodec des{{/supportsAsync}})
|
||||||
{
|
{
|
||||||
T result = {{#supportsAsync}}response.Data{{/supportsAsync}}{{^supportsAsync}}(T)des.Deserialize(response, typeof(T)){{/supportsAsync}};
|
T result = {{#supportsAsync}}response.Data{{/supportsAsync}}{{^supportsAsync}}(T)des.Deserialize(response, typeof(T)){{/supportsAsync}};
|
||||||
var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result)
|
var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>(), result)
|
||||||
{
|
{
|
||||||
ErrorText = response.ErrorMessage,
|
ErrorText = response.ErrorMessage,
|
||||||
Cookies = new List<Cookie>()
|
Cookies = new List<Cookie>()
|
||||||
|
|||||||
@@ -21,26 +21,6 @@ namespace {{packageName}}.Client
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Constructors
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Empty Constructor.
|
|
||||||
/// </summary>
|
|
||||||
public Multimap()
|
|
||||||
{
|
|
||||||
_dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary<T, IList<TValue>>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor with comparer.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="comparer"></param>
|
|
||||||
public Multimap(IEqualityComparer<T> comparer) {
|
|
||||||
_dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary<T, IList<TValue>>(comparer);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Constructors
|
|
||||||
|
|
||||||
#region Enumerators
|
#region Enumerators
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -277,7 +257,7 @@ namespace {{packageName}}.Client
|
|||||||
#region Private Members
|
#region Private Members
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to encapsulate generator differences between dictionary types.
|
* Helper method to encapsulate generator differences between dictioary types.
|
||||||
*/
|
*/
|
||||||
private bool TryRemove(T key, out IList<TValue> value)
|
private bool TryRemove(T key, out IList<TValue> value)
|
||||||
{
|
{
|
||||||
@@ -299,7 +279,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to encapsulate generator differences between dictionary types.
|
* Helper method to encapsulate generator differences between dictioary types.
|
||||||
*/
|
*/
|
||||||
private bool TryAdd(T key, IList<TValue> value)
|
private bool TryAdd(T key, IList<TValue> value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
<RootNamespace>{{packageName}}</RootNamespace>
|
<RootNamespace>{{packageName}}</RootNamespace>
|
||||||
<AssemblyName>{{packageName}}</AssemblyName>
|
<AssemblyName>{{packageName}}</AssemblyName>
|
||||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<TargetFramework>{{targetFramework}}</TargetFramework>
|
<!--<TargetFrameworkVersion>{{targetFramework}}</TargetFrameworkVersion>-->
|
||||||
|
<TargetFrameworkVersion>{{targetFrameworkVersion}}</TargetFrameworkVersion>
|
||||||
|
<TargetFrameworkIdentifier>{{targetFrameworkIdentifier}}</TargetFrameworkIdentifier>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml</DocumentationFile>
|
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -38,4 +40,6 @@
|
|||||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,18 @@
|
|||||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<Import Project="..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\{{packageName}}\{{packageName}}.csproj">
|
<ProjectReference Include="..\{{packageName}}\{{packageName}}.csproj">
|
||||||
<Project>{{packageGuid}}</Project>
|
<Project>{{packageGuid}}</Project>
|
||||||
<Name>{{packageName}}</Name>
|
<Name>{{packageName}}</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<TargetFramework>{{targetFramework}}</TargetFramework>
|
<TargetFramework>{{targetFramework}}</TargetFramework>
|
||||||
|
<TargetFrameworkVersion>{{targetFrameworkVersion}}</TargetFrameworkVersion>
|
||||||
|
<TargetFrameworkIdentifier>{{targetFrameworkIdentifier}}</TargetFrameworkIdentifier>
|
||||||
<AssemblyName>{{packageName}}</AssemblyName>
|
<AssemblyName>{{packageName}}</AssemblyName>
|
||||||
<PackageId>{{packageName}}</PackageId>
|
<PackageId>{{packageName}}</PackageId>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
|
|||||||
@@ -23,8 +23,6 @@
|
|||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||||
<PackageReference Include="xunit" Version="2.4.1" />
|
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
{{^netStandard}}
|
{{^netStandard}}
|
||||||
|
|||||||
@@ -245,7 +245,6 @@ namespace {{packageName}}.Client
|
|||||||
var request = PrepareRequest(
|
var request = PrepareRequest(
|
||||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||||
pathParams, contentType);
|
pathParams, contentType);
|
||||||
RestClient.UserAgent = Configuration.UserAgent;
|
|
||||||
InterceptRequest(request);
|
InterceptRequest(request);
|
||||||
var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request);
|
var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request);
|
||||||
InterceptResponse(request, response);
|
InterceptResponse(request, response);
|
||||||
|
|||||||
@@ -16,63 +16,51 @@ class {{classname}} {
|
|||||||
{{classname}}.fromJson(Map<String, dynamic> json) {
|
{{classname}}.fromJson(Map<String, dynamic> json) {
|
||||||
if (json == null) return;
|
if (json == null) return;
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
|
if (json['{{baseName}}'] == null) {
|
||||||
|
{{name}} = null;
|
||||||
|
} else {
|
||||||
{{#isDateTime}}
|
{{#isDateTime}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = DateTime.parse(json['{{baseName}}']);
|
||||||
null :
|
|
||||||
DateTime.parse(json['{{baseName}}']);
|
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = DateTime.parse(json['{{baseName}}']);
|
||||||
null :
|
|
||||||
DateTime.parse(json['{{baseName}}']);
|
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{^isDateTime}}
|
{{^isDateTime}}
|
||||||
{{^isDate}}
|
{{^isDate}}
|
||||||
{{#complexType}}
|
{{#complexType}}
|
||||||
{{#isListContainer}}
|
{{#isListContainer}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = {{complexType}}.listFromJson(json['{{baseName}}']);
|
||||||
null :
|
|
||||||
{{complexType}}.listFromJson(json['{{baseName}}']);
|
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{^isListContainer}}
|
{{^isListContainer}}
|
||||||
{{#isMapContainer}}
|
{{#isMapContainer}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = {{complexType}}.mapFromJson(json['{{baseName}}']);
|
||||||
null :
|
|
||||||
{{complexType}}.mapFromJson(json['{{baseName}}']);
|
|
||||||
{{/isMapContainer}}
|
{{/isMapContainer}}
|
||||||
{{^isMapContainer}}
|
{{^isMapContainer}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = {{complexType}}.fromJson(json['{{baseName}}']);
|
||||||
null :
|
|
||||||
{{complexType}}.fromJson(json['{{baseName}}']);
|
|
||||||
{{/isMapContainer}}
|
{{/isMapContainer}}
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{/complexType}}
|
{{/complexType}}
|
||||||
{{^complexType}}
|
{{^complexType}}
|
||||||
{{#isListContainer}}
|
{{#isListContainer}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = (json['{{baseName}}'] as List).cast<{{items.datatype}}>();
|
||||||
null :
|
|
||||||
(json['{{baseName}}'] as List).cast<{{items.datatype}}>();
|
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{^isListContainer}}
|
{{^isListContainer}}
|
||||||
{{#isMapContainer}}
|
{{#isMapContainer}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = (json['{{baseName}}'] as Map).cast<String, {{items.datatype}}>();
|
||||||
null :
|
|
||||||
(json['{{baseName}}'] as Map).cast<String, {{items.datatype}}>();
|
|
||||||
{{/isMapContainer}}
|
{{/isMapContainer}}
|
||||||
{{^isMapContainer}}
|
{{^isMapContainer}}
|
||||||
{{#isDouble}}
|
{{#isDouble}}
|
||||||
{{name}} = (json['{{baseName}}'] == null) ?
|
{{name}} = json['{{baseName}}'].toDouble();
|
||||||
null :
|
{{/isDouble}}
|
||||||
json['{{baseName}}'].toDouble();
|
{{^isDouble}}
|
||||||
{{/isDouble}}
|
{{name}} = json['{{baseName}}'];
|
||||||
{{^isDouble}}
|
{{/isDouble}}
|
||||||
{{name}} = json['{{baseName}}'];
|
|
||||||
{{/isDouble}}
|
|
||||||
{{/isMapContainer}}
|
{{/isMapContainer}}
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{/complexType}}
|
{{/complexType}}
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
|
}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ package {{packageName}}
|
|||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
import (
|
import (
|
||||||
_context "context"
|
"context"
|
||||||
_ioutil "io/ioutil"
|
"io/ioutil"
|
||||||
_nethttp "net/http"
|
"net/http"
|
||||||
_neturl "net/url"
|
"net/url"
|
||||||
{{#imports}} "{{import}}"
|
{{#imports}} "{{import}}"
|
||||||
{{/imports}}
|
{{/imports}}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Linger please
|
// Linger please
|
||||||
var (
|
var (
|
||||||
_ _context.Context
|
_ context.Context
|
||||||
)
|
)
|
||||||
|
|
||||||
type {{classname}}Service service
|
type {{classname}}Service service
|
||||||
@@ -24,7 +24,7 @@ type {{classname}}Service service
|
|||||||
{{#notes}}
|
{{#notes}}
|
||||||
{{notes}}
|
{{notes}}
|
||||||
{{/notes}}
|
{{/notes}}
|
||||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
* @param {{paramName}}{{#description}} {{{.}}}{{/description}}
|
* @param {{paramName}}{{#description}} {{{.}}}{{/description}}
|
||||||
@@ -63,9 +63,9 @@ type {{{nickname}}}Opts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{{/hasOptionalParams}}
|
{{/hasOptionalParams}}
|
||||||
func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) {
|
func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) {
|
||||||
var (
|
var (
|
||||||
localVarHttpMethod = _nethttp.Method{{httpMethod}}
|
localVarHttpMethod = http.Method{{httpMethod}}
|
||||||
localVarPostBody interface{}
|
localVarPostBody interface{}
|
||||||
localVarFormFileName string
|
localVarFormFileName string
|
||||||
localVarFileName string
|
localVarFileName string
|
||||||
@@ -77,11 +77,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
|
|||||||
|
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}}
|
localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}}
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", {{paramName}})), -1){{/pathParams}}
|
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", url.QueryEscape(fmt.Sprintf("%v", {{paramName}})), -1){{/pathParams}}
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := _neturl.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
localVarFormParams := _neturl.Values{}
|
localVarFormParams := url.Values{}
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
{{#minItems}}
|
{{#minItems}}
|
||||||
@@ -132,37 +132,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
|
|||||||
{{#hasQueryParams}}
|
{{#hasQueryParams}}
|
||||||
{{#queryParams}}
|
{{#queryParams}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
{{#isCollectionFormatMulti}}
|
|
||||||
t:={{paramName}}
|
|
||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
|
||||||
s := reflect.ValueOf(t)
|
|
||||||
for i := 0; i < s.Len(); i++ {
|
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
|
||||||
}
|
|
||||||
{{/isCollectionFormatMulti}}
|
|
||||||
{{^isCollectionFormatMulti}}
|
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
||||||
{{/isCollectionFormatMulti}}
|
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{^required}}
|
{{^required}}
|
||||||
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() {
|
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() {
|
||||||
{{#isCollectionFormatMulti}}
|
|
||||||
t:=localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value()
|
|
||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
|
||||||
s := reflect.ValueOf(t)
|
|
||||||
for i := 0; i < s.Len(); i++ {
|
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
|
||||||
}
|
|
||||||
{{/isCollectionFormatMulti}}
|
|
||||||
{{^isCollectionFormatMulti}}
|
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
||||||
{{/isCollectionFormatMulti}}
|
|
||||||
}
|
}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{/queryParams}}
|
{{/queryParams}}
|
||||||
@@ -218,7 +192,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
|
|||||||
}
|
}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
if localVarFile != nil {
|
if localVarFile != nil {
|
||||||
fbs, _ := _ioutil.ReadAll(localVarFile)
|
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||||
localVarFileBytes = fbs
|
localVarFileBytes = fbs
|
||||||
localVarFileName = localVarFile.Name()
|
localVarFileName = localVarFile.Name()
|
||||||
localVarFile.Close()
|
localVarFile.Close()
|
||||||
@@ -303,7 +277,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
|
|||||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body)
|
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
|
||||||
localVarHttpResponse.Body.Close()
|
localVarHttpResponse.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const (
|
|||||||
{{#enumVars}}
|
{{#enumVars}}
|
||||||
{{^-first}}
|
{{^-first}}
|
||||||
{{/-first}}
|
{{/-first}}
|
||||||
{{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = "{{{value}}}"
|
{{{classname.toUpperCase}}}_{{name}} {{{classname}}} = "{{{value}}}"
|
||||||
{{/enumVars}}
|
{{/enumVars}}
|
||||||
{{/allowableValues}}
|
{{/allowableValues}}
|
||||||
){{/isEnum}}{{^isEnum}}{{#description}}
|
){{/isEnum}}{{^isEnum}}{{#description}}
|
||||||
@@ -36,7 +36,7 @@ type {{classname}} struct {
|
|||||||
// {{{description}}}
|
// {{{description}}}
|
||||||
{{/description}}
|
{{/description}}
|
||||||
{{name}} *{{{dataType}}} `json:"{{baseName}},omitempty"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
|
{{name}} *{{{dataType}}} `json:"{{baseName}},omitempty"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
|
||||||
{{#isNullable}} isExplicitNull{{name}} bool `json:"-"{{#withXml}} xml:"-"{{/withXml}}`{{/isNullable}}
|
{{#isNullable}} isExplicitNull{{name}} bool `json:"-"{{#withXml}} xml:"-"{{/withXml}}`{{/isNullable}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
}
|
}
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const (
|
|||||||
{{#enumVars}}
|
{{#enumVars}}
|
||||||
{{^-first}}
|
{{^-first}}
|
||||||
{{/-first}}
|
{{/-first}}
|
||||||
{{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = "{{{value}}}"
|
{{{classname.toUpperCase}}}_{{name}} {{{classname}}} = "{{{value}}}"
|
||||||
{{/enumVars}}
|
{{/enumVars}}
|
||||||
{{/allowableValues}}
|
{{/allowableValues}}
|
||||||
){{/isEnum}}{{^isEnum}}{{#description}}
|
){{/isEnum}}{{^isEnum}}{{#description}}
|
||||||
|
|||||||
@@ -54,29 +54,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
{{^authMethods}}No authorization required{{/authMethods}}
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
{{#authMethods}}
|
|
||||||
{{#isApiKey}}
|
|
||||||
Configure {{name}}:
|
|
||||||
ApiClient.apiKey["{{keyParamName}}"] = ""
|
|
||||||
ApiClient.apiKeyPrefix["{{keyParamName}}"] = ""
|
|
||||||
{{/isApiKey}}
|
|
||||||
{{#isBasic}}
|
|
||||||
{{^isBasicBearer}}
|
|
||||||
Configure {{name}}:
|
|
||||||
ApiClient.username = ""
|
|
||||||
ApiClient.password = ""
|
|
||||||
{{/isBasicBearer}}
|
|
||||||
{{#isBasicBearer}}
|
|
||||||
Configure {{name}}:
|
|
||||||
ApiClient.accessToken = ""
|
|
||||||
{{/isBasicBearer}}
|
|
||||||
{{/isBasic}}
|
|
||||||
{{#isOAuth}}
|
|
||||||
Configure {{name}}:
|
|
||||||
ApiClient.accessToken = ""
|
|
||||||
{{/isOAuth}}
|
|
||||||
{{/authMethods}}
|
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
|||||||
@@ -15,18 +15,11 @@ open class ApiClient(val baseUrl: String) {
|
|||||||
companion object {
|
companion object {
|
||||||
protected const val ContentType = "Content-Type"
|
protected const val ContentType = "Content-Type"
|
||||||
protected const val Accept = "Accept"
|
protected const val Accept = "Accept"
|
||||||
protected const val Authorization = "Authorization"
|
|
||||||
protected const val JsonMediaType = "application/json"
|
protected const val JsonMediaType = "application/json"
|
||||||
protected const val FormDataMediaType = "multipart/form-data"
|
protected const val FormDataMediaType = "multipart/form-data"
|
||||||
protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
|
protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
|
||||||
protected const val XmlMediaType = "application/xml"
|
protected const val XmlMediaType = "application/xml"
|
||||||
|
|
||||||
val apiKey: MutableMap<String, String> = mutableMapOf()
|
|
||||||
val apiKeyPrefix: MutableMap<String, String> = mutableMapOf()
|
|
||||||
var username: String? = null
|
|
||||||
var password: String? = null
|
|
||||||
var accessToken: String? = null
|
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val client: OkHttpClient by lazy {
|
val client: OkHttpClient by lazy {
|
||||||
builder.build()
|
builder.build()
|
||||||
@@ -72,63 +65,8 @@ open class ApiClient(val baseUrl: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#hasAuthMethods}}
|
|
||||||
protected fun updateAuthParams(requestConfig: RequestConfig) {
|
|
||||||
{{#authMethods}}
|
|
||||||
{{#isApiKey}}
|
|
||||||
{{#isKeyInHeader}}
|
|
||||||
if (requestConfig.headers["{{keyParamName}}"].isNullOrEmpty()) {
|
|
||||||
{{/isKeyInHeader}}
|
|
||||||
{{#isKeyInQuery}}
|
|
||||||
if (requestConfig.query["{{keyParamName}}"].isNullOrEmpty()) {
|
|
||||||
{{/isKeyInQuery}}
|
|
||||||
if (apiKey["{{keyParamName}}"] != null) {
|
|
||||||
if (apiKeyPrefix["{{keyParamName}}"] != null) {
|
|
||||||
{{#isKeyInHeader}}
|
|
||||||
requestConfig.headers["{{keyParamName}}"] = apiKeyPrefix["{{keyParamName}}"]!! + " " + apiKey["{{keyParamName}}"]!!
|
|
||||||
{{/isKeyInHeader}}
|
|
||||||
{{#isKeyInQuery}}
|
|
||||||
requestConfig.query["{{keyParamName}}"] = apiKeyPrefix["{{keyParamName}}"]!! + " " + apiKey["{{keyParamName}}"]!!
|
|
||||||
{{/isKeyInQuery}}
|
|
||||||
} else {
|
|
||||||
{{#isKeyInHeader}}
|
|
||||||
requestConfig.headers["{{keyParamName}}"] = apiKey["{{keyParamName}}"]!!
|
|
||||||
{{/isKeyInHeader}}
|
|
||||||
{{#isKeyInQuery}}
|
|
||||||
requestConfig.query["{{keyParamName}}"] = apiKey["{{keyParamName}}"]!!
|
|
||||||
{{/isKeyInQuery}}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{{/isApiKey}}
|
|
||||||
{{#isBasic}}
|
|
||||||
{{^isBasicBearer}}
|
|
||||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
|
||||||
requestConfig.headers[Authorization] = Credentials.basic(username, password)
|
|
||||||
}
|
|
||||||
{{/isBasicBearer}}
|
|
||||||
{{#isBasicBearer}}
|
|
||||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
|
||||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
|
||||||
}
|
|
||||||
{{/isBasicBearer}}
|
|
||||||
{{/isBasic}}
|
|
||||||
{{#isOAuth}}
|
|
||||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
|
||||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
|
||||||
}
|
|
||||||
{{/isOAuth}}
|
|
||||||
{{/authMethods}}
|
|
||||||
}
|
|
||||||
{{/hasAuthMethods}}
|
|
||||||
|
|
||||||
protected inline fun <reified T: Any?> request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse<T?> {
|
protected inline fun <reified T: Any?> request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse<T?> {
|
||||||
val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
|
val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.")
|
||||||
{{#hasAuthMethods}}
|
|
||||||
|
|
||||||
// take authMethod from operation
|
|
||||||
updateAuthParams(requestConfig)
|
|
||||||
{{/hasAuthMethods}}
|
|
||||||
|
|
||||||
val url = httpUrl.newBuilder()
|
val url = httpUrl.newBuilder()
|
||||||
.addPathSegments(requestConfig.path.trimStart('/'))
|
.addPathSegments(requestConfig.path.trimStart('/'))
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ def _deserialize(data, klass):
|
|||||||
if data is None:
|
if data is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if klass in six.integer_types or klass in (float, str, bool, bytearray):
|
if klass in six.integer_types or klass in (float, str, bool):
|
||||||
return _deserialize_primitive(data, klass)
|
return _deserialize_primitive(data, klass)
|
||||||
elif klass == object:
|
elif klass == object:
|
||||||
return _deserialize_object(data)
|
return _deserialize_object(data)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ setup(
|
|||||||
url="{{packageUrl}}",
|
url="{{packageUrl}}",
|
||||||
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
|
keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
|
||||||
install_requires=REQUIRES,
|
install_requires=REQUIRES,
|
||||||
packages=find_packages(exclude=["test", "tests"]),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
long_description="""\
|
long_description="""\
|
||||||
{{appDescription}} # noqa: E501
|
{{appDescription}} # noqa: E501
|
||||||
|
|||||||
@@ -291,22 +291,6 @@
|
|||||||
{{! Returning the ApiResponse object with NULL object when the endpoint doesn't return anything}}
|
{{! Returning the ApiResponse object with NULL object when the endpoint doesn't return anything}}
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
{{#returnExceptionOnFailure}}
|
|
||||||
errorMsg <- toString(content(resp))
|
|
||||||
if(errorMsg == ""){
|
|
||||||
errorMsg <- paste("Server returned " , httr::status_code(resp) , " response status code.")
|
|
||||||
}
|
|
||||||
{{#useDefaultExceptionHandling}}
|
|
||||||
stop(errorMsg)
|
|
||||||
{{/useDefaultExceptionHandling}}
|
|
||||||
{{#useRlangExceptionHandling}}
|
|
||||||
rlang::abort(message = errorMsg, .subclass = "ApiException", ApiException = ApiException$new(http_response = resp))
|
|
||||||
{{/useRlangExceptionHandling}}
|
|
||||||
{{/returnExceptionOnFailure}}
|
|
||||||
{{^returnExceptionOnFailure}}
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
{{/returnExceptionOnFailure}}
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
{{#returnExceptionOnFailure}}
|
{{#returnExceptionOnFailure}}
|
||||||
errorMsg <- toString(content(resp))
|
errorMsg <- toString(content(resp))
|
||||||
|
|||||||
@@ -95,14 +95,7 @@ Name | Type | Description | Notes
|
|||||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
{{#responses.0}}
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
{{#responses}}
|
|
||||||
| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} <br> {{/headers}}{{^headers.0}} - {{/headers.0}} |
|
|
||||||
{{/responses}}
|
|
||||||
{{/responses.0}}
|
|
||||||
|
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ export class {{classname}} {
|
|||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{^isListContainer}}
|
{{^isListContainer}}
|
||||||
if ({{paramName}} !== undefined) {
|
if ({{paramName}} !== undefined) {
|
||||||
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{^isModel}}<any>{{paramName}}{{/isModel}}{{#isModel}}useForm ? JSON.stringify({{paramName}}) : <any>{{paramName}}{{/isModel}}){{#useHttpClient}} as any || formParams{{/useHttpClient}};
|
{{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', <any>{{paramName}}){{#useHttpClient}} as any || formParams{{/useHttpClient}};
|
||||||
}
|
}
|
||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ import {
|
|||||||
{{#operations}}
|
{{#operations}}
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
{{#allParams.0}}
|
{{#allParams.0}}
|
||||||
export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request {
|
export interface {{operationIdCamelCase}}Request {
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}};
|
{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}};
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/allParams.0}}
|
{{/allParams.0}}
|
||||||
@@ -39,7 +39,7 @@ export class {{classname}} extends runtime.BaseAPI {
|
|||||||
* {{&summary}}
|
* {{&summary}}
|
||||||
{{/summary}}
|
{{/summary}}
|
||||||
*/
|
*/
|
||||||
async {{nickname}}Raw({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{/allParams.0}}): Promise<runtime.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>> {
|
async {{nickname}}Raw({{#allParams.0}}requestParameters: {{operationIdCamelCase}}Request{{/allParams.0}}): Promise<runtime.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>> {
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
if (requestParameters.{{paramName}} === null || requestParameters.{{paramName}} === undefined) {
|
if (requestParameters.{{paramName}} === null || requestParameters.{{paramName}} === undefined) {
|
||||||
@@ -249,7 +249,7 @@ export class {{classname}} extends runtime.BaseAPI {
|
|||||||
}
|
}
|
||||||
{{/useSingleRequestParameter}}
|
{{/useSingleRequestParameter}}
|
||||||
{{#useSingleRequestParameter}}
|
{{#useSingleRequestParameter}}
|
||||||
async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{/allParams.0}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
async {{nickname}}({{#allParams.0}}requestParameters: {{operationIdCamelCase}}Request{{/allParams.0}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
const response = await this.{{nickname}}Raw({{#allParams.0}}requestParameters{{/allParams.0}});
|
const response = await this.{{nickname}}Raw({{#allParams.0}}requestParameters{{/allParams.0}});
|
||||||
return await response.value();
|
return await response.value();
|
||||||
|
|||||||
@@ -804,42 +804,4 @@ public class InlineModelResolverTest {
|
|||||||
Schema nullableRequestBodySchema = ModelUtils.getReferencedSchema(openAPI, nullableRequestBodyReference);
|
Schema nullableRequestBodySchema = ModelUtils.getReferencedSchema(openAPI, nullableRequestBodyReference);
|
||||||
assertTrue(nullableRequestBodySchema.getNullable());
|
assertTrue(nullableRequestBodySchema.getNullable());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void callbacks() {
|
|
||||||
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml");
|
|
||||||
new InlineModelResolver().flatten(openAPI);
|
|
||||||
|
|
||||||
RequestBody callbackRequestBodyReference = openAPI
|
|
||||||
.getPaths()
|
|
||||||
.get("/callback")
|
|
||||||
.getPost()
|
|
||||||
.getCallbacks()
|
|
||||||
.get("webhook")
|
|
||||||
.get("{$request.body#/callbackUri}")
|
|
||||||
.getPost()
|
|
||||||
.getRequestBody();
|
|
||||||
assertNotNull(callbackRequestBodyReference.get$ref());
|
|
||||||
|
|
||||||
RequestBody resolvedCallbackRequestBody = openAPI
|
|
||||||
.getComponents()
|
|
||||||
.getRequestBodies()
|
|
||||||
.get(ModelUtils.getSimpleRef(callbackRequestBodyReference.get$ref()));
|
|
||||||
|
|
||||||
Schema callbackRequestSchemaReference = resolvedCallbackRequestBody
|
|
||||||
.getContent()
|
|
||||||
.get("application/json")
|
|
||||||
.getSchema();
|
|
||||||
assertNotNull(callbackRequestSchemaReference.get$ref());
|
|
||||||
|
|
||||||
Schema resolvedCallbackSchema = openAPI
|
|
||||||
.getComponents()
|
|
||||||
.getSchemas()
|
|
||||||
.get(ModelUtils.getSimpleRef(callbackRequestSchemaReference.get$ref()));
|
|
||||||
|
|
||||||
Map properties = resolvedCallbackSchema.getProperties();
|
|
||||||
assertTrue(properties.get("notificationId") instanceof StringSchema);
|
|
||||||
assertTrue(properties.get("action") instanceof StringSchema);
|
|
||||||
assertTrue(properties.get("data") instanceof StringSchema);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
import static org.testng.Assert.fail;
|
|
||||||
import static org.testng.Assert.assertTrue;
|
|
||||||
import static org.testng.Assert.assertFalse;
|
import static org.testng.Assert.assertFalse;
|
||||||
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
import com.github.javaparser.ParseProblemException;
|
|
||||||
import com.github.javaparser.StaticJavaParser;
|
|
||||||
import com.github.javaparser.ast.CompilationUnit;
|
|
||||||
import io.swagger.parser.OpenAPIParser;
|
import io.swagger.parser.OpenAPIParser;
|
||||||
import io.swagger.v3.oas.models.Components;
|
import io.swagger.v3.oas.models.Components;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
@@ -70,38 +66,19 @@ public class TestUtils {
|
|||||||
File file = new File(root, filename);
|
File file = new File(root, filename);
|
||||||
String absoluteFilename = file.getAbsolutePath().replace("\\", "/");
|
String absoluteFilename = file.getAbsolutePath().replace("\\", "/");
|
||||||
if (!generatedFiles.containsKey(absoluteFilename)) {
|
if (!generatedFiles.containsKey(absoluteFilename)) {
|
||||||
fail("Could not find '" + absoluteFilename + "' file in list:\n" +
|
Assert.fail("Could not find '" + absoluteFilename + "' file in list:\n" +
|
||||||
generatedFiles.keySet().stream().sorted().collect(Collectors.joining(",\n")));
|
generatedFiles.keySet().stream().sorted().collect(Collectors.joining(",\n")));
|
||||||
}
|
}
|
||||||
assertTrue(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was not found in the list of generated files");
|
assertTrue(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was not fould in the list of generated files");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ensureDoesNotContainsFile(Map<String, String> generatedFiles, File root, String filename) {
|
public static void ensureDoesNotContainsFile(Map<String, String> generatedFiles, File root, String filename) {
|
||||||
File file = new File(root, filename);
|
File file = new File(root, filename);
|
||||||
String absoluteFilename = file.getAbsolutePath().replace("\\", "/");
|
String absoluteFilename = file.getAbsolutePath().replace("\\", "/");
|
||||||
if (generatedFiles.containsKey(absoluteFilename)) {
|
if (generatedFiles.containsKey(absoluteFilename)) {
|
||||||
fail("File '" + absoluteFilename + "' exists in file in list:\n" +
|
Assert.fail("File '" + absoluteFilename + "' exists in file in list:\n" +
|
||||||
generatedFiles.keySet().stream().sorted().collect(Collectors.joining(",\n")));
|
generatedFiles.keySet().stream().sorted().collect(Collectors.joining(",\n")));
|
||||||
}
|
}
|
||||||
assertFalse(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was found in the list of generated files");
|
assertFalse(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was fould in the list of generated files");
|
||||||
}
|
|
||||||
|
|
||||||
public static void validateJavaSourceFiles(Map<String, String> fileMap) {
|
|
||||||
fileMap.forEach( (fileName, fileContents) -> {
|
|
||||||
if (fileName.endsWith(".java")) {
|
|
||||||
assertValidJavaSourceCode(fileContents, fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void assertValidJavaSourceCode(String javaSourceCode, String filename) {
|
|
||||||
try {
|
|
||||||
CompilationUnit compilation = StaticJavaParser.parse(javaSourceCode);
|
|
||||||
assertTrue(compilation.getTypes().size() > 0, "File: " + filename);
|
|
||||||
}
|
|
||||||
catch (ParseProblemException ex) {
|
|
||||||
fail("Java parse problem: " + filename, ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ public class GoClientOptionsTest extends AbstractOptionsTest {
|
|||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setWithXml(GoClientOptionsProvider.WITH_XML_VALUE);
|
clientCodegen.setWithXml(GoClientOptionsProvider.WITH_XML_VALUE);
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setWithXml(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE);
|
|
||||||
times = 1;
|
|
||||||
clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE));
|
clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE));
|
||||||
times = 1;
|
times = 1;
|
||||||
clientCodegen.setIsGoSubmodule(Boolean.valueOf(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE));
|
clientCodegen.setIsGoSubmodule(Boolean.valueOf(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE));
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.java;
|
package org.openapitools.codegen.java;
|
||||||
|
|
||||||
import static org.openapitools.codegen.TestUtils.*;
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
@@ -319,8 +318,6 @@ public class JavaClientCodegenTest {
|
|||||||
TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/StringUtil.java");
|
TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/StringUtil.java");
|
||||||
TestUtils.ensureContainsFile(generatedFiles, output, "src/test/java/xyz/abcdef/api/DefaultApiTest.java");
|
TestUtils.ensureContainsFile(generatedFiles, output, "src/test/java/xyz/abcdef/api/DefaultApiTest.java");
|
||||||
|
|
||||||
validateJavaSourceFiles(generatedFiles);
|
|
||||||
|
|
||||||
String defaultApiFilename = new File(output, "src/main/java/xyz/abcdef/api/DefaultApi.java").getAbsolutePath().replace("\\", "/");
|
String defaultApiFilename = new File(output, "src/main/java/xyz/abcdef/api/DefaultApi.java").getAbsolutePath().replace("\\", "/");
|
||||||
String defaultApiConent = generatedFiles.get(defaultApiFilename);
|
String defaultApiConent = generatedFiles.get(defaultApiFilename);
|
||||||
assertTrue(defaultApiConent.contains("public class DefaultApi"));
|
assertTrue(defaultApiConent.contains("public class DefaultApi"));
|
||||||
@@ -331,44 +328,6 @@ public class JavaClientCodegenTest {
|
|||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testJdkHttpClient() throws Exception {
|
|
||||||
Map<String, Object> properties = new HashMap<>();
|
|
||||||
properties.put(JavaClientCodegen.JAVA8_MODE, true);
|
|
||||||
properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api");
|
|
||||||
|
|
||||||
File output = Files.createTempDirectory("test").toFile();
|
|
||||||
output.deleteOnExit();
|
|
||||||
|
|
||||||
final CodegenConfigurator configurator = new CodegenConfigurator()
|
|
||||||
.setGeneratorName("java")
|
|
||||||
.setLibrary(JavaClientCodegen.NATIVE)
|
|
||||||
.setAdditionalProperties(properties)
|
|
||||||
.setInputSpec("src/test/resources/3_0/ping.yaml")
|
|
||||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
|
||||||
|
|
||||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
|
||||||
MockDefaultGenerator generator = new MockDefaultGenerator();
|
|
||||||
generator.opts(clientOptInput).generate();
|
|
||||||
|
|
||||||
Map<String, String> generatedFiles = generator.getFiles();
|
|
||||||
Assert.assertEquals(generatedFiles.size(), 23);
|
|
||||||
validateJavaSourceFiles(generatedFiles);
|
|
||||||
|
|
||||||
String defaultApiFilename = new File(output, "src/main/java/xyz/abcdef/api/DefaultApi.java").getAbsolutePath().replace("\\", "/");
|
|
||||||
String defaultApiContent = generatedFiles.get(defaultApiFilename);
|
|
||||||
assertTrue(defaultApiContent.contains("public class DefaultApi"));
|
|
||||||
assertTrue(defaultApiContent.contains("import java.net.http.HttpClient;"));
|
|
||||||
assertTrue(defaultApiContent.contains("import java.net.http.HttpRequest;"));
|
|
||||||
assertTrue(defaultApiContent.contains("import java.net.http.HttpResponse;"));
|
|
||||||
|
|
||||||
String apiClientFilename = new File(output, "src/main/java/xyz/abcdef/ApiClient.java").getAbsolutePath().replace("\\", "/");
|
|
||||||
String apiClientContent = generatedFiles.get(apiClientFilename);
|
|
||||||
assertTrue(apiClientContent.contains("public class ApiClient"));
|
|
||||||
assertTrue(apiClientContent.contains("import java.net.http.HttpClient;"));
|
|
||||||
assertTrue(apiClientContent.contains("import java.net.http.HttpRequest;"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testReferencedHeader() {
|
public void testReferencedHeader() {
|
||||||
final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue855.yaml");
|
final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue855.yaml");
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit-Test for {@link org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen}.
|
* Unit-Test for {@link org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen}.
|
||||||
*
|
*
|
||||||
@@ -206,7 +204,6 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
|
|||||||
generator.opts(clientOptInput).generate();
|
generator.opts(clientOptInput).generate();
|
||||||
|
|
||||||
Map<String, String> generatedFiles = generator.getFiles();
|
Map<String, String> generatedFiles = generator.getFiles();
|
||||||
validateJavaSourceFiles(generatedFiles);
|
|
||||||
TestUtils.ensureContainsFile(generatedFiles, output, "src/main/openapi/openapi.yaml");
|
TestUtils.ensureContainsFile(generatedFiles, output, "src/main/openapi/openapi.yaml");
|
||||||
|
|
||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
@@ -231,7 +228,6 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
|
|||||||
generator.opts(clientOptInput).generate();
|
generator.opts(clientOptInput).generate();
|
||||||
|
|
||||||
Map<String, String> generatedFiles = generator.getFiles();
|
Map<String, String> generatedFiles = generator.getFiles();
|
||||||
validateJavaSourceFiles(generatedFiles);
|
|
||||||
TestUtils.ensureDoesNotContainsFile(generatedFiles, output, "src/main/openapi/openapi.yaml");
|
TestUtils.ensureDoesNotContainsFile(generatedFiles, output, "src/main/openapi/openapi.yaml");
|
||||||
|
|
||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
@@ -256,7 +252,6 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
|
|||||||
generator.opts(clientOptInput).generate();
|
generator.opts(clientOptInput).generate();
|
||||||
|
|
||||||
Map<String, String> generatedFiles = generator.getFiles();
|
Map<String, String> generatedFiles = generator.getFiles();
|
||||||
validateJavaSourceFiles(generatedFiles);
|
|
||||||
TestUtils.ensureContainsFile(generatedFiles, output, "src/main/resources/META-INF/openapi.yaml");
|
TestUtils.ensureContainsFile(generatedFiles, output, "src/main/resources/META-INF/openapi.yaml");
|
||||||
|
|
||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
@@ -281,7 +276,6 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
|
|||||||
generator.opts(clientOptInput).generate();
|
generator.opts(clientOptInput).generate();
|
||||||
|
|
||||||
Map<String, String> generatedFiles = generator.getFiles();
|
Map<String, String> generatedFiles = generator.getFiles();
|
||||||
validateJavaSourceFiles(generatedFiles);
|
|
||||||
TestUtils.ensureContainsFile(generatedFiles, output, "openapi.yml");
|
TestUtils.ensureContainsFile(generatedFiles, output, "openapi.yml");
|
||||||
|
|
||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ public class GoClientOptionsProvider implements OptionsProvider {
|
|||||||
public static final String PACKAGE_NAME_VALUE = "Go";
|
public static final String PACKAGE_NAME_VALUE = "Go";
|
||||||
public static final boolean WITH_GO_CODEGEN_COMMENT_VALUE = true;
|
public static final boolean WITH_GO_CODEGEN_COMMENT_VALUE = true;
|
||||||
public static final boolean WITH_XML_VALUE = true;
|
public static final boolean WITH_XML_VALUE = true;
|
||||||
public static final boolean ENUM_CLASS_PREFIX_VALUE = true;
|
|
||||||
public static final Boolean PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = true;
|
public static final Boolean PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = true;
|
||||||
public static final boolean IS_GO_SUBMODULE_VALUE = true;
|
public static final boolean IS_GO_SUBMODULE_VALUE = true;
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ public class GoClientOptionsProvider implements OptionsProvider {
|
|||||||
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
|
||||||
.put(CodegenConstants.WITH_GO_CODEGEN_COMMENT, "true")
|
.put(CodegenConstants.WITH_GO_CODEGEN_COMMENT, "true")
|
||||||
.put(CodegenConstants.WITH_XML, "true")
|
.put(CodegenConstants.WITH_XML, "true")
|
||||||
.put(CodegenConstants.ENUM_CLASS_PREFIX, "true")
|
|
||||||
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true")
|
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true")
|
||||||
.put(CodegenConstants.IS_GO_SUBMODULE, "true")
|
.put(CodegenConstants.IS_GO_SUBMODULE, "true")
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
|||||||
.put(TypeScriptFetchClientCodegen.SNAPSHOT, Boolean.FALSE.toString())
|
.put(TypeScriptFetchClientCodegen.SNAPSHOT, Boolean.FALSE.toString())
|
||||||
.put(TypeScriptFetchClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString())
|
.put(TypeScriptFetchClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString())
|
||||||
.put(TypeScriptFetchClientCodegen.USE_SINGLE_REQUEST_PARAMETER, Boolean.FALSE.toString())
|
.put(TypeScriptFetchClientCodegen.USE_SINGLE_REQUEST_PARAMETER, Boolean.FALSE.toString())
|
||||||
.put(TypeScriptFetchClientCodegen.PREFIX_PARAMETER_INTERFACES, Boolean.FALSE.toString())
|
|
||||||
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
|
||||||
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
|
.put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -293,40 +293,6 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
/callback:
|
|
||||||
post:
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
callbackUri:
|
|
||||||
type: string
|
|
||||||
responses:
|
|
||||||
201:
|
|
||||||
headers:
|
|
||||||
Location:
|
|
||||||
description: Contains the URI of the newly created resource
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
callbacks:
|
|
||||||
webhook:
|
|
||||||
'{$request.body#/callbackUri}':
|
|
||||||
post:
|
|
||||||
operationId: webhookNotify
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
notificationId:
|
|
||||||
type: string
|
|
||||||
action:
|
|
||||||
type: string
|
|
||||||
data:
|
|
||||||
type: string
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
Users:
|
Users:
|
||||||
|
|||||||
28
pom.xml
28
pom.xml
@@ -10,7 +10,7 @@
|
|||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>openapi-generator-project</name>
|
<name>openapi-generator-project</name>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>4.1.1</version>
|
<version>4.1.1-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<url>https://github.com/openapitools/openapi-generator</url>
|
<url>https://github.com/openapitools/openapi-generator</url>
|
||||||
<scm>
|
<scm>
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.8.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
@@ -843,18 +843,6 @@
|
|||||||
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
|
||||||
<id>typescript-fetch-client-builds-prefix-parameter-interfaces</id>
|
|
||||||
<activation>
|
|
||||||
<property>
|
|
||||||
<name>env</name>
|
|
||||||
<value>java</value>
|
|
||||||
</property>
|
|
||||||
</activation>
|
|
||||||
<modules>
|
|
||||||
<module>samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces</module>
|
|
||||||
</modules>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>typescript-angularjs-client</id>
|
<id>typescript-angularjs-client</id>
|
||||||
<activation>
|
<activation>
|
||||||
@@ -1036,7 +1024,10 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<!-- clients -->
|
<!-- clients -->
|
||||||
<module>samples/client/petstore/c</module>
|
<module>samples/client/petstore/c</module>
|
||||||
<!-- <module>samples/client/petstore/cpp-qt5</module> -->
|
<module>samples/client/petstore/cpp-qt5</module>
|
||||||
|
<!--<module>samples/client/petstore/dart-jaguar/openapi</module>
|
||||||
|
<module>samples/client/petstore/dart-jaguar/flutter_petstore/openapi</module>-->
|
||||||
|
<!--<module>samples/client/petstore/dart2/petstore</module>-->
|
||||||
<module>samples/client/petstore/elm-0.18</module>
|
<module>samples/client/petstore/elm-0.18</module>
|
||||||
<module>samples/client/petstore/rust</module>
|
<module>samples/client/petstore/rust</module>
|
||||||
<module>samples/client/petstore/rust-reqwest</module>
|
<module>samples/client/petstore/rust-reqwest</module>
|
||||||
@@ -1059,8 +1050,7 @@
|
|||||||
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
||||||
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
||||||
<module>samples/client/petstore/typescript-fetch/tests/default</module>
|
<module>samples/client/petstore/typescript-fetch/tests/default</module>
|
||||||
<!-- comment out due to CI failure, e.g. https://travis-ci.org/OpenAPITools/openapi-generator/builds/574865730
|
<module>samples/client/petstore/typescript-axios/tests/default</module>
|
||||||
<module>samples/client/petstore/typescript-axios/tests/default</module>-->
|
|
||||||
<module>samples/client/petstore/typescript-node/npm</module>
|
<module>samples/client/petstore/typescript-node/npm</module>
|
||||||
<module>samples/client/petstore/typescript-rxjs/builds/with-npm-version</module>
|
<module>samples/client/petstore/typescript-rxjs/builds/with-npm-version</module>
|
||||||
<!-- comment out due to github rate limit error
|
<!-- comment out due to github rate limit error
|
||||||
@@ -1395,8 +1385,8 @@
|
|||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<swagger-parser-groupid>org.openapitools.swagger.parser</swagger-parser-groupid>
|
<swagger-parser-groupid>org.openapitools.swagger.parser</swagger-parser-groupid>
|
||||||
<swagger-core-version>2.0.9</swagger-core-version>
|
<swagger-parser-version>2.0.13-OpenAPITools.org-2</swagger-parser-version>
|
||||||
<swagger-parser-version>2.0.14-OpenAPITools.org-1</swagger-parser-version>
|
<swagger-core-version>2.0.7</swagger-core-version>
|
||||||
<scala-version>2.11.1</scala-version>
|
<scala-version>2.11.1</scala-version>
|
||||||
<felix-version>3.3.1</felix-version>
|
<felix-version>3.3.1</felix-version>
|
||||||
<commons-io-version>2.4</commons-io-version>
|
<commons-io-version>2.4</commons-io-version>
|
||||||
|
|||||||
@@ -371,8 +371,6 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -419,8 +417,6 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -469,8 +465,6 @@ PetApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -519,8 +513,6 @@ PetApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -573,8 +565,6 @@ PetApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -621,8 +611,6 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -672,8 +660,6 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -729,8 +715,6 @@ PetApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
|
|||||||
@@ -210,8 +210,6 @@ StoreApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -256,8 +254,6 @@ StoreApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -306,8 +302,6 @@ StoreApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -358,8 +352,6 @@ StoreApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
|
|||||||
@@ -329,8 +329,6 @@ UserApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -376,8 +374,6 @@ UserApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -423,8 +419,6 @@ UserApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -467,8 +461,6 @@ UserApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -517,8 +509,6 @@ UserApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -571,8 +561,6 @@ UserApi <- R6::R6Class(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
ApiResponse$new(deserializedRespObj, resp)
|
ApiResponse$new(deserializedRespObj, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -607,8 +595,6 @@ UserApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
@@ -661,8 +647,6 @@ UserApi <- R6::R6Class(
|
|||||||
|
|
||||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||||
ApiResponse$new(NULL, resp)
|
ApiResponse$new(NULL, resp)
|
||||||
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
|
|
||||||
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
|
|
||||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||||
ApiResponse$new("API client error", resp)
|
ApiResponse$new("API client error", resp)
|
||||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||||
|
|||||||
@@ -51,10 +51,7 @@ void (empty response body)
|
|||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **405** | Invalid input | - |
|
|
||||||
|
|
||||||
# **DeletePet**
|
# **DeletePet**
|
||||||
> DeletePet(pet.id, api.key=var.api.key)
|
> DeletePet(pet.id, api.key=var.api.key)
|
||||||
@@ -95,10 +92,7 @@ void (empty response body)
|
|||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **400** | Invalid pet value | - |
|
|
||||||
|
|
||||||
# **FindPetsByStatus**
|
# **FindPetsByStatus**
|
||||||
> array[Pet] FindPetsByStatus(status)
|
> array[Pet] FindPetsByStatus(status)
|
||||||
@@ -140,11 +134,7 @@ Name | Type | Description | Notes
|
|||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **200** | successful operation | - |
|
|
||||||
| **400** | Invalid status value | - |
|
|
||||||
|
|
||||||
# **FindPetsByTags**
|
# **FindPetsByTags**
|
||||||
> array[Pet] FindPetsByTags(tags)
|
> array[Pet] FindPetsByTags(tags)
|
||||||
@@ -186,11 +176,7 @@ Name | Type | Description | Notes
|
|||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **200** | successful operation | - |
|
|
||||||
| **400** | Invalid tag value | - |
|
|
||||||
|
|
||||||
# **GetPetById**
|
# **GetPetById**
|
||||||
> Pet GetPetById(pet.id)
|
> Pet GetPetById(pet.id)
|
||||||
@@ -232,12 +218,7 @@ Name | Type | Description | Notes
|
|||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **200** | successful operation | - |
|
|
||||||
| **400** | Invalid ID supplied | - |
|
|
||||||
| **404** | Pet not found | - |
|
|
||||||
|
|
||||||
# **UpdatePet**
|
# **UpdatePet**
|
||||||
> UpdatePet(body)
|
> UpdatePet(body)
|
||||||
@@ -276,12 +257,7 @@ void (empty response body)
|
|||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **400** | Invalid ID supplied | - |
|
|
||||||
| **404** | Pet not found | - |
|
|
||||||
| **405** | Validation exception | - |
|
|
||||||
|
|
||||||
# **UpdatePetWithForm**
|
# **UpdatePetWithForm**
|
||||||
> UpdatePetWithForm(pet.id, name=var.name, status=var.status)
|
> UpdatePetWithForm(pet.id, name=var.name, status=var.status)
|
||||||
@@ -324,10 +300,7 @@ void (empty response body)
|
|||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **405** | Invalid input | - |
|
|
||||||
|
|
||||||
# **UploadFile**
|
# **UploadFile**
|
||||||
> ModelApiResponse UploadFile(pet.id, additional.metadata=var.additional.metadata, file=var.file)
|
> ModelApiResponse UploadFile(pet.id, additional.metadata=var.additional.metadata, file=var.file)
|
||||||
@@ -371,8 +344,5 @@ Name | Type | Description | Notes
|
|||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
| **200** | successful operation | - |
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user