forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/4.3.x' into 5.0.x
This commit is contained in:
commit
466a67c9bc
@ -62,7 +62,7 @@ before_install:
|
||||
- gem install bundler
|
||||
- npm install -g typescript
|
||||
- npm install -g npm
|
||||
- npm install -g elm@0.18.0-exp5
|
||||
#- npm install -g elm@0.18.0-exp5
|
||||
- npm config set registry http://registry.npmjs.org/
|
||||
# set python 3.6.3 as default
|
||||
- source ~/virtualenv/python3.6/bin/activate
|
||||
|
@ -61,7 +61,7 @@ Code change should conform to the programming style guide of the respective lang
|
||||
- Go: https://github.com/golang/go/wiki/CodeReviewComments
|
||||
- ObjC: https://github.com/NYTimes/objective-c-style-guide
|
||||
- Perl: http://perldoc.perl.org/perlstyle.html
|
||||
- PHP: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
|
||||
- PHP: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md
|
||||
- PowerShell: https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx
|
||||
- Python: https://www.python.org/dev/peps/pep-0008/
|
||||
- R: https://google.github.io/styleguide/Rguide.xml
|
||||
|
@ -27,6 +27,7 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
|
||||
|
||||
# This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh.
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
|
41
README.md
41
README.md
@ -2,23 +2,26 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.2-SNAPSHOT`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.3-SNAPSHOT`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
[`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
[`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
@ -53,6 +56,8 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
|
||||
[](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/docspring.png" width="128" height="128">](https://docspring.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names and Linode for sponsoring the VPS
|
||||
|
||||
@ -65,7 +70,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
|
||||
| | Languages/Frameworks |
|
||||
|-|-|
|
||||
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **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**, **Nim**, **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, .NET Standard 1.3 - 2.0, .NET Core 2.0), **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, MicroProfile Rest Client), **Kotlin**, **Lua**, **Nim**, **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), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **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**, **Asciidoc**
|
||||
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
||||
@ -109,8 +114,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)
|
||||
4.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.3.0-SNAPSHOT/)| 29.02.2020 | Minor release (breaking changes with fallbacks)
|
||||
4.2.2-SNAPSHOT (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.2-SNAPSHOT/)| 02.12.2019 | Patch release
|
||||
[4.2.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.1) (latest stable release) | 15.11.2019 | Patch release
|
||||
4.2.3-SNAPSHOT (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.3-SNAPSHOT/)| 31.01.2020 | Patch release
|
||||
[4.2.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.2) (latest stable release) | 02.12.2019 | Patch release
|
||||
|
||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||
|
||||
@ -166,16 +171,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
||||
<!-- 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):
|
||||
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar`
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar -O openapi-generator-cli.jar
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
```
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@ -417,7 +422,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`)
|
||||
|
||||
<!-- 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.2.1/openapi-generator-cli-4.2.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.2.2/openapi-generator-cli-4.2.2.jar)
|
||||
<!-- /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`
|
||||
@ -577,13 +582,15 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Camptocamp](https://www.camptocamp.com/en)
|
||||
- [codecentric AG](https://www.codecentric.de/)
|
||||
- [Commencis](https://www.commencis.com/)
|
||||
- [Crossover Health](https://crossoverhealth.com/)
|
||||
- [Cupix](https://www.cupix.com/)
|
||||
- [DB Systel](https://www.dbsystel.de)
|
||||
- [DocSpring](https://docspring.com/)
|
||||
- [dwango](https://dwango.co.jp/)
|
||||
- [Edge Impulse](https://www.edgeimpulse.com/)
|
||||
- [Element AI](https://www.elementai.com/)
|
||||
- [Embotics](https://www.embotics.com/)
|
||||
- [Fenergo](https://www.fenergo.com/)
|
||||
- [FormAPI](https://formapi.io/)
|
||||
- [FreshCells](https://www.freshcells.de/)
|
||||
- [Fuse](https://www.fuse.no/)
|
||||
- [Gantner](https://www.gantner.com)
|
||||
@ -596,6 +603,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [JustStar](https://www.juststarinfo.com)
|
||||
- [Klarna](https://www.klarna.com/)
|
||||
- [Kronsoft Development](https://www.kronsoft.ro/home/)
|
||||
- [Linode](https://www.linode.com/)
|
||||
- [Médiavision](https://www.mediavision.fr/)
|
||||
- [Metaswitch](https://www.metaswitch.com/)
|
||||
- [Myworkout](https://myworkout.com)
|
||||
@ -611,6 +619,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [RedHat](https://www.redhat.com)
|
||||
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
|
||||
- [REST United](https://restunited.com)
|
||||
- [Sony Interactive Entertainment](https://www.sie.com/en/index.html)
|
||||
- [Stingray](http://www.stingray.com)
|
||||
- [Suva](https://www.suva.ch/)
|
||||
- [Telstra](https://dev.telstra.com)
|
||||
@ -621,6 +630,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [WSO2](https://wso2.com/)
|
||||
- [Vouchery.io](https://vouchery.io)
|
||||
- [Xero](https://www.xero.com/)
|
||||
- [Yahoo Japan](https://www.yahoo.co.jp/)
|
||||
- [Yelp](https://www.yelp.com/)
|
||||
- [Zalando](https://www.zalando.com)
|
||||
|
||||
@ -695,6 +705,14 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2019-11-08 - [JHipster beyond CRUD - API-First for Enterprises by Enrico Costanzi](https://www.youtube.com/watch?v=m28JFovKQ20) by [Enrico Costanzi](https://twitter.com/enricocostanzi) at [JHipster Conf 2019 in Paris](https://jhipster-conf.github.io/)
|
||||
- 2019-11-11 - [TypeScript REST APIクライアント](https://qiita.com/unhurried/items/7b74f7d3c43545dadd2b) by [@unhurried](https://qiita.com/unhurried)
|
||||
- 2019-11-11 - [One Spec to Rule them all - OpenAPI in Action](https://www.youtube.com/watch?v=MMay_nht8ec) by [Andreas Litt](https://github.com/littldr) at [code.talks 2019](https://www.codetalks.com/)
|
||||
- 2019-11-17 - [OpenAPI Generator YouTube playlist](https://www.youtube.com/playlist?list=PLtJyHVMdzfF6fBkOUV5VDVErP23CGgHIy) at [YouTube](https://www.youtube.com)
|
||||
- 2019-11-20 - [Introduction to OpenAPI](https://noti.st/lornajane/HvDH7U/introduction-to-openapi) by [Lorna Mitchell](https://twitter.com/lornajane) at [GOTO Copenhagen 2019](https://gotocph.com/2019/)
|
||||
- 2019-11-20 - [How to Generate Angular code from OpenAPI specifications](https://dotnetthoughts.net/how-to-generate-angular-code-from-openapi-specifications/) by Anuraj
|
||||
- 2019-11-23 - [Swagger ではない OpenAPI Specification 3.0 による API サーバー開発](https://www.slideshare.net/techblogyahoo/swagger-openapi-specification-30-api) by [Tetsuya Morimoto](https://github.com/t2y) at [JJUG CCC 2019 Fall](https://ccc2019fall.java-users.jp/)
|
||||
- 2019-11-24 - [Accelerate Flutter development with OpenAPI and Dart code generation](https://medium.com/@irinasouthwell_220/accelerate-flutter-development-with-openapi-and-dart-code-generation-1f16f8329a6a) by [Irina Southwell](https://medium.com/@irinasouthwell_220)
|
||||
- 2019-11-25 - [openapi-generatorで手軽にスタブサーバとクライアントの生成](https://qiita.com/pochopocho13/items/8db662e1934fb2b408b8) by [@pochopocho13](https://twitter.com/pochopocho13)
|
||||
- 2019-11-26 - [CordaCon 2019 Highlights: Braid Server and OpenAPI Generator for Corda Client API’s](https://blog.b9lab.com/cordacon-2019-highlights-braid-server-and-openapi-generator-for-corda-flows-api-s-d24179ccb27c) by [Adel Rustum](https://blog.b9lab.com/@adelrestom) at [B9lab](https://blog.b9lab.com/)
|
||||
- 2020-12-04 - [Angular+NestJS+OpenAPI(Swagger)でマイクロサービスを視野に入れた環境を考える](https://qiita.com/teracy55/items/0327c7a170ec772970c6) by [てらしー](https://twitter.com/teracy55)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@ -784,6 +802,7 @@ Here is a list of template creators:
|
||||
* TypeScript (Node): @mhardorf
|
||||
* TypeScript (Rxjs): @denyo
|
||||
* TypeScript (Inversify): @gualtierim
|
||||
* TypeSCript (redux-query): @petejohansonxo
|
||||
* Server Stubs
|
||||
* Ada: @stcarrez
|
||||
* C# ASP.NET 5: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||
@ -902,8 +921,8 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
|
||||
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) |
|
||||
| Scala | @clasnake (2017/07), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @shijinkui (2018/01), @ramzimaalej (2018/03) |
|
||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @d-date (2018/03) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) |
|
||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) |
|
||||
|
||||
:heart: = Link to support the contributor directly
|
||||
|
||||
|
6
bin/ci/php-slim4-server-petstore.json
Normal file
6
bin/ci/php-slim4-server-petstore.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"generatorName": "php-slim4",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore.yaml",
|
||||
"outputDir": "samples/server/petstore/php-slim4",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/php-slim4-server"
|
||||
}
|
@ -7,6 +7,7 @@
|
||||
./bin/java-petstore-jersey1.sh
|
||||
./bin/java-petstore-jersey2-java6.sh
|
||||
./bin/java-petstore-jersey2.sh
|
||||
./bin/java-petstore-microprofile.sh
|
||||
./bin/java-petstore-native.sh
|
||||
./bin/java-petstore-okhttp-gson-parcelable.sh
|
||||
./bin/java-petstore-okhttp-gson.sh
|
||||
|
@ -27,7 +27,7 @@ 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/Java/libraries/feign -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-9x.json -o samples/client/petstore/java/feign --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/feign -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-9x.json -o samples/client/petstore/java/feign --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,additionalModelTypeAnnotations=@javax.annotation.concurrent.Immutable $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/feign/src/main"
|
||||
rm -rf samples/client/petstore/java/feign/src/main
|
||||
|
36
bin/java-petstore-microprofile.sh
Executable file
36
bin/java-petstore-microprofile.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/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} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id "microprofile-rest-client" -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java --library microprofile -o samples/client/petstore/java/microprofile-rest-client $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/microprofile-rest-client/src/main"
|
||||
rm -rf samples/client/petstore/java/microprofile-rest-client/src/main
|
||||
find samples/client/petstore/java/microprofile-rest-client -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
@ -2,3 +2,4 @@
|
||||
|
||||
./bin/kotlin-springboot-petstore-server.sh
|
||||
./bin/kotlin-springboot-petstore-server-reactive.sh
|
||||
./bin/kotlin-springboot-petstore-server-model-mutable.sh
|
||||
|
35
bin/kotlin-springboot-petstore-server-model-mutable.sh
Executable file
35
bin/kotlin-springboot-petstore-server-model-mutable.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/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
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot-modelMutable --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,modelMutable=true"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot"
|
||||
rm -rf samples/server/petstore/kotlin-springboot-modelMutable
|
||||
|
||||
echo "Generating Kotling Spring Boot server..."
|
||||
java $JAVA_OPTS -jar $executable $ags
|
@ -26,6 +26,6 @@ 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 kotlin-vertx -o samples/server/petstore/kotlin/vertx"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin-vertx -o samples/server/petstore/kotlin/vertx --additional-properties=modelMutable=false"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
35
bin/openapi3/kotlin-client-petstore-nullable-required.sh
Normal file
35
bin/openapi3/kotlin-client-petstore-nullable-required.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/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
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o samples/openapi3/client/petstore/kotlin-nullable-required $@"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-nullable-required"
|
||||
rm -rf samples/openapi3/client/petstore/kotlin-nullable-required
|
||||
|
||||
echo "Generating Kotling client..."
|
||||
java $JAVA_OPTS -jar $executable $ags
|
10
bin/openapi3/windows/kotlin-client-nullable-required.bat
Normal file
10
bin/openapi3/windows/kotlin-client-nullable-required.bat
Normal file
@ -0,0 +1,10 @@
|
||||
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\3_0\petstore-with-nullable-required.yaml -g kotlin --artifact-id "kotlin-petstore-nullable-required" --additional-properties allowRequiredAsNullable=true -o samples\openapi3\client\petstore\kotlin-nullable-required
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
@ -2,6 +2,8 @@
|
||||
|
||||
./bin/swift4-petstore.sh
|
||||
./bin/swift4-petstore-promisekit.sh
|
||||
./bin/swift4-petstore-result.sh
|
||||
./bin/swift4-petstore-rxswift.sh
|
||||
./bin/swift4-petstore-objcCompatible.sh
|
||||
./bin/swift4-petstore-unwrapRequired.sh
|
||||
./bin/swift4-petstore-nonPublicApi.sh
|
||||
|
7
bin/swift4-petstore-nonPublicApi.json
Normal file
7
bin/swift4-petstore-nonPublicApi.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"podSummary": "PetstoreClient",
|
||||
"podHomepage": "https://github.com/openapitools/openapi-generator",
|
||||
"podAuthors": "",
|
||||
"projectName": "PetstoreClient",
|
||||
"nonPublicApi": true
|
||||
}
|
42
bin/swift4-petstore-nonPublicApi.sh
Executable file
42
bin/swift4-petstore-nonPublicApi.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/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 -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-nonPublicApi.json -o samples/client/petstore/swift4/nonPublicApi --generate-alias-as-model $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if type "xcodegen" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/nonPublicApi
|
||||
xcodegen generate
|
||||
fi
|
||||
|
||||
if type "swiftlint" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/nonPublicApi
|
||||
swiftlint autocorrect
|
||||
fi
|
7
bin/swift4-petstore-result.json
Normal file
7
bin/swift4-petstore-result.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"podSummary": "PetstoreClient",
|
||||
"podHomepage": "https://github.com/openapitools/openapi-generator",
|
||||
"podAuthors": "",
|
||||
"projectName": "PetstoreClient",
|
||||
"responseAs": "Result"
|
||||
}
|
42
bin/swift4-petstore-result.sh
Executable file
42
bin/swift4-petstore-result.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/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 -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-result.json -o samples/client/petstore/swift4/resultLibrary --generate-alias-as-model $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if type "xcodegen" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/resultLibrary
|
||||
xcodegen generate
|
||||
fi
|
||||
|
||||
if type "swiftlint" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/resultLibrary
|
||||
swiftlint autocorrect
|
||||
fi
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\feign -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-feign-9x.json -o samples\client\petstore\java\feign --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is
|
||||
set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\feign -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-feign-9x.json -o samples\client\petstore\java\feign --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,additionalModelTypeAnnotations=@javax.annotation.concurrent.Immutable
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
10
bin/windows/java-petstore-microprofile.bat
Executable file
10
bin/windows/java-petstore-microprofile.bat
Executable file
@ -0,0 +1,10 @@
|
||||
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 -DloggerPath=conf/log4j.properties
|
||||
set ags=generate --artifact-id "microprofile-rest-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g java --library microprofile -o samples\client\petstore\java\microprofile-rest-client
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
@ -7,6 +7,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true
|
||||
set 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%
|
||||
|
@ -65,7 +65,7 @@ Code change should conform to the programming style guide of the respective lang
|
||||
- Go: https://github.com/golang/go/wiki/CodeReviewComments
|
||||
- ObjC: https://github.com/NYTimes/objective-c-style-guide
|
||||
- Perl: http://perldoc.perl.org/perlstyle.html
|
||||
- PHP: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
|
||||
- PHP: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md
|
||||
- PowerShell: https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx
|
||||
- Python: https://www.python.org/dev/peps/pep-0008/
|
||||
- R: https://google.github.io/styleguide/Rguide.xml
|
||||
|
@ -34,6 +34,7 @@ sidebar_label: groovy
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-inflector
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-msf4j
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-pkmst
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-play-framework
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-undertow-server
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-vertx-web
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java-vertx
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: java
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
@ -53,5 +54,5 @@ sidebar_label: java
|
||||
|feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false|
|
||||
|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
|
||||
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false|
|
||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.9.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dl>|okhttp-gson|
|
||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.9.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x</dd><dl>|okhttp-gson|
|
||||
|serializationLibrary|Serialization library, default depends from the library|<dl><dt>**jackson**</dt><dd>Use Jackson as serialization library</dd><dt>**gson**</dt><dd>Use Gson as serialization library</dd><dl>|null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-cxf-cdi
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-cxf-client
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-cxf-extended
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-cxf
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-jersey
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-resteasy-eap
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-resteasy
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: jaxrs-spec
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -15,6 +15,7 @@ sidebar_label: kotlin-server
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dl>|ktor|
|
||||
|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true|
|
||||
|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|
|
||||
|
@ -15,6 +15,7 @@ sidebar_label: kotlin-spring
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|title|server title name or client service name| |OpenAPI Kotlin Spring|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|serverPort|configuration the port in which the sever is to run on| |8080|
|
||||
|
@ -15,3 +15,4 @@ sidebar_label: kotlin-vertx
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|
@ -15,6 +15,7 @@ sidebar_label: kotlin
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only)</dd><dt>**threetenbp**</dt><dd>Threetenbp (jvm only)</dd><dl>|java8|
|
||||
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd><dl>|array|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</dd><dl>|jvm-okhttp4|
|
||||
|
@ -36,6 +36,7 @@ sidebar_label: spring
|
||||
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|
@ -10,7 +10,8 @@ sidebar_label: swift4
|
||||
|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|
|
||||
|projectName|Project name in Xcode| |null|
|
||||
|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift are available.| |null|
|
||||
|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result are available.| |null|
|
||||
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null|
|
||||
|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null|
|
||||
|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|
||||
|podSource|Source information used for Podspec| |null|
|
||||
|
@ -22,11 +22,14 @@ import io.airlift.airline.Option;
|
||||
|
||||
import io.swagger.parser.OpenAPIParser;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.media.ComposedSchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.parser.core.models.SwaggerParseResult;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Command(name = "validate", description = "Validate specification")
|
||||
@ -58,6 +61,21 @@ public class Validate implements Runnable {
|
||||
if (unusedModels != null) {
|
||||
unusedModels.forEach(name -> warnings.add("Unused model: " + name));
|
||||
}
|
||||
|
||||
// check for loosely defined oneOf extension requirements.
|
||||
// This is a recommendation because the 3.0.x spec is not clear enough on usage of oneOf.
|
||||
// see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'.
|
||||
Map<String, Schema> schemas = ModelUtils.getSchemas(specification);
|
||||
schemas.forEach((key, schema) -> {
|
||||
if (schema instanceof ComposedSchema) {
|
||||
final ComposedSchema composed = (ComposedSchema) schema;
|
||||
if (composed.getOneOf() != null && composed.getOneOf().size() > 0) {
|
||||
if (composed.getProperties() != null && composed.getProperties().size() >= 1 && composed.getProperties().get("discriminator") == null) {
|
||||
warnings.add("Schema (oneOf) should not contain properties: " + key);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate
|
||||
[source,group]
|
||||
----
|
||||
plugins {
|
||||
id "org.openapi.generator" version "4.2.2-SNAPSHOT"
|
||||
id "org.openapi.generator" version "4.2.3-SNAPSHOT"
|
||||
}
|
||||
----
|
||||
|
||||
|
@ -18,5 +18,5 @@ gradle generateGoWithInvalidSpec
|
||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||
|
||||
```bash
|
||||
gradle -PopenApiGeneratorVersion=4.2.2-SNAPSHOT openApiValidate
|
||||
gradle -PopenApiGeneratorVersion=4.2.3-SNAPSHOT openApiValidate
|
||||
```
|
||||
|
@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2-SNAPSHOT</version>
|
||||
<version>4.2.3-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2-SNAPSHOT</version>
|
||||
<version>4.2.3-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2-SNAPSHOT</version>
|
||||
<version>4.2.3-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2-SNAPSHOT</version>
|
||||
<version>4.2.3-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -200,7 +200,7 @@
|
||||
<generex-version>1.0.2</generex-version>
|
||||
<jackson-version>2.9.10</jackson-version>
|
||||
<jackson-threetenbp-version>2.9.10</jackson-threetenbp-version>
|
||||
<kotlin-version>1.3.41</kotlin-version>
|
||||
<kotlin-version>1.3.60</kotlin-version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -301,7 +301,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.2.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -347,6 +347,11 @@
|
||||
<version>${kotlin-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>5.5.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
@ -30,12 +30,12 @@ public class ClientOptInput {
|
||||
private List<AuthorizationValue> auths;
|
||||
|
||||
public ClientOptInput openAPI(OpenAPI openAPI) {
|
||||
this.openAPI = openAPI;
|
||||
this.setOpenAPI(openAPI);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ClientOptInput config(CodegenConfig codegenConfig) {
|
||||
this.config = codegenConfig;
|
||||
this.setConfig(codegenConfig);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -72,6 +72,10 @@ public class ClientOptInput {
|
||||
@Deprecated
|
||||
public void setConfig(CodegenConfig config) {
|
||||
this.config = config;
|
||||
// TODO: ClientOptInputs needs to be retired
|
||||
if (this.openAPI != null) {
|
||||
this.config.setOpenAPI(this.openAPI);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ -86,5 +90,9 @@ public class ClientOptInput {
|
||||
@Deprecated
|
||||
public void setOpenAPI(OpenAPI openAPI) {
|
||||
this.openAPI = openAPI;
|
||||
// TODO: ClientOptInputs needs to be retired
|
||||
if (this.config != null) {
|
||||
this.config.setOpenAPI(this.openAPI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ public class CodegenCallback {
|
||||
public int hashCode() {
|
||||
return Objects.hash(expression, hasMore, requests, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@ -64,10 +65,12 @@ public class CodegenCallback {
|
||||
return Objects.equals(that.name, name) && Objects.equals(that.hasMore, hasMore) &&
|
||||
Objects.equals(that.urls, urls) && Objects.equals(that.vendorExtensions, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, hasMore, urls, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@ -77,4 +80,6 @@ public class CodegenCallback {
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -91,21 +91,25 @@ public class CodegenDiscriminator {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenDiscriminator that = (CodegenDiscriminator) o;
|
||||
return Objects.equals(propertyName, that.propertyName) &&
|
||||
Objects.equals(propertyBaseName, that.propertyBaseName) &&
|
||||
Objects.equals(mapping, that.mapping) &&
|
||||
Objects.equals(mappedModels, that.mappedModels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(propertyName, mapping, mappedModels);
|
||||
|
||||
return Objects.hash(propertyName, propertyBaseName, mapping, mappedModels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("propertyName", propertyName)
|
||||
.append("mapping", mapping)
|
||||
.append("mappedModels", mappedModels)
|
||||
.toString();
|
||||
final StringBuffer sb = new StringBuffer("CodegenDiscriminator{");
|
||||
sb.append("propertyName='").append(propertyName).append('\'');
|
||||
sb.append(", propertyBaseName='").append(propertyBaseName).append('\'');
|
||||
sb.append(", mapping=").append(mapping);
|
||||
sb.append(", mappedModels=").append(mappedModels);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -70,157 +70,6 @@ public class CodegenModel {
|
||||
//The type of the value from additional properties. Used in map like objects.
|
||||
public String additionalPropertiesType;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("parent", parent)
|
||||
.append("parentSchema", parentSchema)
|
||||
.append("interfaces", interfaces)
|
||||
.append("parentModel", parentModel)
|
||||
.append("interfaceModels", interfaceModels)
|
||||
.append("children", children)
|
||||
.append("name", name)
|
||||
.append("classname", classname)
|
||||
.append("title", title)
|
||||
.append("description", description)
|
||||
.append("classVarName", classVarName)
|
||||
.append("modelJson", modelJson)
|
||||
.append("dataType", dataType)
|
||||
.append("xmlPrefix", xmlPrefix)
|
||||
.append("xmlNamespace", xmlNamespace)
|
||||
.append("xmlName", xmlName)
|
||||
.append("classFilename", classFilename)
|
||||
.append("unescapedDescription", unescapedDescription)
|
||||
.append("discriminator", discriminator)
|
||||
.append("defaultValue", defaultValue)
|
||||
.append("arrayModelType", arrayModelType)
|
||||
.append("isAlias", isAlias)
|
||||
.append("isString", isString)
|
||||
.append("isNumeric", isNumeric)
|
||||
.append("isInteger", isInteger)
|
||||
.append("isLong", isLong)
|
||||
.append("isNumber", isNumber)
|
||||
.append("isFloat", isFloat)
|
||||
.append("isDouble", isDouble)
|
||||
.append("vars", vars)
|
||||
.append("requiredVars", requiredVars)
|
||||
.append("optionalVars", optionalVars)
|
||||
.append("readOnlyVars", readOnlyVars)
|
||||
.append("readWriteVars", readWriteVars)
|
||||
.append("allVars", allVars)
|
||||
.append("parentVars", parentVars)
|
||||
.append("allowableValues", allowableValues)
|
||||
.append("mandatory", mandatory)
|
||||
.append("allMandatory", allMandatory)
|
||||
.append("imports", imports)
|
||||
.append("hasVars", hasVars)
|
||||
.append("emptyVars", emptyVars)
|
||||
.append("hasMoreModels", hasMoreModels)
|
||||
.append("hasEnums", hasEnums)
|
||||
.append("isEnum", isEnum)
|
||||
.append("isNullable", isNullable)
|
||||
.append("hasRequired", hasRequired)
|
||||
.append("hasOptional", hasOptional)
|
||||
.append("isArrayModel", isArrayModel)
|
||||
.append("hasChildren", hasChildren)
|
||||
.append("isMapModel", isMapModel)
|
||||
.append("hasOnlyReadOnly", hasOnlyReadOnly)
|
||||
.append("externalDocumentation", externalDocumentation)
|
||||
.append("vendorExtensions", vendorExtensions)
|
||||
.append("additionalPropertiesType", additionalPropertiesType)
|
||||
.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CodegenModel that = (CodegenModel) o;
|
||||
|
||||
return Objects.equals(parent, that.parent) &&
|
||||
Objects.equals(parentSchema, that.parentSchema) &&
|
||||
Objects.equals(interfaces, that.interfaces) &&
|
||||
Objects.equals(allParents, that.allParents) &&
|
||||
Objects.equals(parentModel, that.parentModel) &&
|
||||
Objects.equals(interfaceModels, that.interfaceModels) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(classname, that.classname) &&
|
||||
Objects.equals(title, that.title) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(classVarName, that.classVarName) &&
|
||||
Objects.equals(modelJson, that.modelJson) &&
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
Objects.equals(xmlPrefix, that.xmlPrefix) &&
|
||||
Objects.equals(xmlNamespace, that.xmlNamespace) &&
|
||||
Objects.equals(xmlName, that.xmlName) &&
|
||||
Objects.equals(classFilename, that.classFilename) &&
|
||||
Objects.equals(unescapedDescription, that.unescapedDescription) &&
|
||||
Objects.equals(discriminator, that.discriminator) &&
|
||||
Objects.equals(defaultValue, that.defaultValue) &&
|
||||
Objects.equals(vars, that.vars) &&
|
||||
Objects.equals(requiredVars, that.requiredVars) &&
|
||||
Objects.equals(optionalVars, that.optionalVars) &&
|
||||
Objects.equals(allVars, that.allVars) &&
|
||||
Objects.equals(allowableValues, that.allowableValues) &&
|
||||
Objects.equals(mandatory, that.mandatory) &&
|
||||
Objects.equals(allMandatory, that.allMandatory) &&
|
||||
Objects.equals(imports, that.imports) &&
|
||||
Objects.equals(hasVars, that.hasVars) &&
|
||||
Objects.equals(emptyVars, that.emptyVars) &&
|
||||
Objects.equals(hasMoreModels, that.hasMoreModels) &&
|
||||
Objects.equals(hasEnums, that.hasEnums) &&
|
||||
Objects.equals(isEnum, that.isEnum) &&
|
||||
Objects.equals(externalDocumentation, that.externalDocumentation) &&
|
||||
Objects.equals(hasOnlyReadOnly, that.hasOnlyReadOnly) &&
|
||||
Objects.equals(hasChildren, that.hasChildren) &&
|
||||
Objects.equals(parentVars, that.parentVars) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
parent,
|
||||
parentSchema,
|
||||
interfaces,
|
||||
allParents,
|
||||
parentModel,
|
||||
interfaceModels,
|
||||
name,
|
||||
classname,
|
||||
title,
|
||||
description,
|
||||
classVarName,
|
||||
modelJson,
|
||||
dataType,
|
||||
xmlPrefix,
|
||||
xmlNamespace,
|
||||
xmlName,
|
||||
classFilename,
|
||||
unescapedDescription,
|
||||
discriminator,
|
||||
defaultValue,
|
||||
vars,
|
||||
requiredVars,
|
||||
optionalVars,
|
||||
allVars,
|
||||
allowableValues,
|
||||
mandatory,
|
||||
allMandatory,
|
||||
imports,
|
||||
hasVars,
|
||||
emptyVars,
|
||||
hasMoreModels,
|
||||
hasEnums,
|
||||
isEnum,
|
||||
externalDocumentation,
|
||||
vendorExtensions,
|
||||
hasOnlyReadOnly,
|
||||
hasChildren,
|
||||
parentVars);
|
||||
}
|
||||
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
@ -601,4 +450,149 @@ public class CodegenModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenModel that = (CodegenModel) o;
|
||||
return isAlias == that.isAlias &&
|
||||
isString == that.isString &&
|
||||
isInteger == that.isInteger &&
|
||||
isLong == that.isLong &&
|
||||
isNumber == that.isNumber &&
|
||||
isNumeric == that.isNumeric &&
|
||||
isFloat == that.isFloat &&
|
||||
isDouble == that.isDouble &&
|
||||
hasVars == that.hasVars &&
|
||||
emptyVars == that.emptyVars &&
|
||||
hasMoreModels == that.hasMoreModels &&
|
||||
hasEnums == that.hasEnums &&
|
||||
isEnum == that.isEnum &&
|
||||
isNullable == that.isNullable &&
|
||||
hasRequired == that.hasRequired &&
|
||||
hasOptional == that.hasOptional &&
|
||||
isArrayModel == that.isArrayModel &&
|
||||
hasChildren == that.hasChildren &&
|
||||
isMapModel == that.isMapModel &&
|
||||
hasOnlyReadOnly == that.hasOnlyReadOnly &&
|
||||
Objects.equals(parent, that.parent) &&
|
||||
Objects.equals(parentSchema, that.parentSchema) &&
|
||||
Objects.equals(interfaces, that.interfaces) &&
|
||||
Objects.equals(allParents, that.allParents) &&
|
||||
Objects.equals(parentModel, that.parentModel) &&
|
||||
Objects.equals(interfaceModels, that.interfaceModels) &&
|
||||
Objects.equals(children, that.children) &&
|
||||
Objects.equals(anyOf, that.anyOf) &&
|
||||
Objects.equals(oneOf, that.oneOf) &&
|
||||
Objects.equals(allOf, that.allOf) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(classname, that.classname) &&
|
||||
Objects.equals(title, that.title) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(classVarName, that.classVarName) &&
|
||||
Objects.equals(modelJson, that.modelJson) &&
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
Objects.equals(xmlPrefix, that.xmlPrefix) &&
|
||||
Objects.equals(xmlNamespace, that.xmlNamespace) &&
|
||||
Objects.equals(xmlName, that.xmlName) &&
|
||||
Objects.equals(classFilename, that.classFilename) &&
|
||||
Objects.equals(unescapedDescription, that.unescapedDescription) &&
|
||||
Objects.equals(discriminator, that.discriminator) &&
|
||||
Objects.equals(defaultValue, that.defaultValue) &&
|
||||
Objects.equals(arrayModelType, that.arrayModelType) &&
|
||||
Objects.equals(vars, that.vars) &&
|
||||
Objects.equals(allVars, that.allVars) &&
|
||||
Objects.equals(requiredVars, that.requiredVars) &&
|
||||
Objects.equals(optionalVars, that.optionalVars) &&
|
||||
Objects.equals(readOnlyVars, that.readOnlyVars) &&
|
||||
Objects.equals(readWriteVars, that.readWriteVars) &&
|
||||
Objects.equals(parentVars, that.parentVars) &&
|
||||
Objects.equals(allowableValues, that.allowableValues) &&
|
||||
Objects.equals(mandatory, that.mandatory) &&
|
||||
Objects.equals(allMandatory, that.allMandatory) &&
|
||||
Objects.equals(imports, that.imports) &&
|
||||
Objects.equals(externalDocumentation, that.externalDocumentation) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(additionalPropertiesType, that.additionalPropertiesType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(parent, parentSchema, interfaces, allParents, parentModel, interfaceModels, children,
|
||||
anyOf, oneOf, allOf, name, classname, title, description, classVarName, modelJson, dataType,
|
||||
xmlPrefix, xmlNamespace, xmlName, classFilename, unescapedDescription, discriminator, defaultValue,
|
||||
arrayModelType, isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble,
|
||||
vars, allVars, requiredVars, optionalVars, readOnlyVars, readWriteVars, parentVars, allowableValues,
|
||||
mandatory, allMandatory, imports, hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, isNullable,
|
||||
hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel, hasOnlyReadOnly,
|
||||
externalDocumentation, vendorExtensions, additionalPropertiesType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenModel{");
|
||||
sb.append("parent='").append(parent).append('\'');
|
||||
sb.append(", parentSchema='").append(parentSchema).append('\'');
|
||||
sb.append(", interfaces=").append(interfaces);
|
||||
sb.append(", allParents=").append(allParents);
|
||||
sb.append(", parentModel=").append(parentModel);
|
||||
sb.append(", interfaceModels=").append(interfaceModels);
|
||||
sb.append(", children=").append(children);
|
||||
sb.append(", anyOf=").append(anyOf);
|
||||
sb.append(", oneOf=").append(oneOf);
|
||||
sb.append(", allOf=").append(allOf);
|
||||
sb.append(", name='").append(name).append('\'');
|
||||
sb.append(", classname='").append(classname).append('\'');
|
||||
sb.append(", title='").append(title).append('\'');
|
||||
sb.append(", description='").append(description).append('\'');
|
||||
sb.append(", classVarName='").append(classVarName).append('\'');
|
||||
sb.append(", modelJson='").append(modelJson).append('\'');
|
||||
sb.append(", dataType='").append(dataType).append('\'');
|
||||
sb.append(", xmlPrefix='").append(xmlPrefix).append('\'');
|
||||
sb.append(", xmlNamespace='").append(xmlNamespace).append('\'');
|
||||
sb.append(", xmlName='").append(xmlName).append('\'');
|
||||
sb.append(", classFilename='").append(classFilename).append('\'');
|
||||
sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
|
||||
sb.append(", discriminator=").append(discriminator);
|
||||
sb.append(", defaultValue='").append(defaultValue).append('\'');
|
||||
sb.append(", arrayModelType='").append(arrayModelType).append('\'');
|
||||
sb.append(", isAlias=").append(isAlias);
|
||||
sb.append(", isString=").append(isString);
|
||||
sb.append(", isInteger=").append(isInteger);
|
||||
sb.append(", isLong=").append(isLong);
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isNumeric=").append(isNumeric);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", vars=").append(vars);
|
||||
sb.append(", allVars=").append(allVars);
|
||||
sb.append(", requiredVars=").append(requiredVars);
|
||||
sb.append(", optionalVars=").append(optionalVars);
|
||||
sb.append(", readOnlyVars=").append(readOnlyVars);
|
||||
sb.append(", readWriteVars=").append(readWriteVars);
|
||||
sb.append(", parentVars=").append(parentVars);
|
||||
sb.append(", allowableValues=").append(allowableValues);
|
||||
sb.append(", mandatory=").append(mandatory);
|
||||
sb.append(", allMandatory=").append(allMandatory);
|
||||
sb.append(", imports=").append(imports);
|
||||
sb.append(", hasVars=").append(hasVars);
|
||||
sb.append(", emptyVars=").append(emptyVars);
|
||||
sb.append(", hasMoreModels=").append(hasMoreModels);
|
||||
sb.append(", hasEnums=").append(hasEnums);
|
||||
sb.append(", isEnum=").append(isEnum);
|
||||
sb.append(", isNullable=").append(isNullable);
|
||||
sb.append(", hasRequired=").append(hasRequired);
|
||||
sb.append(", hasOptional=").append(hasOptional);
|
||||
sb.append(", isArrayModel=").append(isArrayModel);
|
||||
sb.append(", hasChildren=").append(hasChildren);
|
||||
sb.append(", isMapModel=").append(isMapModel);
|
||||
sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly);
|
||||
sb.append(", externalDocumentation=").append(externalDocumentation);
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -244,34 +244,106 @@ public class CodegenOperation {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(Locale.ROOT, "%s(%s)", baseName, path);
|
||||
final StringBuffer sb = new StringBuffer("CodegenOperation{");
|
||||
sb.append("responseHeaders=").append(responseHeaders);
|
||||
sb.append(", hasAuthMethods=").append(hasAuthMethods);
|
||||
sb.append(", hasConsumes=").append(hasConsumes);
|
||||
sb.append(", hasProduces=").append(hasProduces);
|
||||
sb.append(", hasParams=").append(hasParams);
|
||||
sb.append(", hasOptionalParams=").append(hasOptionalParams);
|
||||
sb.append(", hasRequiredParams=").append(hasRequiredParams);
|
||||
sb.append(", returnTypeIsPrimitive=").append(returnTypeIsPrimitive);
|
||||
sb.append(", returnSimpleType=").append(returnSimpleType);
|
||||
sb.append(", subresourceOperation=").append(subresourceOperation);
|
||||
sb.append(", isMapContainer=").append(isMapContainer);
|
||||
sb.append(", isListContainer=").append(isListContainer);
|
||||
sb.append(", isMultipart=").append(isMultipart);
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", isResponseBinary=").append(isResponseBinary);
|
||||
sb.append(", isResponseFile=").append(isResponseFile);
|
||||
sb.append(", hasReference=").append(hasReference);
|
||||
sb.append(", isRestfulIndex=").append(isRestfulIndex);
|
||||
sb.append(", isRestfulShow=").append(isRestfulShow);
|
||||
sb.append(", isRestfulCreate=").append(isRestfulCreate);
|
||||
sb.append(", isRestfulUpdate=").append(isRestfulUpdate);
|
||||
sb.append(", isRestfulDestroy=").append(isRestfulDestroy);
|
||||
sb.append(", isRestful=").append(isRestful);
|
||||
sb.append(", isDeprecated=").append(isDeprecated);
|
||||
sb.append(", isCallbackRequest=").append(isCallbackRequest);
|
||||
sb.append(", path='").append(path).append('\'');
|
||||
sb.append(", operationId='").append(operationId).append('\'');
|
||||
sb.append(", returnType='").append(returnType).append('\'');
|
||||
sb.append(", httpMethod='").append(httpMethod).append('\'');
|
||||
sb.append(", returnBaseType='").append(returnBaseType).append('\'');
|
||||
sb.append(", returnContainer='").append(returnContainer).append('\'');
|
||||
sb.append(", summary='").append(summary).append('\'');
|
||||
sb.append(", unescapedNotes='").append(unescapedNotes).append('\'');
|
||||
sb.append(", notes='").append(notes).append('\'');
|
||||
sb.append(", baseName='").append(baseName).append('\'');
|
||||
sb.append(", defaultResponse='").append(defaultResponse).append('\'');
|
||||
sb.append(", discriminator=").append(discriminator);
|
||||
sb.append(", consumes=").append(consumes);
|
||||
sb.append(", produces=").append(produces);
|
||||
sb.append(", prioritizedContentTypes=").append(prioritizedContentTypes);
|
||||
sb.append(", servers=").append(servers);
|
||||
sb.append(", bodyParam=").append(bodyParam);
|
||||
sb.append(", allParams=").append(allParams);
|
||||
sb.append(", bodyParams=").append(bodyParams);
|
||||
sb.append(", pathParams=").append(pathParams);
|
||||
sb.append(", queryParams=").append(queryParams);
|
||||
sb.append(", headerParams=").append(headerParams);
|
||||
sb.append(", formParams=").append(formParams);
|
||||
sb.append(", cookieParams=").append(cookieParams);
|
||||
sb.append(", requiredParams=").append(requiredParams);
|
||||
sb.append(", optionalParams=").append(optionalParams);
|
||||
sb.append(", authMethods=").append(authMethods);
|
||||
sb.append(", tags=").append(tags);
|
||||
sb.append(", responses=").append(responses);
|
||||
sb.append(", callbacks=").append(callbacks);
|
||||
sb.append(", imports=").append(imports);
|
||||
sb.append(", examples=").append(examples);
|
||||
sb.append(", requestBodyExamples=").append(requestBodyExamples);
|
||||
sb.append(", externalDocs=").append(externalDocs);
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
sb.append(", nickname='").append(nickname).append('\'');
|
||||
sb.append(", operationIdOriginal='").append(operationIdOriginal).append('\'');
|
||||
sb.append(", operationIdLowerCase='").append(operationIdLowerCase).append('\'');
|
||||
sb.append(", operationIdCamelCase='").append(operationIdCamelCase).append('\'');
|
||||
sb.append(", operationIdSnakeCase='").append(operationIdSnakeCase).append('\'');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CodegenOperation that = (CodegenOperation) o;
|
||||
|
||||
return Objects.equals(responseHeaders, that.responseHeaders) &&
|
||||
Objects.equals(hasAuthMethods, that.hasAuthMethods) &&
|
||||
Objects.equals(hasConsumes, that.hasConsumes) &&
|
||||
Objects.equals(hasProduces, that.hasProduces) &&
|
||||
Objects.equals(hasParams, that.hasParams) &&
|
||||
Objects.equals(hasOptionalParams, that.hasOptionalParams) &&
|
||||
Objects.equals(returnTypeIsPrimitive, that.returnTypeIsPrimitive) &&
|
||||
Objects.equals(returnSimpleType, that.returnSimpleType) &&
|
||||
Objects.equals(subresourceOperation, that.subresourceOperation) &&
|
||||
Objects.equals(isMapContainer, that.isMapContainer) &&
|
||||
Objects.equals(isListContainer, that.isListContainer) &&
|
||||
Objects.equals(isMultipart, that.isMultipart) &&
|
||||
Objects.equals(hasMore, that.hasMore) &&
|
||||
Objects.equals(isResponseBinary, that.isResponseBinary) &&
|
||||
Objects.equals(hasReference, that.hasReference) &&
|
||||
Objects.equals(isResponseFile, that.isResponseFile) &&
|
||||
Objects.equals(isDeprecated, that.isDeprecated) &&
|
||||
Objects.equals(isCallbackRequest, that.isCallbackRequest) &&
|
||||
return hasAuthMethods == that.hasAuthMethods &&
|
||||
hasConsumes == that.hasConsumes &&
|
||||
hasProduces == that.hasProduces &&
|
||||
hasParams == that.hasParams &&
|
||||
hasOptionalParams == that.hasOptionalParams &&
|
||||
hasRequiredParams == that.hasRequiredParams &&
|
||||
returnTypeIsPrimitive == that.returnTypeIsPrimitive &&
|
||||
returnSimpleType == that.returnSimpleType &&
|
||||
subresourceOperation == that.subresourceOperation &&
|
||||
isMapContainer == that.isMapContainer &&
|
||||
isListContainer == that.isListContainer &&
|
||||
isMultipart == that.isMultipart &&
|
||||
hasMore == that.hasMore &&
|
||||
isResponseBinary == that.isResponseBinary &&
|
||||
isResponseFile == that.isResponseFile &&
|
||||
hasReference == that.hasReference &&
|
||||
isRestfulIndex == that.isRestfulIndex &&
|
||||
isRestfulShow == that.isRestfulShow &&
|
||||
isRestfulCreate == that.isRestfulCreate &&
|
||||
isRestfulUpdate == that.isRestfulUpdate &&
|
||||
isRestfulDestroy == that.isRestfulDestroy &&
|
||||
isRestful == that.isRestful &&
|
||||
isDeprecated == that.isDeprecated &&
|
||||
isCallbackRequest == that.isCallbackRequest &&
|
||||
Objects.equals(responseHeaders, that.responseHeaders) &&
|
||||
Objects.equals(path, that.path) &&
|
||||
Objects.equals(operationId, that.operationId) &&
|
||||
Objects.equals(returnType, that.returnType) &&
|
||||
@ -286,6 +358,7 @@ public class CodegenOperation {
|
||||
Objects.equals(discriminator, that.discriminator) &&
|
||||
Objects.equals(consumes, that.consumes) &&
|
||||
Objects.equals(produces, that.produces) &&
|
||||
Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) &&
|
||||
Objects.equals(servers, that.servers) &&
|
||||
Objects.equals(bodyParam, that.bodyParam) &&
|
||||
Objects.equals(allParams, that.allParams) &&
|
||||
@ -303,75 +376,28 @@ public class CodegenOperation {
|
||||
Objects.equals(callbacks, that.callbacks) &&
|
||||
Objects.equals(imports, that.imports) &&
|
||||
Objects.equals(examples, that.examples) &&
|
||||
Objects.equals(requestBodyExamples, that.requestBodyExamples) &&
|
||||
Objects.equals(externalDocs, that.externalDocs) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(nickname, that.nickname) &&
|
||||
Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) &&
|
||||
Objects.equals(operationIdOriginal, that.operationIdOriginal) &&
|
||||
Objects.equals(operationIdLowerCase, that.operationIdLowerCase) &&
|
||||
Objects.equals(operationIdCamelCase, that.operationIdCamelCase);
|
||||
Objects.equals(operationIdCamelCase, that.operationIdCamelCase) &&
|
||||
Objects.equals(operationIdSnakeCase, that.operationIdSnakeCase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
responseHeaders,
|
||||
hasAuthMethods,
|
||||
hasConsumes,
|
||||
hasProduces,
|
||||
hasParams,
|
||||
hasOptionalParams,
|
||||
returnTypeIsPrimitive,
|
||||
returnSimpleType,
|
||||
subresourceOperation,
|
||||
isMapContainer,
|
||||
isListContainer,
|
||||
isMultipart,
|
||||
hasMore,
|
||||
isResponseBinary,
|
||||
isResponseFile,
|
||||
hasReference,
|
||||
isDeprecated,
|
||||
isCallbackRequest,
|
||||
path,
|
||||
operationId,
|
||||
returnType,
|
||||
httpMethod,
|
||||
returnBaseType,
|
||||
returnContainer,
|
||||
summary,
|
||||
unescapedNotes,
|
||||
notes,
|
||||
baseName,
|
||||
defaultResponse,
|
||||
discriminator,
|
||||
consumes,
|
||||
produces,
|
||||
servers,
|
||||
bodyParam,
|
||||
allParams,
|
||||
bodyParams,
|
||||
pathParams,
|
||||
queryParams,
|
||||
headerParams,
|
||||
formParams,
|
||||
cookieParams,
|
||||
requiredParams,
|
||||
optionalParams,
|
||||
authMethods,
|
||||
tags,
|
||||
responses,
|
||||
callbacks,
|
||||
imports,
|
||||
examples,
|
||||
externalDocs,
|
||||
vendorExtensions,
|
||||
nickname,
|
||||
prioritizedContentTypes,
|
||||
operationIdOriginal,
|
||||
operationIdLowerCase,
|
||||
operationIdCamelCase);
|
||||
}
|
||||
|
||||
|
||||
return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams,
|
||||
hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMapContainer,
|
||||
isListContainer, isMultipart, hasMore, isResponseBinary, isResponseFile, hasReference, isRestfulIndex,
|
||||
isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, isRestful, isDeprecated,
|
||||
isCallbackRequest, path, operationId, returnType, httpMethod, returnBaseType, returnContainer,
|
||||
summary, unescapedNotes, notes, baseName, defaultResponse, discriminator, consumes, produces,
|
||||
prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams,
|
||||
headerParams, formParams, cookieParams, requiredParams, optionalParams, authMethods, tags,
|
||||
responses, callbacks, imports, examples, requestBodyExamples, externalDocs, vendorExtensions,
|
||||
nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase);
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,167 @@ public class CodegenParameter {
|
||||
public CodegenProperty mostInnerItems;
|
||||
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
|
||||
public boolean hasValidation;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenParameter{");
|
||||
sb.append("isFormParam=").append(isFormParam);
|
||||
sb.append(", isQueryParam=").append(isQueryParam);
|
||||
sb.append(", isPathParam=").append(isPathParam);
|
||||
sb.append(", isHeaderParam=").append(isHeaderParam);
|
||||
sb.append(", isCookieParam=").append(isCookieParam);
|
||||
sb.append(", isBodyParam=").append(isBodyParam);
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", isContainer=").append(isContainer);
|
||||
sb.append(", secondaryParam=").append(secondaryParam);
|
||||
sb.append(", isCollectionFormatMulti=").append(isCollectionFormatMulti);
|
||||
sb.append(", isPrimitiveType=").append(isPrimitiveType);
|
||||
sb.append(", isModel=").append(isModel);
|
||||
sb.append(", isExplode=").append(isExplode);
|
||||
sb.append(", baseName='").append(baseName).append('\'');
|
||||
sb.append(", paramName='").append(paramName).append('\'');
|
||||
sb.append(", dataType='").append(dataType).append('\'');
|
||||
sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\'');
|
||||
sb.append(", dataFormat='").append(dataFormat).append('\'');
|
||||
sb.append(", collectionFormat='").append(collectionFormat).append('\'');
|
||||
sb.append(", description='").append(description).append('\'');
|
||||
sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
|
||||
sb.append(", baseType='").append(baseType).append('\'');
|
||||
sb.append(", defaultValue='").append(defaultValue).append('\'');
|
||||
sb.append(", enumName='").append(enumName).append('\'');
|
||||
sb.append(", style='").append(style).append('\'');
|
||||
sb.append(", example='").append(example).append('\'');
|
||||
sb.append(", jsonSchema='").append(jsonSchema).append('\'');
|
||||
sb.append(", isString=").append(isString);
|
||||
sb.append(", isNumeric=").append(isNumeric);
|
||||
sb.append(", isInteger=").append(isInteger);
|
||||
sb.append(", isLong=").append(isLong);
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", isByteArray=").append(isByteArray);
|
||||
sb.append(", isBinary=").append(isBinary);
|
||||
sb.append(", isBoolean=").append(isBoolean);
|
||||
sb.append(", isDate=").append(isDate);
|
||||
sb.append(", isDateTime=").append(isDateTime);
|
||||
sb.append(", isUuid=").append(isUuid);
|
||||
sb.append(", isUri=").append(isUri);
|
||||
sb.append(", isEmail=").append(isEmail);
|
||||
sb.append(", isFreeFormObject=").append(isFreeFormObject);
|
||||
sb.append(", isListContainer=").append(isListContainer);
|
||||
sb.append(", isMapContainer=").append(isMapContainer);
|
||||
sb.append(", isFile=").append(isFile);
|
||||
sb.append(", isEnum=").append(isEnum);
|
||||
sb.append(", _enum=").append(_enum);
|
||||
sb.append(", allowableValues=").append(allowableValues);
|
||||
sb.append(", items=").append(items);
|
||||
sb.append(", mostInnerItems=").append(mostInnerItems);
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
sb.append(", hasValidation=").append(hasValidation);
|
||||
sb.append(", isNullable=").append(isNullable);
|
||||
sb.append(", required=").append(required);
|
||||
sb.append(", maximum='").append(maximum).append('\'');
|
||||
sb.append(", exclusiveMaximum=").append(exclusiveMaximum);
|
||||
sb.append(", minimum='").append(minimum).append('\'');
|
||||
sb.append(", exclusiveMinimum=").append(exclusiveMinimum);
|
||||
sb.append(", maxLength=").append(maxLength);
|
||||
sb.append(", minLength=").append(minLength);
|
||||
sb.append(", pattern='").append(pattern).append('\'');
|
||||
sb.append(", maxItems=").append(maxItems);
|
||||
sb.append(", minItems=").append(minItems);
|
||||
sb.append(", uniqueItems=").append(uniqueItems);
|
||||
sb.append(", multipleOf=").append(multipleOf);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenParameter that = (CodegenParameter) o;
|
||||
return isFormParam == that.isFormParam &&
|
||||
isQueryParam == that.isQueryParam &&
|
||||
isPathParam == that.isPathParam &&
|
||||
isHeaderParam == that.isHeaderParam &&
|
||||
isCookieParam == that.isCookieParam &&
|
||||
isBodyParam == that.isBodyParam &&
|
||||
hasMore == that.hasMore &&
|
||||
isContainer == that.isContainer &&
|
||||
secondaryParam == that.secondaryParam &&
|
||||
isCollectionFormatMulti == that.isCollectionFormatMulti &&
|
||||
isPrimitiveType == that.isPrimitiveType &&
|
||||
isModel == that.isModel &&
|
||||
isExplode == that.isExplode &&
|
||||
isString == that.isString &&
|
||||
isNumeric == that.isNumeric &&
|
||||
isInteger == that.isInteger &&
|
||||
isLong == that.isLong &&
|
||||
isNumber == that.isNumber &&
|
||||
isFloat == that.isFloat &&
|
||||
isDouble == that.isDouble &&
|
||||
isByteArray == that.isByteArray &&
|
||||
isBinary == that.isBinary &&
|
||||
isBoolean == that.isBoolean &&
|
||||
isDate == that.isDate &&
|
||||
isDateTime == that.isDateTime &&
|
||||
isUuid == that.isUuid &&
|
||||
isUri == that.isUri &&
|
||||
isEmail == that.isEmail &&
|
||||
isFreeFormObject == that.isFreeFormObject &&
|
||||
isListContainer == that.isListContainer &&
|
||||
isMapContainer == that.isMapContainer &&
|
||||
isFile == that.isFile &&
|
||||
isEnum == that.isEnum &&
|
||||
hasValidation == that.hasValidation &&
|
||||
isNullable == that.isNullable &&
|
||||
required == that.required &&
|
||||
exclusiveMaximum == that.exclusiveMaximum &&
|
||||
exclusiveMinimum == that.exclusiveMinimum &&
|
||||
uniqueItems == that.uniqueItems &&
|
||||
Objects.equals(baseName, that.baseName) &&
|
||||
Objects.equals(paramName, that.paramName) &&
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
Objects.equals(datatypeWithEnum, that.datatypeWithEnum) &&
|
||||
Objects.equals(dataFormat, that.dataFormat) &&
|
||||
Objects.equals(collectionFormat, that.collectionFormat) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(unescapedDescription, that.unescapedDescription) &&
|
||||
Objects.equals(baseType, that.baseType) &&
|
||||
Objects.equals(defaultValue, that.defaultValue) &&
|
||||
Objects.equals(enumName, that.enumName) &&
|
||||
Objects.equals(style, that.style) &&
|
||||
Objects.equals(example, that.example) &&
|
||||
Objects.equals(jsonSchema, that.jsonSchema) &&
|
||||
Objects.equals(_enum, that._enum) &&
|
||||
Objects.equals(allowableValues, that.allowableValues) &&
|
||||
Objects.equals(items, that.items) &&
|
||||
Objects.equals(mostInnerItems, that.mostInnerItems) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(maximum, that.maximum) &&
|
||||
Objects.equals(minimum, that.minimum) &&
|
||||
Objects.equals(maxLength, that.maxLength) &&
|
||||
Objects.equals(minLength, that.minLength) &&
|
||||
Objects.equals(pattern, that.pattern) &&
|
||||
Objects.equals(maxItems, that.maxItems) &&
|
||||
Objects.equals(minItems, that.minItems) &&
|
||||
Objects.equals(multipleOf, that.multipleOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore,
|
||||
isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName,
|
||||
paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription,
|
||||
baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong,
|
||||
isNumber, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri,
|
||||
isEmail, isFreeFormObject, isListContainer, isMapContainer, isFile, isEnum, _enum, allowableValues,
|
||||
items, mostInnerItems, vendorExtensions, hasValidation, isNullable, required, maximum,
|
||||
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, maxItems, minItems,
|
||||
uniqueItems, multipleOf);
|
||||
}
|
||||
|
||||
public boolean isNullable;
|
||||
|
||||
/**
|
||||
@ -174,223 +335,10 @@ public class CodegenParameter {
|
||||
output.isListContainer = this.isListContainer;
|
||||
output.isMapContainer = this.isMapContainer;
|
||||
output.isExplode = this.isExplode;
|
||||
output.style = this.style;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CodegenParameter that = (CodegenParameter) o;
|
||||
|
||||
return Objects.equals(isEnum, that.isEnum) &&
|
||||
Objects.equals(isFormParam, that.isFormParam) &&
|
||||
Objects.equals(isQueryParam, that.isQueryParam) &&
|
||||
Objects.equals(isPathParam, that.isPathParam) &&
|
||||
Objects.equals(isHeaderParam, that.isHeaderParam) &&
|
||||
Objects.equals(isCookieParam, that.isCookieParam) &&
|
||||
Objects.equals(isBodyParam, that.isBodyParam) &&
|
||||
Objects.equals(hasMore, that.hasMore) &&
|
||||
Objects.equals(isContainer, that.isContainer) &&
|
||||
Objects.equals(secondaryParam, that.secondaryParam) &&
|
||||
Objects.equals(isCollectionFormatMulti, that.isCollectionFormatMulti) &&
|
||||
Objects.equals(isPrimitiveType, that.isPrimitiveType) &&
|
||||
Objects.equals(isModel, that.isModel) &&
|
||||
Objects.equals(baseName, that.baseName) &&
|
||||
Objects.equals(paramName, that.paramName) &&
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
Objects.equals(datatypeWithEnum, that.datatypeWithEnum) &&
|
||||
Objects.equals(enumName, that.enumName) &&
|
||||
Objects.equals(dataFormat, that.dataFormat) &&
|
||||
Objects.equals(collectionFormat, that.collectionFormat) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(unescapedDescription, that.unescapedDescription) &&
|
||||
Objects.equals(baseType, that.baseType) &&
|
||||
Objects.equals(defaultValue, that.defaultValue) &&
|
||||
Objects.equals(example, that.example) &&
|
||||
Objects.equals(jsonSchema, that.jsonSchema) &&
|
||||
Objects.equals(isString, that.isString) &&
|
||||
Objects.equals(isNumeric, that.isNumeric) &&
|
||||
Objects.equals(isInteger, that.isInteger) &&
|
||||
Objects.equals(isLong, that.isLong) &&
|
||||
Objects.equals(isNumber, that.isNumber) &&
|
||||
Objects.equals(isFloat, that.isFloat) &&
|
||||
Objects.equals(isDouble, that.isDouble) &&
|
||||
Objects.equals(isByteArray, that.isByteArray) &&
|
||||
Objects.equals(isBinary, that.isBinary) &&
|
||||
Objects.equals(isBoolean, that.isBoolean) &&
|
||||
Objects.equals(isDate, that.isDate) &&
|
||||
Objects.equals(isDateTime, that.isDateTime) &&
|
||||
Objects.equals(isUuid, that.isUuid) &&
|
||||
Objects.equals(isUri, that.isUri) &&
|
||||
Objects.equals(isEmail, that.isEmail) &&
|
||||
Objects.equals(isFreeFormObject, that.isFreeFormObject) &&
|
||||
Objects.equals(isListContainer, that.isListContainer) &&
|
||||
Objects.equals(isMapContainer, that.isMapContainer) &&
|
||||
Objects.equals(isFile, that.isFile) &&
|
||||
Objects.equals(_enum, that._enum) &&
|
||||
Objects.equals(allowableValues, that.allowableValues) &&
|
||||
Objects.equals(items, that.items) &&
|
||||
Objects.equals(mostInnerItems, that.mostInnerItems) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(hasValidation, that.hasValidation) &&
|
||||
Objects.equals(isNullable, that.isNullable) &&
|
||||
Objects.equals(required, that.required) &&
|
||||
Objects.equals(maximum, that.maximum) &&
|
||||
Objects.equals(exclusiveMaximum, that.exclusiveMaximum) &&
|
||||
Objects.equals(minimum, that.minimum) &&
|
||||
Objects.equals(exclusiveMinimum, that.exclusiveMinimum) &&
|
||||
Objects.equals(maxLength, that.maxLength) &&
|
||||
Objects.equals(minLength, that.minLength) &&
|
||||
Objects.equals(pattern, that.pattern) &&
|
||||
Objects.equals(maxItems, that.maxItems) &&
|
||||
Objects.equals(minItems, that.minItems) &&
|
||||
Objects.equals(uniqueItems, that.uniqueItems) &&
|
||||
Objects.equals(multipleOf, that.multipleOf) &&
|
||||
Objects.equals(isExplode, that.isExplode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
isFormParam,
|
||||
isQueryParam,
|
||||
isPathParam,
|
||||
isHeaderParam,
|
||||
isCookieParam,
|
||||
isBodyParam,
|
||||
hasMore,
|
||||
isContainer,
|
||||
secondaryParam,
|
||||
isCollectionFormatMulti,
|
||||
isPrimitiveType,
|
||||
isModel,
|
||||
baseName,
|
||||
paramName,
|
||||
dataType,
|
||||
datatypeWithEnum,
|
||||
enumName,
|
||||
dataFormat,
|
||||
collectionFormat,
|
||||
description,
|
||||
unescapedDescription,
|
||||
baseType,
|
||||
defaultValue,
|
||||
example,
|
||||
jsonSchema,
|
||||
isString,
|
||||
isNumeric,
|
||||
isInteger,
|
||||
isLong,
|
||||
isFloat,
|
||||
isNumber,
|
||||
isDouble,
|
||||
isByteArray,
|
||||
isBinary,
|
||||
isBoolean,
|
||||
isDate,
|
||||
isDateTime,
|
||||
isUuid,
|
||||
isUri,
|
||||
isEmail,
|
||||
isFreeFormObject,
|
||||
isListContainer,
|
||||
isMapContainer,
|
||||
isFile,
|
||||
isEnum,
|
||||
_enum,
|
||||
allowableValues,
|
||||
items,
|
||||
mostInnerItems,
|
||||
vendorExtensions,
|
||||
hasValidation,
|
||||
isNullable,
|
||||
required,
|
||||
maximum,
|
||||
exclusiveMaximum,
|
||||
minimum,
|
||||
exclusiveMinimum,
|
||||
maxLength,
|
||||
minLength,
|
||||
pattern,
|
||||
maxItems,
|
||||
minItems,
|
||||
uniqueItems,
|
||||
multipleOf,
|
||||
isExplode);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return "CodegenParameter{" +
|
||||
"isFormParam=" + isFormParam +
|
||||
", isQueryParam=" + isQueryParam +
|
||||
", isPathParam=" + isPathParam +
|
||||
", isHeaderParam=" + isHeaderParam +
|
||||
", isCookieParam=" + isCookieParam +
|
||||
", isBodyParam=" + isBodyParam +
|
||||
", hasMore=" + hasMore +
|
||||
", isContainer=" + isContainer +
|
||||
", secondaryParam=" + secondaryParam +
|
||||
", isCollectionFormatMulti=" + isCollectionFormatMulti +
|
||||
", isPrimitiveType=" + isPrimitiveType +
|
||||
", isModel=" + isModel +
|
||||
", baseName='" + baseName + '\'' +
|
||||
", paramName='" + paramName + '\'' +
|
||||
", dataType='" + dataType + '\'' +
|
||||
", datatypeWithEnum='" + datatypeWithEnum + '\'' +
|
||||
", dataFormat='" + dataFormat + '\'' +
|
||||
", collectionFormat='" + collectionFormat + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", unescapedDescription='" + unescapedDescription + '\'' +
|
||||
", baseType='" + baseType + '\'' +
|
||||
", defaultValue='" + defaultValue + '\'' +
|
||||
", enumName='" + enumName + '\'' +
|
||||
", example='" + example + '\'' +
|
||||
", jsonSchema='" + jsonSchema + '\'' +
|
||||
", isString=" + isString +
|
||||
", isNumeric=" + isNumeric +
|
||||
", isInteger=" + isInteger +
|
||||
", isLong=" + isLong +
|
||||
", isNumber=" + isNumber +
|
||||
", isFloat=" + isFloat +
|
||||
", isDouble=" + isDouble +
|
||||
", isByteArray=" + isByteArray +
|
||||
", isBinary=" + isBinary +
|
||||
", isBoolean=" + isBoolean +
|
||||
", isDate=" + isDate +
|
||||
", isDateTime=" + isDateTime +
|
||||
", isUuid=" + isUuid +
|
||||
", isUri=" + isUri +
|
||||
", isEmail=" + isEmail +
|
||||
", isFreeFormObject=" + isFreeFormObject +
|
||||
", isListContainer=" + isListContainer +
|
||||
", isMapContainer=" + isMapContainer +
|
||||
", isFile=" + isFile +
|
||||
", isEnum=" + isEnum +
|
||||
", _enum=" + _enum +
|
||||
", allowableValues=" + allowableValues +
|
||||
", items=" + items +
|
||||
", mostInnerItems=" + mostInnerItems +
|
||||
", vendorExtensions=" + vendorExtensions +
|
||||
", hasValidation=" + hasValidation +
|
||||
", isNullable=" + isNullable +
|
||||
", required=" + required +
|
||||
", maximum='" + maximum + '\'' +
|
||||
", exclusiveMaximum=" + exclusiveMaximum +
|
||||
", minimum='" + minimum + '\'' +
|
||||
", exclusiveMinimum=" + exclusiveMinimum +
|
||||
", maxLength=" + maxLength +
|
||||
", minLength=" + minLength +
|
||||
", pattern='" + pattern + '\'' +
|
||||
", maxItems=" + maxItems +
|
||||
", minItems=" + minItems +
|
||||
", uniqueItems=" + uniqueItems +
|
||||
", multipleOf=" + multipleOf +
|
||||
", isExplode=" + isExplode +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,7 @@ public class CodegenProperty implements Cloneable {
|
||||
public boolean isWriteOnly;
|
||||
public boolean isNullable;
|
||||
public boolean isSelfReference;
|
||||
public boolean isCircularReference;
|
||||
public List<String> _enum;
|
||||
public Map<String, Object> allowableValues;
|
||||
public CodegenProperty items;
|
||||
@ -410,170 +411,6 @@ public class CodegenProperty implements Cloneable {
|
||||
this.xmlNamespace = xmlNamespace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
_enum,
|
||||
allowableValues,
|
||||
openApiType,
|
||||
baseName,
|
||||
baseType,
|
||||
complexType,
|
||||
containerType,
|
||||
dataType,
|
||||
datatypeWithEnum,
|
||||
dataFormat,
|
||||
defaultValue,
|
||||
defaultValueWithParam,
|
||||
description,
|
||||
title,
|
||||
example,
|
||||
exclusiveMaximum,
|
||||
exclusiveMinimum,
|
||||
getter,
|
||||
hasMore,
|
||||
hasMoreNonReadOnly,
|
||||
isContainer,
|
||||
isEnum,
|
||||
isPrimitiveType,
|
||||
isModel,
|
||||
isReadOnly,
|
||||
isWriteOnly,
|
||||
isNullable,
|
||||
isSelfReference,
|
||||
items,
|
||||
mostInnerItems,
|
||||
jsonSchema,
|
||||
max,
|
||||
maxLength,
|
||||
maximum,
|
||||
min,
|
||||
minLength,
|
||||
minimum,
|
||||
name,
|
||||
pattern,
|
||||
required,
|
||||
secondaryParam,
|
||||
setter,
|
||||
unescapedDescription,
|
||||
vendorExtensions,
|
||||
hasValidation,
|
||||
isString,
|
||||
isNumeric,
|
||||
isInteger,
|
||||
isLong,
|
||||
isNumber,
|
||||
isFloat,
|
||||
isDouble,
|
||||
isByteArray,
|
||||
isBinary,
|
||||
isFile,
|
||||
isBoolean,
|
||||
isDate,
|
||||
isDateTime,
|
||||
isUuid,
|
||||
isUri,
|
||||
isEmail,
|
||||
isFreeFormObject,
|
||||
isMapContainer,
|
||||
isListContainer,
|
||||
isInherited,
|
||||
discriminatorValue,
|
||||
nameInCamelCase,
|
||||
nameInSnakeCase,
|
||||
enumName,
|
||||
maxItems,
|
||||
minItems,
|
||||
isXmlAttribute,
|
||||
xmlPrefix,
|
||||
xmlName,
|
||||
xmlNamespace,
|
||||
isXmlWrapped);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final CodegenProperty other = (CodegenProperty) obj;
|
||||
|
||||
return Objects.equals(baseName, other.baseName) &&
|
||||
Objects.equals(openApiType, other.openApiType) &&
|
||||
Objects.equals(complexType, other.complexType) &&
|
||||
Objects.equals(getter, other.getter) &&
|
||||
Objects.equals(setter, other.setter) &&
|
||||
Objects.equals(description, other.description) &&
|
||||
Objects.equals(title, other.title) &&
|
||||
Objects.equals(dataType, other.dataType) &&
|
||||
Objects.equals(datatypeWithEnum, other.datatypeWithEnum) &&
|
||||
Objects.equals(dataFormat, other.dataFormat) &&
|
||||
Objects.equals(name, other.name) &&
|
||||
Objects.equals(min, other.min) &&
|
||||
Objects.equals(max, other.max) &&
|
||||
Objects.equals(defaultValue, other.defaultValue) &&
|
||||
Objects.equals(baseType, other.baseType) &&
|
||||
Objects.equals(containerType, other.containerType) &&
|
||||
Objects.equals(maxLength, other.maxLength) &&
|
||||
Objects.equals(minLength, other.minLength) &&
|
||||
Objects.equals(pattern, other.pattern) &&
|
||||
Objects.equals(example, other.example) &&
|
||||
Objects.equals(jsonSchema, other.jsonSchema) &&
|
||||
Objects.equals(minimum, other.minimum) &&
|
||||
Objects.equals(maximum, other.maximum) &&
|
||||
Objects.equals(exclusiveMinimum, other.exclusiveMinimum) &&
|
||||
Objects.equals(exclusiveMaximum, other.exclusiveMaximum) &&
|
||||
Objects.equals(required, other.required) &&
|
||||
Objects.equals(secondaryParam, other.secondaryParam) &&
|
||||
Objects.equals(isPrimitiveType, other.isPrimitiveType) &&
|
||||
Objects.equals(isModel, other.isModel) &&
|
||||
Objects.equals(isContainer, other.isContainer) &&
|
||||
Objects.equals(isEnum, other.isEnum) &&
|
||||
Objects.equals(isReadOnly, other.isReadOnly) &&
|
||||
Objects.equals(isWriteOnly, other.isWriteOnly) &&
|
||||
Objects.equals(isNullable, other.isNullable) &&
|
||||
Objects.equals(isSelfReference, other.isSelfReference) &&
|
||||
Objects.equals(_enum, other._enum) &&
|
||||
Objects.equals(allowableValues, other.allowableValues) &&
|
||||
Objects.equals(vendorExtensions, other.vendorExtensions) &&
|
||||
Objects.equals(hasValidation, other.hasValidation) &&
|
||||
Objects.equals(isString, other.isString) &&
|
||||
Objects.equals(isNumeric, other.isNumeric) &&
|
||||
Objects.equals(isInteger, other.isInteger) &&
|
||||
Objects.equals(isLong, other.isLong) &&
|
||||
Objects.equals(isNumber, other.isNumber) &&
|
||||
Objects.equals(isFloat, other.isFloat) &&
|
||||
Objects.equals(isDouble, other.isDouble) &&
|
||||
Objects.equals(isByteArray, other.isByteArray) &&
|
||||
Objects.equals(isBoolean, other.isBoolean) &&
|
||||
Objects.equals(isDate, other.isDate) &&
|
||||
Objects.equals(isDateTime, other.isDateTime) &&
|
||||
Objects.equals(isUuid, other.isUuid) &&
|
||||
Objects.equals(isUri, other.isUri) &&
|
||||
Objects.equals(isEmail, other.isEmail) &&
|
||||
Objects.equals(isFreeFormObject, other.isFreeFormObject) &&
|
||||
Objects.equals(isBinary, other.isBinary) &&
|
||||
Objects.equals(isFile, other.isFile) &&
|
||||
Objects.equals(isListContainer, other.isListContainer) &&
|
||||
Objects.equals(isMapContainer, other.isMapContainer) &&
|
||||
Objects.equals(isInherited, other.isInherited) &&
|
||||
Objects.equals(discriminatorValue, other.discriminatorValue) &&
|
||||
Objects.equals(nameInCamelCase, other.nameInCamelCase) &&
|
||||
Objects.equals(nameInSnakeCase, other.nameInSnakeCase) &&
|
||||
Objects.equals(enumName, other.enumName) &&
|
||||
Objects.equals(maxItems, other.maxItems) &&
|
||||
Objects.equals(minItems, other.minItems) &&
|
||||
Objects.equals(isXmlAttribute, other.isXmlAttribute) &&
|
||||
Objects.equals(xmlPrefix, other.xmlPrefix) &&
|
||||
Objects.equals(xmlName, other.xmlName) &&
|
||||
Objects.equals(xmlNamespace, other.xmlNamespace) &&
|
||||
Objects.equals(isXmlWrapped, other.isXmlWrapped);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenProperty clone() {
|
||||
try {
|
||||
@ -600,86 +437,188 @@ public class CodegenProperty implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public java.lang.String toString() {
|
||||
return "CodegenProperty{" +
|
||||
"baseName='" + baseName + '\'' +
|
||||
", openApiType='" + openApiType + '\'' +
|
||||
", complexType='" + complexType + '\'' +
|
||||
", getter='" + getter + '\'' +
|
||||
", setter='" + setter + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", datatype='" + dataType + '\'' +
|
||||
", datatypeWithEnum='" + datatypeWithEnum + '\'' +
|
||||
", dataFormat='" + dataFormat + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", min='" + min + '\'' +
|
||||
", max='" + max + '\'' +
|
||||
", defaultValue='" + defaultValue + '\'' +
|
||||
", defaultValueWithParam='" + defaultValueWithParam + '\'' +
|
||||
", baseType='" + baseType + '\'' +
|
||||
", containerType='" + containerType + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", unescapedDescription='" + unescapedDescription + '\'' +
|
||||
", maxLength=" + maxLength +
|
||||
", minLength=" + minLength +
|
||||
", pattern='" + pattern + '\'' +
|
||||
", example='" + example + '\'' +
|
||||
", jsonSchema='" + jsonSchema + '\'' +
|
||||
", minimum='" + minimum + '\'' +
|
||||
", maximum='" + maximum + '\'' +
|
||||
", exclusiveMinimum=" + exclusiveMinimum +
|
||||
", exclusiveMaximum=" + exclusiveMaximum +
|
||||
", hasMore=" + hasMore +
|
||||
", required=" + required +
|
||||
", secondaryParam=" + secondaryParam +
|
||||
", hasMoreNonReadOnly=" + hasMoreNonReadOnly +
|
||||
", isPrimitiveType=" + isPrimitiveType +
|
||||
", isModel=" + isModel +
|
||||
", isContainer=" + isContainer +
|
||||
", isString=" + isString +
|
||||
", isNumeric=" + isNumeric +
|
||||
", isInteger=" + isInteger +
|
||||
", isLong=" + isLong +
|
||||
", isNumber=" + isNumber +
|
||||
", isFloat=" + isFloat +
|
||||
", isDouble=" + isDouble +
|
||||
", isByteArray=" + isByteArray +
|
||||
", isBinary=" + isBinary +
|
||||
", isFile=" + isFile +
|
||||
", isBoolean=" + isBoolean +
|
||||
", isDate=" + isDate +
|
||||
", isDateTime=" + isDateTime +
|
||||
", isUuid=" + isUuid +
|
||||
", isUri=" + isUri +
|
||||
", isEmail=" + isEmail +
|
||||
", isFreeFormObject=" + isFreeFormObject +
|
||||
", isListContainer=" + isListContainer +
|
||||
", isMapContainer=" + isMapContainer +
|
||||
", isEnum=" + isEnum +
|
||||
", isReadOnly=" + isReadOnly +
|
||||
", isWriteOnly=" + isWriteOnly +
|
||||
", isNullable=" + isNullable +
|
||||
", isSelfReference=" + isSelfReference +
|
||||
", _enum=" + _enum +
|
||||
", allowableValues=" + allowableValues +
|
||||
", items=" + items +
|
||||
", mostInnerItems=" + mostInnerItems +
|
||||
", vendorExtensions=" + vendorExtensions +
|
||||
", hasValidation=" + hasValidation +
|
||||
", isInherited=" + isInherited +
|
||||
", discriminatorValue='" + discriminatorValue + '\'' +
|
||||
", nameInCamelCase='" + nameInCamelCase + '\'' +
|
||||
", enumName='" + enumName + '\'' +
|
||||
", maxItems=" + maxItems +
|
||||
", minItems=" + minItems +
|
||||
", isXmlAttribute=" + isXmlAttribute +
|
||||
", xmlPrefix='" + xmlPrefix + '\'' +
|
||||
", xmlName='" + xmlName + '\'' +
|
||||
", xmlNamespace='" + xmlNamespace + '\'' +
|
||||
", isXmlWrapped=" + isXmlWrapped +
|
||||
'}';
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenProperty{");
|
||||
sb.append("openApiType='").append(openApiType).append('\'');
|
||||
sb.append(", baseName='").append(baseName).append('\'');
|
||||
sb.append(", complexType='").append(complexType).append('\'');
|
||||
sb.append(", getter='").append(getter).append('\'');
|
||||
sb.append(", setter='").append(setter).append('\'');
|
||||
sb.append(", description='").append(description).append('\'');
|
||||
sb.append(", dataType='").append(dataType).append('\'');
|
||||
sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\'');
|
||||
sb.append(", dataFormat='").append(dataFormat).append('\'');
|
||||
sb.append(", name='").append(name).append('\'');
|
||||
sb.append(", min='").append(min).append('\'');
|
||||
sb.append(", max='").append(max).append('\'');
|
||||
sb.append(", defaultValue='").append(defaultValue).append('\'');
|
||||
sb.append(", defaultValueWithParam='").append(defaultValueWithParam).append('\'');
|
||||
sb.append(", baseType='").append(baseType).append('\'');
|
||||
sb.append(", containerType='").append(containerType).append('\'');
|
||||
sb.append(", title='").append(title).append('\'');
|
||||
sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
|
||||
sb.append(", maxLength=").append(maxLength);
|
||||
sb.append(", minLength=").append(minLength);
|
||||
sb.append(", pattern='").append(pattern).append('\'');
|
||||
sb.append(", example='").append(example).append('\'');
|
||||
sb.append(", jsonSchema='").append(jsonSchema).append('\'');
|
||||
sb.append(", minimum='").append(minimum).append('\'');
|
||||
sb.append(", maximum='").append(maximum).append('\'');
|
||||
sb.append(", exclusiveMinimum=").append(exclusiveMinimum);
|
||||
sb.append(", exclusiveMaximum=").append(exclusiveMaximum);
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", required=").append(required);
|
||||
sb.append(", secondaryParam=").append(secondaryParam);
|
||||
sb.append(", hasMoreNonReadOnly=").append(hasMoreNonReadOnly);
|
||||
sb.append(", isPrimitiveType=").append(isPrimitiveType);
|
||||
sb.append(", isModel=").append(isModel);
|
||||
sb.append(", isContainer=").append(isContainer);
|
||||
sb.append(", isString=").append(isString);
|
||||
sb.append(", isNumeric=").append(isNumeric);
|
||||
sb.append(", isInteger=").append(isInteger);
|
||||
sb.append(", isLong=").append(isLong);
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", isByteArray=").append(isByteArray);
|
||||
sb.append(", isBinary=").append(isBinary);
|
||||
sb.append(", isFile=").append(isFile);
|
||||
sb.append(", isBoolean=").append(isBoolean);
|
||||
sb.append(", isDate=").append(isDate);
|
||||
sb.append(", isDateTime=").append(isDateTime);
|
||||
sb.append(", isUuid=").append(isUuid);
|
||||
sb.append(", isUri=").append(isUri);
|
||||
sb.append(", isEmail=").append(isEmail);
|
||||
sb.append(", isFreeFormObject=").append(isFreeFormObject);
|
||||
sb.append(", isListContainer=").append(isListContainer);
|
||||
sb.append(", isMapContainer=").append(isMapContainer);
|
||||
sb.append(", isEnum=").append(isEnum);
|
||||
sb.append(", isReadOnly=").append(isReadOnly);
|
||||
sb.append(", isWriteOnly=").append(isWriteOnly);
|
||||
sb.append(", isNullable=").append(isNullable);
|
||||
sb.append(", isSelfReference=").append(isSelfReference);
|
||||
sb.append(", isCircularReference=").append(isCircularReference);
|
||||
sb.append(", _enum=").append(_enum);
|
||||
sb.append(", allowableValues=").append(allowableValues);
|
||||
sb.append(", items=").append(items);
|
||||
sb.append(", mostInnerItems=").append(mostInnerItems);
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
sb.append(", hasValidation=").append(hasValidation);
|
||||
sb.append(", isInherited=").append(isInherited);
|
||||
sb.append(", discriminatorValue='").append(discriminatorValue).append('\'');
|
||||
sb.append(", nameInCamelCase='").append(nameInCamelCase).append('\'');
|
||||
sb.append(", nameInSnakeCase='").append(nameInSnakeCase).append('\'');
|
||||
sb.append(", enumName='").append(enumName).append('\'');
|
||||
sb.append(", maxItems=").append(maxItems);
|
||||
sb.append(", minItems=").append(minItems);
|
||||
sb.append(", isXmlAttribute=").append(isXmlAttribute);
|
||||
sb.append(", xmlPrefix='").append(xmlPrefix).append('\'');
|
||||
sb.append(", xmlName='").append(xmlName).append('\'');
|
||||
sb.append(", xmlNamespace='").append(xmlNamespace).append('\'');
|
||||
sb.append(", isXmlWrapped=").append(isXmlWrapped);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenProperty that = (CodegenProperty) o;
|
||||
return exclusiveMinimum == that.exclusiveMinimum &&
|
||||
exclusiveMaximum == that.exclusiveMaximum &&
|
||||
hasMore == that.hasMore &&
|
||||
required == that.required &&
|
||||
secondaryParam == that.secondaryParam &&
|
||||
hasMoreNonReadOnly == that.hasMoreNonReadOnly &&
|
||||
isPrimitiveType == that.isPrimitiveType &&
|
||||
isModel == that.isModel &&
|
||||
isContainer == that.isContainer &&
|
||||
isString == that.isString &&
|
||||
isNumeric == that.isNumeric &&
|
||||
isInteger == that.isInteger &&
|
||||
isLong == that.isLong &&
|
||||
isNumber == that.isNumber &&
|
||||
isFloat == that.isFloat &&
|
||||
isDouble == that.isDouble &&
|
||||
isByteArray == that.isByteArray &&
|
||||
isBinary == that.isBinary &&
|
||||
isFile == that.isFile &&
|
||||
isBoolean == that.isBoolean &&
|
||||
isDate == that.isDate &&
|
||||
isDateTime == that.isDateTime &&
|
||||
isUuid == that.isUuid &&
|
||||
isUri == that.isUri &&
|
||||
isEmail == that.isEmail &&
|
||||
isFreeFormObject == that.isFreeFormObject &&
|
||||
isListContainer == that.isListContainer &&
|
||||
isMapContainer == that.isMapContainer &&
|
||||
isEnum == that.isEnum &&
|
||||
isReadOnly == that.isReadOnly &&
|
||||
isWriteOnly == that.isWriteOnly &&
|
||||
isNullable == that.isNullable &&
|
||||
isSelfReference == that.isSelfReference &&
|
||||
isCircularReference == that.isCircularReference &&
|
||||
hasValidation == that.hasValidation &&
|
||||
isInherited == that.isInherited &&
|
||||
isXmlAttribute == that.isXmlAttribute &&
|
||||
isXmlWrapped == that.isXmlWrapped &&
|
||||
Objects.equals(openApiType, that.openApiType) &&
|
||||
Objects.equals(baseName, that.baseName) &&
|
||||
Objects.equals(complexType, that.complexType) &&
|
||||
Objects.equals(getter, that.getter) &&
|
||||
Objects.equals(setter, that.setter) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
Objects.equals(datatypeWithEnum, that.datatypeWithEnum) &&
|
||||
Objects.equals(dataFormat, that.dataFormat) &&
|
||||
Objects.equals(name, that.name) &&
|
||||
Objects.equals(min, that.min) &&
|
||||
Objects.equals(max, that.max) &&
|
||||
Objects.equals(defaultValue, that.defaultValue) &&
|
||||
Objects.equals(defaultValueWithParam, that.defaultValueWithParam) &&
|
||||
Objects.equals(baseType, that.baseType) &&
|
||||
Objects.equals(containerType, that.containerType) &&
|
||||
Objects.equals(title, that.title) &&
|
||||
Objects.equals(unescapedDescription, that.unescapedDescription) &&
|
||||
Objects.equals(maxLength, that.maxLength) &&
|
||||
Objects.equals(minLength, that.minLength) &&
|
||||
Objects.equals(pattern, that.pattern) &&
|
||||
Objects.equals(example, that.example) &&
|
||||
Objects.equals(jsonSchema, that.jsonSchema) &&
|
||||
Objects.equals(minimum, that.minimum) &&
|
||||
Objects.equals(maximum, that.maximum) &&
|
||||
Objects.equals(_enum, that._enum) &&
|
||||
Objects.equals(allowableValues, that.allowableValues) &&
|
||||
Objects.equals(items, that.items) &&
|
||||
Objects.equals(mostInnerItems, that.mostInnerItems) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(discriminatorValue, that.discriminatorValue) &&
|
||||
Objects.equals(nameInCamelCase, that.nameInCamelCase) &&
|
||||
Objects.equals(nameInSnakeCase, that.nameInSnakeCase) &&
|
||||
Objects.equals(enumName, that.enumName) &&
|
||||
Objects.equals(maxItems, that.maxItems) &&
|
||||
Objects.equals(minItems, that.minItems) &&
|
||||
Objects.equals(xmlPrefix, that.xmlPrefix) &&
|
||||
Objects.equals(xmlName, that.xmlName) &&
|
||||
Objects.equals(xmlNamespace, that.xmlNamespace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(openApiType, baseName, complexType, getter, setter, description, dataType,
|
||||
datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam, baseType,
|
||||
containerType, title, unescapedDescription, maxLength, minLength, pattern, example, jsonSchema,
|
||||
minimum, maximum, exclusiveMinimum, exclusiveMaximum, hasMore, required, secondaryParam,
|
||||
hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, isInteger,
|
||||
isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile, isBoolean, isDate, isDateTime,
|
||||
isUuid, isUri, isEmail, isFreeFormObject, isListContainer, isMapContainer, isEnum, isReadOnly,
|
||||
isWriteOnly, isNullable, isSelfReference, isCircularReference, _enum, allowableValues, items,
|
||||
mostInnerItems, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,
|
||||
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace,
|
||||
isXmlWrapped);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class CodegenResponse {
|
||||
public String code, message;
|
||||
public boolean hasMore;
|
||||
public List<Map<String, Object>> examples;
|
||||
public String dataType, baseType, containerType;
|
||||
public String dataType, baseType, containerType, pattern;
|
||||
public boolean hasHeaders;
|
||||
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate,
|
||||
isDateTime, isUuid, isEmail, isModel, isFreeFormObject;
|
||||
@ -43,50 +43,10 @@ public class CodegenResponse {
|
||||
return "0".equals(code) || "default".equals(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CodegenResponse{" +
|
||||
"headers=" + headers +
|
||||
", code='" + code + '\'' +
|
||||
", message='" + message + '\'' +
|
||||
", hasMore=" + hasMore +
|
||||
", examples=" + examples +
|
||||
", dataType='" + dataType + '\'' +
|
||||
", baseType='" + baseType + '\'' +
|
||||
", containerType='" + containerType + '\'' +
|
||||
", hasHeaders=" + hasHeaders +
|
||||
", isString=" + isString +
|
||||
", isNumeric=" + isNumeric +
|
||||
", isInteger=" + isInteger +
|
||||
", isLong=" + isLong +
|
||||
", isNumber=" + isNumber +
|
||||
", isFloat=" + isFloat +
|
||||
", isDouble=" + isDouble +
|
||||
", isByteArray=" + isByteArray +
|
||||
", isBoolean=" + isBoolean +
|
||||
", isDate=" + isDate +
|
||||
", isDateTime=" + isDateTime +
|
||||
", isUuid=" + isUuid +
|
||||
", isEmail=" + isEmail +
|
||||
", isFreeFormObject=" + isFreeFormObject +
|
||||
", isModel=" + isModel +
|
||||
", isDefault=" + isDefault +
|
||||
", simpleType=" + simpleType +
|
||||
", primitiveType=" + primitiveType +
|
||||
", isMapContainer=" + isMapContainer +
|
||||
", isListContainer=" + isListContainer +
|
||||
", isBinary=" + isBinary +
|
||||
", isFile=" + isFile +
|
||||
", schema=" + schema +
|
||||
", jsonSchema='" + jsonSchema + '\'' +
|
||||
", vendorExtensions=" + vendorExtensions +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!(o instanceof CodegenResponse)) return false;
|
||||
CodegenResponse that = (CodegenResponse) o;
|
||||
return hasMore == that.hasMore &&
|
||||
hasHeaders == that.hasHeaders &&
|
||||
@ -103,8 +63,8 @@ public class CodegenResponse {
|
||||
isDateTime == that.isDateTime &&
|
||||
isUuid == that.isUuid &&
|
||||
isEmail == that.isEmail &&
|
||||
isFreeFormObject == that.isFreeFormObject &&
|
||||
isModel == that.isModel &&
|
||||
isFreeFormObject == that.isFreeFormObject &&
|
||||
isDefault == that.isDefault &&
|
||||
simpleType == that.simpleType &&
|
||||
primitiveType == that.primitiveType &&
|
||||
@ -119,6 +79,7 @@ public class CodegenResponse {
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
Objects.equals(baseType, that.baseType) &&
|
||||
Objects.equals(containerType, that.containerType) &&
|
||||
Objects.equals(pattern, that.pattern) &&
|
||||
Objects.equals(schema, that.schema) &&
|
||||
Objects.equals(jsonSchema, that.jsonSchema) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions);
|
||||
@ -126,9 +87,51 @@ public class CodegenResponse {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, hasHeaders,
|
||||
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate,
|
||||
isDateTime, isUuid, isEmail, isFreeFormObject, isModel, isDefault, simpleType, primitiveType, isMapContainer,
|
||||
isListContainer, isBinary, isFile, schema, jsonSchema, vendorExtensions);
|
||||
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, pattern,
|
||||
hasHeaders, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray,
|
||||
isBoolean, isDate, isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isDefault, simpleType,
|
||||
primitiveType, isMapContainer, isListContainer, isBinary, isFile, schema, jsonSchema, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenResponse{");
|
||||
sb.append("headers=").append(headers);
|
||||
sb.append(", code='").append(code).append('\'');
|
||||
sb.append(", message='").append(message).append('\'');
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", examples=").append(examples);
|
||||
sb.append(", dataType='").append(dataType).append('\'');
|
||||
sb.append(", pattern='").append(pattern).append('\'');
|
||||
sb.append(", baseType='").append(baseType).append('\'');
|
||||
sb.append(", containerType='").append(containerType).append('\'');
|
||||
sb.append(", hasHeaders=").append(hasHeaders);
|
||||
sb.append(", isString=").append(isString);
|
||||
sb.append(", isNumeric=").append(isNumeric);
|
||||
sb.append(", isInteger=").append(isInteger);
|
||||
sb.append(", isLong=").append(isLong);
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", isByteArray=").append(isByteArray);
|
||||
sb.append(", isBoolean=").append(isBoolean);
|
||||
sb.append(", isDate=").append(isDate);
|
||||
sb.append(", isDateTime=").append(isDateTime);
|
||||
sb.append(", isUuid=").append(isUuid);
|
||||
sb.append(", isEmail=").append(isEmail);
|
||||
sb.append(", isModel=").append(isModel);
|
||||
sb.append(", isFreeFormObject=").append(isFreeFormObject);
|
||||
sb.append(", isDefault=").append(isDefault);
|
||||
sb.append(", simpleType=").append(simpleType);
|
||||
sb.append(", primitiveType=").append(primitiveType);
|
||||
sb.append(", isMapContainer=").append(isMapContainer);
|
||||
sb.append(", isListContainer=").append(isListContainer);
|
||||
sb.append(", isBinary=").append(isBinary);
|
||||
sb.append(", isFile=").append(isFile);
|
||||
sb.append(", schema=").append(schema);
|
||||
sb.append(", jsonSchema='").append(jsonSchema).append('\'');
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -41,67 +41,6 @@ public class CodegenSecurity {
|
||||
public List<Map<String, Object>> scopes;
|
||||
public Boolean isCode, isPassword, isApplication, isImplicit;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(Locale.ROOT, "%s(%s)", name, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CodegenSecurity that = (CodegenSecurity) o;
|
||||
|
||||
return Objects.equals(name, that.name) &&
|
||||
Objects.equals(type, that.type) &&
|
||||
Objects.equals(hasMore, that.hasMore) &&
|
||||
Objects.equals(isBasic, that.isBasic) &&
|
||||
Objects.equals(isBasicBasic, that.isBasicBasic) &&
|
||||
Objects.equals(isBasicBearer, that.isBasicBearer) &&
|
||||
Objects.equals(bearerFormat, that.bearerFormat) &&
|
||||
Objects.equals(isOAuth, that.isOAuth) &&
|
||||
Objects.equals(isApiKey, that.isApiKey) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(keyParamName, that.keyParamName) &&
|
||||
Objects.equals(isKeyInQuery, that.isKeyInQuery) &&
|
||||
Objects.equals(isKeyInHeader, that.isKeyInHeader) &&
|
||||
Objects.equals(flow, that.flow) &&
|
||||
Objects.equals(authorizationUrl, that.authorizationUrl) &&
|
||||
Objects.equals(tokenUrl, that.tokenUrl) &&
|
||||
Objects.equals(isCode, that.isCode) &&
|
||||
Objects.equals(isPassword, that.isPassword) &&
|
||||
Objects.equals(isApplication, that.isApplication) &&
|
||||
Objects.equals(isImplicit, that.isImplicit) &&
|
||||
Objects.equals(scopes, that.scopes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
name,
|
||||
type,
|
||||
hasMore,
|
||||
isBasic,
|
||||
isBasicBasic,
|
||||
isBasicBearer,
|
||||
bearerFormat,
|
||||
isOAuth,
|
||||
isApiKey,
|
||||
vendorExtensions,
|
||||
keyParamName,
|
||||
isKeyInQuery,
|
||||
isKeyInHeader,
|
||||
flow,
|
||||
authorizationUrl,
|
||||
tokenUrl,
|
||||
isCode,
|
||||
isPassword,
|
||||
isApplication,
|
||||
isImplicit,
|
||||
scopes);
|
||||
}
|
||||
|
||||
// Return a copy of the security object, filtering out any scopes from the passed-in list.
|
||||
public CodegenSecurity filterByScopeNames(List<String> filterScopes) {
|
||||
CodegenSecurity filteredSecurity = new CodegenSecurity();
|
||||
@ -144,4 +83,72 @@ public class CodegenSecurity {
|
||||
|
||||
return filteredSecurity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenSecurity that = (CodegenSecurity) o;
|
||||
return Objects.equals(name, that.name) &&
|
||||
Objects.equals(type, that.type) &&
|
||||
Objects.equals(scheme, that.scheme) &&
|
||||
Objects.equals(hasMore, that.hasMore) &&
|
||||
Objects.equals(isBasic, that.isBasic) &&
|
||||
Objects.equals(isOAuth, that.isOAuth) &&
|
||||
Objects.equals(isApiKey, that.isApiKey) &&
|
||||
Objects.equals(isBasicBasic, that.isBasicBasic) &&
|
||||
Objects.equals(isBasicBearer, that.isBasicBearer) &&
|
||||
Objects.equals(bearerFormat, that.bearerFormat) &&
|
||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||
Objects.equals(keyParamName, that.keyParamName) &&
|
||||
Objects.equals(isKeyInQuery, that.isKeyInQuery) &&
|
||||
Objects.equals(isKeyInHeader, that.isKeyInHeader) &&
|
||||
Objects.equals(isKeyInCookie, that.isKeyInCookie) &&
|
||||
Objects.equals(flow, that.flow) &&
|
||||
Objects.equals(authorizationUrl, that.authorizationUrl) &&
|
||||
Objects.equals(tokenUrl, that.tokenUrl) &&
|
||||
Objects.equals(scopes, that.scopes) &&
|
||||
Objects.equals(isCode, that.isCode) &&
|
||||
Objects.equals(isPassword, that.isPassword) &&
|
||||
Objects.equals(isApplication, that.isApplication) &&
|
||||
Objects.equals(isImplicit, that.isImplicit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isBasicBearer,
|
||||
bearerFormat, vendorExtensions, keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow,
|
||||
authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenSecurity{");
|
||||
sb.append("name='").append(name).append('\'');
|
||||
sb.append(", type='").append(type).append('\'');
|
||||
sb.append(", scheme='").append(scheme).append('\'');
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", isBasic=").append(isBasic);
|
||||
sb.append(", isOAuth=").append(isOAuth);
|
||||
sb.append(", isApiKey=").append(isApiKey);
|
||||
sb.append(", isBasicBasic=").append(isBasicBasic);
|
||||
sb.append(", isBasicBearer=").append(isBasicBearer);
|
||||
sb.append(", bearerFormat='").append(bearerFormat).append('\'');
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
sb.append(", keyParamName='").append(keyParamName).append('\'');
|
||||
sb.append(", isKeyInQuery=").append(isKeyInQuery);
|
||||
sb.append(", isKeyInHeader=").append(isKeyInHeader);
|
||||
sb.append(", isKeyInCookie=").append(isKeyInCookie);
|
||||
sb.append(", flow='").append(flow).append('\'');
|
||||
sb.append(", authorizationUrl='").append(authorizationUrl).append('\'');
|
||||
sb.append(", tokenUrl='").append(tokenUrl).append('\'');
|
||||
sb.append(", scopes=").append(scopes);
|
||||
sb.append(", isCode=").append(isCode);
|
||||
sb.append(", isPassword=").append(isPassword);
|
||||
sb.append(", isApplication=").append(isApplication);
|
||||
sb.append(", isImplicit=").append(isImplicit);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,36 @@
|
||||
package org.openapitools.codegen;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CodegenServer {
|
||||
public String url;
|
||||
public String description;
|
||||
public List<CodegenServerVariable> variables;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenServer that = (CodegenServer) o;
|
||||
return Objects.equals(url, that.url) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(variables, that.variables);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(url, description, variables);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenServer{");
|
||||
sb.append("url='").append(url).append('\'');
|
||||
sb.append(", description='").append(description).append('\'');
|
||||
sb.append(", variables=").append(variables);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.openapitools.codegen;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CodegenServerVariable {
|
||||
public String name;
|
||||
@ -8,4 +9,34 @@ public class CodegenServerVariable {
|
||||
public String description;
|
||||
public List<String> enumValues;
|
||||
public String value;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenServerVariable that = (CodegenServerVariable) o;
|
||||
return Objects.equals(name, that.name) &&
|
||||
Objects.equals(defaultValue, that.defaultValue) &&
|
||||
Objects.equals(description, that.description) &&
|
||||
Objects.equals(enumValues, that.enumValues) &&
|
||||
Objects.equals(value, that.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(name, defaultValue, description, enumValues, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("CodegenServerVariable{");
|
||||
sb.append("name='").append(name).append('\'');
|
||||
sb.append(", defaultValue='").append(defaultValue).append('\'');
|
||||
sb.append(", description='").append(description).append('\'');
|
||||
sb.append(", enumValues=").append(enumValues);
|
||||
sb.append(", value='").append(value).append('\'');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -328,10 +328,61 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
setCircularReferences(allModels);
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
public void setCircularReferences(Map<String, CodegenModel> models) {
|
||||
final Map<String, List<CodegenProperty>> dependencyMap = models.entrySet().stream()
|
||||
.collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue())));
|
||||
|
||||
models.keySet().forEach(name -> setCircularReferencesOnProperties(name, dependencyMap));
|
||||
}
|
||||
|
||||
private List<CodegenProperty> getModelDependencies(CodegenModel model) {
|
||||
return model.getAllVars().stream()
|
||||
.map(prop -> {
|
||||
if (prop.isContainer) {
|
||||
return prop.items.dataType == null ? null : prop;
|
||||
}
|
||||
return prop.dataType == null ? null : prop;
|
||||
})
|
||||
.filter(prop -> prop != null)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void setCircularReferencesOnProperties(final String root,
|
||||
final Map<String, List<CodegenProperty>> dependencyMap) {
|
||||
dependencyMap.getOrDefault(root, new ArrayList<>()).stream()
|
||||
.forEach(prop -> {
|
||||
final List<String> unvisited =
|
||||
Collections.singletonList(prop.isContainer ? prop.items.dataType : prop.dataType);
|
||||
prop.isCircularReference = isCircularReference(root,
|
||||
new HashSet<>(),
|
||||
new ArrayList<>(unvisited),
|
||||
dependencyMap);
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isCircularReference(final String root,
|
||||
final Set<String> visited,
|
||||
final List<String> unvisited,
|
||||
final Map<String, List<CodegenProperty>> dependencyMap) {
|
||||
for (int i = 0; i < unvisited.size(); i++) {
|
||||
final String next = unvisited.get(i);
|
||||
if (!visited.contains(next)) {
|
||||
if (next.equals(root)) {
|
||||
return true;
|
||||
}
|
||||
dependencyMap.getOrDefault(next, new ArrayList<>())
|
||||
.forEach(prop -> unvisited.add(prop.isContainer ? prop.items.dataType : prop.dataType));
|
||||
visited.add(next);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// override with any special post-processing
|
||||
@SuppressWarnings("static-method")
|
||||
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
||||
@ -1788,11 +1839,19 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
Map<String, Schema> allProperties = new LinkedHashMap<String, Schema>();
|
||||
List<String> allRequired = new ArrayList<String>();
|
||||
|
||||
// if schema has properties outside of allOf/oneOf/anyOf also add them to m
|
||||
if (composed.getProperties() != null && !composed.getProperties().isEmpty()) {
|
||||
if (composed.getOneOf() != null && !composed.getOneOf().isEmpty()) {
|
||||
LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " +
|
||||
"For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'.");
|
||||
}
|
||||
addVars(m, unaliasPropertySchema(composed.getProperties()), composed.getRequired(), null, null);
|
||||
}
|
||||
|
||||
// parent model
|
||||
final String parentName = ModelUtils.getParentName(composed, allDefinitions);
|
||||
final List<String> allParents = ModelUtils.getAllParentsName(composed, allDefinitions);
|
||||
final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName);
|
||||
final boolean hasParent = StringUtils.isNotBlank(parentName);
|
||||
|
||||
// TODO revise the logic below to set dicriminator, xml attributes
|
||||
if (supportsInheritance || supportsMixins) {
|
||||
@ -2879,6 +2938,10 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
responseSchema = ModelUtils.getSchemaFromResponse(response);
|
||||
}
|
||||
r.schema = responseSchema;
|
||||
if (responseSchema != null && responseSchema.getPattern() != null) {
|
||||
r.pattern = toRegularExpression(responseSchema.getPattern());
|
||||
}
|
||||
|
||||
r.message = escapeText(response.getDescription());
|
||||
// TODO need to revise and test examples in responses
|
||||
// ApiResponse does not support examples at the moment
|
||||
|
@ -1295,6 +1295,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
// We have to create a new auth method instance because the original object must
|
||||
// not be modified.
|
||||
CodegenSecurity opSecurity = security.filterByScopeNames(opScopes);
|
||||
opSecurity.hasMore = security.hasMore;
|
||||
result.add(opSecurity);
|
||||
filtered = true;
|
||||
break;
|
||||
|
@ -376,7 +376,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
// this will only import "fmt" and "strings" if there are items in pathParams
|
||||
for (CodegenOperation operation : operations) {
|
||||
if (operation.pathParams != null && operation.pathParams.size() > 0) {
|
||||
imports.add(createMapping("import", "fmt"));
|
||||
imports.add(createMapping("import", "strings"));
|
||||
break; //just need to import once
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
public static final String SUPPORT_JAVA6 = "supportJava6";
|
||||
public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping";
|
||||
public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix";
|
||||
public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations";
|
||||
|
||||
protected String dateLibrary = "threetenbp";
|
||||
protected boolean supportAsync = false;
|
||||
@ -91,6 +92,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
protected String parentArtifactId = "";
|
||||
protected String parentVersion = "";
|
||||
protected boolean parentOverridden = false;
|
||||
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
|
||||
|
||||
public AbstractJavaCodegen() {
|
||||
super();
|
||||
@ -184,6 +186,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)", disableHtmlEscaping));
|
||||
cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix").defaultValue(this.getBooleanGetterPrefix()));
|
||||
cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations)"));
|
||||
|
||||
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC));
|
||||
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC));
|
||||
@ -221,6 +224,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
}
|
||||
additionalProperties.put(BOOLEAN_GETTER_PREFIX, booleanGetterPrefix);
|
||||
|
||||
if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) {
|
||||
String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString();
|
||||
|
||||
this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.split(";")));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
|
||||
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
|
||||
} else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) {
|
||||
@ -488,6 +497,20 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
|
||||
objs = super.updateAllModels(objs);
|
||||
|
||||
if (!additionalModelTypeAnnotations.isEmpty()) {
|
||||
for (String modelName : objs.keySet()) {
|
||||
Map<String, Object> models = (Map<String, Object>) objs.get(modelName);
|
||||
models.put(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations);
|
||||
}
|
||||
}
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
private void sanitizeConfig() {
|
||||
// Sanitize any config options here. We also have to update the additionalProperties because
|
||||
// the whole additionalProperties object is injected into the main object passed to the mustache layer
|
||||
@ -1547,6 +1570,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
this.parentOverridden = parentOverridden;
|
||||
}
|
||||
|
||||
public void setAdditionalModelTypeAnnotations(final List<String> additionalModelTypeAnnotations) {
|
||||
this.additionalModelTypeAnnotations = additionalModelTypeAnnotations;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
||||
super.addAdditionPropertiesToCodeGenModel(codegenModel, schema);
|
||||
|
@ -43,6 +43,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
|
||||
public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson}
|
||||
|
||||
public static final String MODEL_MUTABLE = "modelMutable";
|
||||
public static final String MODEL_MUTABLE_DESC = "Create mutable models";
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);
|
||||
|
||||
protected String artifactId;
|
||||
@ -225,6 +228,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC));
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(MODEL_MUTABLE, MODEL_MUTABLE_DESC, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -347,6 +347,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
});
|
||||
}
|
||||
}
|
||||
setCircularReferences(allModels);
|
||||
for (Map.Entry<String, Object> entry : objs.entrySet()) {
|
||||
Map<String, Object> inner = (Map<String, Object>) entry.getValue();
|
||||
List<Map<String, Object>> models = (List<Map<String, Object>>) inner.get("models");
|
||||
|
@ -144,10 +144,19 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
||||
|
||||
if (additionalProperties.containsKey("serverPort") && additionalProperties.get("serverPort") instanceof Integer) {
|
||||
this.setServerPort((int) additionalProperties.get("serverPort"));
|
||||
} else if (additionalProperties.containsKey("serverPort") && additionalProperties.get("serverPort") instanceof String){
|
||||
try {
|
||||
this.setServerPort(Integer.parseInt(additionalProperties.get("serverPort").toString()));
|
||||
additionalProperties.put("serverPort", serverPort);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
LOGGER.warn("serverPort is not a valid integer... defaulting to {}", serverPort);
|
||||
additionalProperties.put("serverPort", serverPort);
|
||||
}
|
||||
} else {
|
||||
additionalProperties.put("serverPort", serverPort);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey("featureCORS")) {
|
||||
this.setFeatureCORS(convertPropertyToBooleanAndWriteBack("featureCORS"));
|
||||
} else {
|
||||
@ -165,6 +174,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
||||
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
||||
supportingFiles.add(new SupportingFile("main.mustache", "", "main.go"));
|
||||
supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile"));
|
||||
supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod"));
|
||||
supportingFiles.add(new SupportingFile("routers.mustache", sourceFolder, "routers.go"));
|
||||
supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go"));
|
||||
supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go"));
|
||||
|
@ -29,6 +29,9 @@ import org.openapitools.codegen.utils.ProcessUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
@ -39,8 +42,7 @@ import static java.util.Collections.sort;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
implements BeanValidationFeatures, PerformBeanValidationFeatures,
|
||||
GzipFeatures {
|
||||
implements BeanValidationFeatures, PerformBeanValidationFeatures, GzipFeatures {
|
||||
|
||||
static final String MEDIA_TYPE = "mediaType";
|
||||
|
||||
@ -77,6 +79,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
public static final String RETROFIT_1 = "retrofit";
|
||||
public static final String RETROFIT_2 = "retrofit2";
|
||||
public static final String VERTX = "vertx";
|
||||
public static final String MICROPROFILE = "microprofile";
|
||||
|
||||
public static final String SERIALIZATION_LIBRARY_GSON = "gson";
|
||||
public static final String SERIALIZATION_LIBRARY_JACKSON = "jackson";
|
||||
@ -145,6 +148,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x");
|
||||
supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8");
|
||||
supportedLibraries.put(NATIVE, "HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+");
|
||||
supportedLibraries.put(MICROPROFILE, "HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x");
|
||||
|
||||
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
|
||||
libraryOption.setEnum(supportedLibraries);
|
||||
@ -176,11 +180,22 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
return "Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (1.x, 2.x), OpenFeign (9.x, 10.x) and more.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations) {
|
||||
super.addOperationToGroup(tag, resourcePath, operation, co, operations);
|
||||
if (MICROPROFILE.equals(getLibrary())) {
|
||||
co.subresourceOperation = !co.path.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
if ((WEBCLIENT.equals(getLibrary()) && "threetenbp".equals(dateLibrary)) || NATIVE.equals(getLibrary())) {
|
||||
dateLibrary = "java8";
|
||||
}
|
||||
else if (MICROPROFILE.equals(getLibrary())) {
|
||||
dateLibrary = "legacy";
|
||||
}
|
||||
|
||||
super.processOpts();
|
||||
|
||||
@ -266,12 +281,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
writeOptional(outputFolder, new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml"));
|
||||
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", invokerFolder, "ApiClient.java"));
|
||||
if (!(RESTTEMPLATE.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || NATIVE.equals(getLibrary()))) {
|
||||
if (!(RESTTEMPLATE.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || NATIVE.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) {
|
||||
supportingFiles.add(new SupportingFile("StringUtil.mustache", invokerFolder, "StringUtil.java"));
|
||||
}
|
||||
|
||||
// google-api-client doesn't use the OpenAPI auth, because it uses Google Credential directly (HttpRequestInitializer)
|
||||
if (!(GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || NATIVE.equals(getLibrary()))) {
|
||||
if (!(GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || NATIVE.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) {
|
||||
supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.mustache", authFolder, "HttpBasicAuth.java"));
|
||||
supportingFiles.add(new SupportingFile("auth/HttpBearerAuth.mustache", authFolder, "HttpBearerAuth.java"));
|
||||
supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));
|
||||
@ -303,13 +318,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
apiDocTemplateFiles.remove("api_doc.mustache");
|
||||
}
|
||||
|
||||
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || WEBCLIENT.equals(getLibrary()))) {
|
||||
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || WEBCLIENT.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) {
|
||||
supportingFiles.add(new SupportingFile("apiException.mustache", invokerFolder, "ApiException.java"));
|
||||
supportingFiles.add(new SupportingFile("Configuration.mustache", invokerFolder, "Configuration.java"));
|
||||
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
|
||||
}
|
||||
|
||||
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || NATIVE.equals(getLibrary()))) {
|
||||
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || NATIVE.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) {
|
||||
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
|
||||
}
|
||||
|
||||
@ -380,9 +395,19 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
||||
supportingFiles.add(new SupportingFile("GsonObjectMapper.mustache", invokerFolder, "GsonObjectMapper.java"));
|
||||
}
|
||||
supportingFiles.add(new SupportingFile("Oper.mustache", apiFolder, "Oper.java"));
|
||||
additionalProperties.put("convert", new CaseFormatLambda(LOWER_CAMEL, UPPER_UNDERSCORE));
|
||||
apiTemplateFiles.put("api.mustache", ".java");
|
||||
supportingFiles.add(new SupportingFile("ResponseSpecBuilders.mustache", invokerFolder, "ResponseSpecBuilders.java"));
|
||||
} else if (MICROPROFILE.equals(getLibrary())) {
|
||||
supportingFiles.clear(); // Don't need extra files provided by Java Codegen
|
||||
String apiExceptionFolder = (sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar);
|
||||
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
supportingFiles.add(new SupportingFile("api_exception.mustache", apiExceptionFolder, "ApiException.java"));
|
||||
supportingFiles.add(new SupportingFile("api_exception_mapper.mustache", apiExceptionFolder, "ApiExceptionMapper.java"));
|
||||
importMapping.put("LocalDate", "org.joda.time.LocalDate");
|
||||
serializationLibrary = "none";
|
||||
} else {
|
||||
LOGGER.error("Unknown library option (-l/--library): " + getLibrary());
|
||||
}
|
||||
@ -541,11 +566,15 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
|
||||
// google-api-client doesn't use the OpenAPI auth, because it uses Google Credential directly (HttpRequestInitializer)
|
||||
if ((!(GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || usePlayWS || NATIVE.equals(getLibrary()))) && ProcessUtils.hasOAuthMethods(objs)) {
|
||||
if ((!(GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || usePlayWS || NATIVE.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) && ProcessUtils.hasOAuthMethods(objs)) {
|
||||
supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java"));
|
||||
supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authFolder, "OAuthFlow.java"));
|
||||
}
|
||||
|
||||
if (MICROPROFILE.equals(getLibrary())) {
|
||||
objs = AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs);
|
||||
}
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
@ -635,6 +664,23 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
model.imports.add("JsonCreator");
|
||||
}
|
||||
}
|
||||
if (MICROPROFILE.equals(getLibrary())) {
|
||||
model.imports.remove("ApiModelProperty");
|
||||
model.imports.remove("ApiModel");
|
||||
model.imports.remove("JsonSerialize");
|
||||
model.imports.remove("ToStringSerializer");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public CodegenModel fromModel(String name, Schema model) {
|
||||
CodegenModel codegenModel = super.fromModel(name, model);
|
||||
if (MICROPROFILE.equals(getLibrary())) {
|
||||
if (codegenModel.imports.contains("ApiModel")) {
|
||||
// Remove io.swagger.annotations.ApiModel import
|
||||
codegenModel.imports.remove("ApiModel");
|
||||
}
|
||||
}
|
||||
return codegenModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,8 +57,10 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
public static final String LENIENT_TYPE_CAST = "lenientTypeCast";
|
||||
protected static final String LIBRARY_PROMISE_KIT = "PromiseKit";
|
||||
protected static final String LIBRARY_RX_SWIFT = "RxSwift";
|
||||
protected static final String[] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT};
|
||||
protected static final String LIBRARY_RESULT = "Result";
|
||||
protected static final String[] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT, LIBRARY_RESULT};
|
||||
protected String projectName = "OpenAPIClient";
|
||||
protected boolean nonPublicApi = false;
|
||||
protected boolean unwrapRequired;
|
||||
protected boolean objcCompatible = false;
|
||||
protected boolean lenientTypeCast = false;
|
||||
@ -208,6 +210,9 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
"Optionally use libraries to manage response. Currently "
|
||||
+ StringUtils.join(RESPONSE_LIBRARIES, ", ")
|
||||
+ " are available."));
|
||||
cliOptions.add(new CliOption(CodegenConstants.NON_PUBLIC_API,
|
||||
CodegenConstants.NON_PUBLIC_API_DESC
|
||||
+ "(default: false)"));
|
||||
cliOptions.add(new CliOption(UNWRAP_REQUIRED,
|
||||
"Treat 'required' properties in response as non-optional "
|
||||
+ "(which would crash the app if api returns null as opposed "
|
||||
@ -329,6 +334,14 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
sourceFolder = projectName + File.separator + sourceFolder;
|
||||
|
||||
// Setup nonPublicApi option, which generates code with reduced access
|
||||
// modifiers; allows embedding elsewhere without exposing non-public API calls
|
||||
// to consumers
|
||||
if (additionalProperties.containsKey(CodegenConstants.NON_PUBLIC_API)) {
|
||||
setNonPublicApi(convertPropertyToBooleanAndWriteBack(CodegenConstants.NON_PUBLIC_API));
|
||||
}
|
||||
additionalProperties.put(CodegenConstants.NON_PUBLIC_API, nonPublicApi);
|
||||
|
||||
// Setup unwrapRequired option, which makes all the
|
||||
// properties with "required" non-optional
|
||||
if (additionalProperties.containsKey(UNWRAP_REQUIRED)) {
|
||||
@ -364,6 +377,9 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
if (ArrayUtils.contains(responseAs, LIBRARY_RX_SWIFT)) {
|
||||
additionalProperties.put("useRxSwift", true);
|
||||
}
|
||||
if (ArrayUtils.contains(responseAs, LIBRARY_RESULT)) {
|
||||
additionalProperties.put("useResult", true);
|
||||
}
|
||||
|
||||
// Setup swiftUseApiNamespace option, which makes all the API
|
||||
// classes inner-class of {{projectName}}API
|
||||
@ -417,6 +433,11 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache",
|
||||
sourceFolder,
|
||||
"JSONEncodingHelper.swift"));
|
||||
if (ArrayUtils.contains(responseAs, LIBRARY_RESULT)) {
|
||||
supportingFiles.add(new SupportingFile("Result.mustache",
|
||||
sourceFolder,
|
||||
"Result.swift"));
|
||||
}
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache",
|
||||
"",
|
||||
"git_push.sh"));
|
||||
@ -555,7 +576,11 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
public String toDefaultValue(Schema p) {
|
||||
if (p.getEnum() != null && !p.getEnum().isEmpty()) {
|
||||
if (p.getDefault() != null) {
|
||||
return "." + escapeText((String) p.getDefault());
|
||||
if (ModelUtils.isStringSchema(p)) {
|
||||
return "." + toEnumVarName(escapeText((String) p.getDefault()), p.getType());
|
||||
} else {
|
||||
return "." + toEnumVarName(escapeText(p.getDefault().toString()), p.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) {
|
||||
@ -714,6 +739,10 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setNonPublicApi(boolean nonPublicApi) {
|
||||
this.nonPublicApi = nonPublicApi;
|
||||
}
|
||||
|
||||
public void setUnwrapRequired(boolean unwrapRequired) {
|
||||
this.unwrapRequired = unwrapRequired;
|
||||
}
|
||||
|
@ -18,8 +18,10 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
@ -299,4 +301,14 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
|
||||
String name = filename.substring((modelPackage() + File.separator).length());
|
||||
return camelize(name);
|
||||
}
|
||||
@Override
|
||||
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
||||
super.addAdditionPropertiesToCodeGenModel(codegenModel, schema);
|
||||
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
||||
codegenModel.additionalPropertiesType = getSchemaType(additionalProperties);
|
||||
if ("array".equalsIgnoreCase(codegenModel.additionalPropertiesType)) {
|
||||
codegenModel.additionalPropertiesType += '<' + getSchemaType(((ArraySchema) additionalProperties).getItems()) + '>';
|
||||
}
|
||||
addImport(codegenModel, codegenModel.additionalPropertiesType);
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@ -54,7 +55,6 @@ public class ModelUtils {
|
||||
return Boolean.parseBoolean(GlobalSettings.getProperty(generateAliasAsModelKey, "false"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Searches for the model by name in the map of models and returns it
|
||||
*
|
||||
@ -117,7 +117,18 @@ public class ModelUtils {
|
||||
* @return schemas a list of unused schemas
|
||||
*/
|
||||
public static List<String> getUnusedSchemas(OpenAPI openAPI) {
|
||||
Map<String, List<String>> childrenMap = getChildrenMap(openAPI);
|
||||
final Map<String, List<String>> childrenMap;
|
||||
Map<String, List<String>> tmpChildrenMap;
|
||||
try {
|
||||
tmpChildrenMap = getChildrenMap(openAPI);
|
||||
} catch (NullPointerException npe) {
|
||||
// in rare cases, such as a spec document with only one top-level oneOf schema and multiple referenced schemas,
|
||||
// the stream used in getChildrenMap will raise an NPE. Rather than modify getChildrenMap which is used by getAllUsedSchemas,
|
||||
// we'll catch here as a workaround for this edge case.
|
||||
tmpChildrenMap = new HashMap<>();
|
||||
}
|
||||
|
||||
childrenMap = tmpChildrenMap;
|
||||
List<String> unusedSchemas = new ArrayList<String>();
|
||||
|
||||
Map<String, Schema> schemas = getSchemas(openAPI);
|
||||
@ -875,6 +886,7 @@ public class ModelUtils {
|
||||
public static Map<String, List<String>> getChildrenMap(OpenAPI openAPI) {
|
||||
Map<String, Schema> allSchemas = getSchemas(openAPI);
|
||||
|
||||
// FIXME: The collect here will throw NPE if a spec document has only a single oneOf hierarchy.
|
||||
Map<String, List<Entry<String, Schema>>> groupedByParent = allSchemas.entrySet().stream()
|
||||
.filter(entry -> isComposedSchema(entry.getValue()))
|
||||
.collect(Collectors.groupingBy(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas)));
|
||||
|
@ -50,7 +50,7 @@ void apiClient_free(apiClient_t *apiClient) {
|
||||
}
|
||||
{{/isOAuth}}
|
||||
{{#isApiKey}}
|
||||
if(apiClient->accessToken) {
|
||||
if(apiClient->apiKeys) {
|
||||
list_free(apiClient->apiKeys);
|
||||
}
|
||||
{{/isApiKey}}
|
||||
|
@ -74,17 +74,17 @@ return 0;
|
||||
{{^isContainer}}
|
||||
{{^isModel}}
|
||||
{{#isEnum}}
|
||||
char* {{baseName}}{{classname}}_ToString({{baseName}}_e {{baseName}}){
|
||||
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
return {{baseName}}Array[{{baseName}}];
|
||||
char* {{name}}{{classname}}_ToString({{name}}_e {{name}}){
|
||||
char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
return {{name}}Array[{{name}}];
|
||||
}
|
||||
|
||||
{{baseName}}_e {{baseName}}{{classname}}_FromString(char* {{baseName}}){
|
||||
{{name}}_e {{name}}{{classname}}_FromString(char* {{name}}){
|
||||
int stringToReturn = 0;
|
||||
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
size_t sizeofArray = sizeof({{baseName}}Array) / sizeof({{baseName}}Array[0]);
|
||||
char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]);
|
||||
while(stringToReturn < sizeofArray) {
|
||||
if(strcmp({{baseName}}, {{baseName}}Array[stringToReturn]) == 0) {
|
||||
if(strcmp({{name}}, {{name}}Array[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
@ -98,17 +98,17 @@ return 0;
|
||||
{{#items}}
|
||||
{{^isModel}}
|
||||
{{#isEnum}}
|
||||
char* {{baseName}}{{classname}}_ToString({{baseName}}_e {{baseName}}){
|
||||
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
return {{baseName}}Array[{{baseName}} - 1];
|
||||
char* {{name}}{{classname}}_ToString({{name}}_e {{name}}){
|
||||
char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
return {{name}}Array[{{name}} - 1];
|
||||
}
|
||||
|
||||
{{baseName}}_e {{baseName}}{{classname}}_FromString(char* {{baseName}}){
|
||||
{{name}}_e {{name}}{{classname}}_FromString(char* {{name}}){
|
||||
int stringToReturn = 0;
|
||||
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
size_t sizeofArray = sizeof({{baseName}}Array) / sizeof({{baseName}}Array[0]);
|
||||
char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
|
||||
size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]);
|
||||
while(stringToReturn < sizeofArray) {
|
||||
if(strcmp({{baseName}}, {{baseName}}Array[stringToReturn]) == 0) {
|
||||
if(strcmp({{name}}, {{name}}Array[stringToReturn]) == 0) {
|
||||
return stringToReturn + 1;
|
||||
}
|
||||
stringToReturn++;
|
||||
@ -127,64 +127,64 @@ return 0;
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{datatype}}_e {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{baseName}}_e {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isMapContainer}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
@ -194,7 +194,7 @@ return 0;
|
||||
return NULL;
|
||||
}
|
||||
{{#vars}}
|
||||
{{classname}}_local_var->{{{baseName}}} = {{{baseName}}};
|
||||
{{classname}}_local_var->{{{name}}} = {{{name}}};
|
||||
{{/vars}}
|
||||
|
||||
return {{classname}}_local_var;
|
||||
@ -208,58 +208,58 @@ void {{classname}}_free({{classname}}_t *{{classname}}) {
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{^isEnum}}
|
||||
{{{complexType}}}_free({{{classname}}}->{{{baseName}}});
|
||||
{{{complexType}}}_free({{{classname}}}->{{{name}}});
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
free({{{classname}}}->{{{baseName}}});
|
||||
free({{{classname}}}->{{{name}}});
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
free({{{classname}}}->{{{baseName}}});
|
||||
free({{{classname}}}->{{{name}}});
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
object_free({{{classname}}}->{{{baseName}}});
|
||||
object_free({{{classname}}}->{{{name}}});
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
free({{{classname}}}->{{{baseName}}});
|
||||
free({{{classname}}}->{{{name}}});
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isBinary}}
|
||||
free({{{classname}}}->{{{baseName}}}->data);
|
||||
free({{{classname}}}->{{{name}}}->data);
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
free({{{classname}}}->{{{baseName}}});
|
||||
free({{{classname}}}->{{{name}}});
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
free({{{classname}}}->{{{baseName}}});
|
||||
free({{{classname}}}->{{{name}}});
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
list_ForEach(listEntry, {{classname}}->{{baseName}}) {
|
||||
list_ForEach(listEntry, {{classname}}->{{name}}) {
|
||||
free(listEntry->data);
|
||||
}
|
||||
list_free({{classname}}->{{baseName}});
|
||||
list_free({{classname}}->{{name}});
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
list_ForEach(listEntry, {{classname}}->{{baseName}}) {
|
||||
list_ForEach(listEntry, {{classname}}->{{name}}) {
|
||||
{{complexType}}_free(listEntry->data);
|
||||
}
|
||||
list_free({{classname}}->{{baseName}});
|
||||
list_free({{classname}}->{{name}});
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
list_ForEach(listEntry, {{classname}}->{{baseName}}) {
|
||||
keyValuePair_t *localMapKeyPair = (keyValuePair_t*) listEntry->data;
|
||||
list_ForEach(listEntry, {{classname}}->{{name}}) {
|
||||
keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data;
|
||||
free (localKeyValue->key);
|
||||
free (localKeyValue->value);
|
||||
}
|
||||
list_free({{classname}}->{{baseName}});
|
||||
list_free({{classname}}->{{name}});
|
||||
{{/isMapContainer}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
@ -270,30 +270,30 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
|
||||
cJSON *item = cJSON_CreateObject();
|
||||
{{#vars}}
|
||||
|
||||
// {{{classname}}}->{{{baseName}}}
|
||||
// {{{classname}}}->{{{name}}}
|
||||
{{#required}}
|
||||
{{^isEnum}}
|
||||
if (!{{{classname}}}->{{{baseName}}}) {
|
||||
if (!{{{classname}}}->{{{name}}}) {
|
||||
goto fail;
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{/required}}
|
||||
{{^required}}{{^isEnum}}if({{{classname}}}->{{{baseName}}}) { {{/isEnum}}{{/required}}
|
||||
{{^required}}{{^isEnum}}if({{{classname}}}->{{{name}}}) { {{/isEnum}}{{/required}}
|
||||
{{^isContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
if(cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddNumberToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //Numeric
|
||||
}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
if(cJSON_AddBoolToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddBoolToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //Bool
|
||||
}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{baseName}}}{{classname}}_ToString({{{classname}}}->{{{baseName}}})) == NULL)
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", {{{name}}}{{classname}}_ToString({{{classname}}}->{{{name}}})) == NULL)
|
||||
{
|
||||
goto fail; //Enum
|
||||
}
|
||||
@ -301,30 +301,30 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //String
|
||||
}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
if(cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddNumberToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //Byte
|
||||
}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
char* encoded_str_{{{baseName}}} = base64encode({{{classname}}}->{{{baseName}}}->data,{{{classname}}}->{{{baseName}}}->len);
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", encoded_str_{{{baseName}}}) == NULL) {
|
||||
char* encoded_str_{{{name}}} = base64encode({{{classname}}}->{{{name}}}->data,{{{classname}}}->{{{name}}}->len);
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", encoded_str_{{{name}}}) == NULL) {
|
||||
goto fail; //Binary
|
||||
}
|
||||
free (encoded_str_{{{baseName}}});
|
||||
free (encoded_str_{{{name}}});
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //Date
|
||||
}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //Date-Time
|
||||
}
|
||||
{{/isDateTime}}
|
||||
@ -332,42 +332,42 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
cJSON *{{{baseName}}}_enum_local_JSON = {{datatypeWithEnum}}_convertToJSON({{{classname}}}->{{{baseName}}});
|
||||
if({{{baseName}}}_enum_local_JSON == NULL) {
|
||||
cJSON *{{{name}}}_enum_local_JSON = {{datatypeWithEnum}}_convertToJSON({{{classname}}}->{{{name}}});
|
||||
if({{{name}}}_enum_local_JSON == NULL) {
|
||||
goto fail; // enum
|
||||
}
|
||||
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{baseName}}}_enum_local_JSON);
|
||||
cJSON_AddItemToObject(item, "{{{name}}}", {{{name}}}_enum_local_JSON);
|
||||
if(item->child == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
cJSON *{{{baseName}}}_local_JSON = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_convertToJSON({{{classname}}}->{{{baseName}}});
|
||||
if({{{baseName}}}_local_JSON == NULL) {
|
||||
cJSON *{{{name}}}_local_JSON = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_convertToJSON({{{classname}}}->{{{name}}});
|
||||
if({{{name}}}_local_JSON == NULL) {
|
||||
goto fail; //model
|
||||
}
|
||||
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{baseName}}}_local_JSON);
|
||||
cJSON_AddItemToObject(item, "{{{name}}}", {{{name}}}_local_JSON);
|
||||
if(item->child == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //uuid
|
||||
}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) {
|
||||
if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
|
||||
goto fail; //Email
|
||||
}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
cJSON *{{{baseName}}}_object = object_convertToJSON({{{classname}}}->{{{baseName}}});
|
||||
if({{{baseName}}}_object == NULL) {
|
||||
cJSON *{{{name}}}_object = object_convertToJSON({{{classname}}}->{{{name}}});
|
||||
if({{{name}}}_object == NULL) {
|
||||
goto fail; //model
|
||||
}
|
||||
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{baseName}}}_object);
|
||||
cJSON_AddItemToObject(item, "{{{name}}}", {{{name}}}_object);
|
||||
if(item->child == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
@ -377,22 +377,22 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}");
|
||||
cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{name}}}");
|
||||
if({{{name}}} == NULL) {
|
||||
goto fail; //primitive container
|
||||
}
|
||||
|
||||
listEntry_t *{{{name}}}ListEntry;
|
||||
list_ForEach({{{name}}}ListEntry, {{{classname}}}->{{{baseName}}}) {
|
||||
list_ForEach({{{name}}}ListEntry, {{{classname}}}->{{{name}}}) {
|
||||
{{#items}}
|
||||
{{#isString}}
|
||||
if(cJSON_AddStringToObject({{{baseName}}}, "", (char*){{{baseName}}}ListEntry->data) == NULL)
|
||||
if(cJSON_AddStringToObject({{{name}}}, "", (char*){{{name}}}ListEntry->data) == NULL)
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
if(cJSON_AddNumberToObject({{{baseName}}}, "", *(double *){{{baseName}}}ListEntry->data) == NULL)
|
||||
if(cJSON_AddNumberToObject({{{name}}}, "", *(double *){{{name}}}ListEntry->data) == NULL)
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
@ -401,33 +401,33 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
cJSON *{{{baseName}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}");
|
||||
if({{{baseName}}} == NULL) {
|
||||
cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{name}}}");
|
||||
if({{{name}}} == NULL) {
|
||||
goto fail; //nonprimitive container
|
||||
}
|
||||
|
||||
listEntry_t *{{{baseName}}}ListEntry;
|
||||
if ({{{classname}}}->{{{baseName}}}) {
|
||||
list_ForEach({{{baseName}}}ListEntry, {{classname}}->{{{baseName}}}) {
|
||||
cJSON *itemLocal = {{complexType}}_convertToJSON({{#isEnum}}{{#items}}({{datatypeWithEnum}}_e){{/items}}{{/isEnum}}{{{baseName}}}ListEntry->data);
|
||||
listEntry_t *{{{name}}}ListEntry;
|
||||
if ({{{classname}}}->{{{name}}}) {
|
||||
list_ForEach({{{name}}}ListEntry, {{classname}}->{{{name}}}) {
|
||||
cJSON *itemLocal = {{complexType}}_convertToJSON({{#isEnum}}{{#items}}({{datatypeWithEnum}}_e){{/items}}{{/isEnum}}{{{name}}}ListEntry->data);
|
||||
if(itemLocal == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
cJSON_AddItemToArray({{{baseName}}}, itemLocal);
|
||||
cJSON_AddItemToArray({{{name}}}, itemLocal);
|
||||
}
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
cJSON *{{{baseName}}} = cJSON_AddObjectToObject(item, "{{{baseName}}}");
|
||||
if({{{baseName}}} == NULL) {
|
||||
cJSON *{{{name}}} = cJSON_AddObjectToObject(item, "{{{name}}}");
|
||||
if({{{name}}} == NULL) {
|
||||
goto fail; //primitive map container
|
||||
}
|
||||
cJSON *localMapObject = cJSON_CreateObject(); //Memory free to be implemented in user code
|
||||
listEntry_t *{{{baseName}}}ListEntry;
|
||||
if ({{{classname}}}->{{{baseName}}}) {
|
||||
list_ForEach({{{baseName}}}ListEntry, {{{classname}}}->{{{baseName}}}) {
|
||||
keyValuePair_t *localKeyValue = (keyValuePair_t*){{{baseName}}}ListEntry->data;
|
||||
listEntry_t *{{{name}}}ListEntry;
|
||||
if ({{{classname}}}->{{{name}}}) {
|
||||
list_ForEach({{{name}}}ListEntry, {{{classname}}}->{{{name}}}) {
|
||||
keyValuePair_t *localKeyValue = (keyValuePair_t*){{{name}}}ListEntry->data;
|
||||
{{#items}}
|
||||
{{#isString}}
|
||||
if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL)
|
||||
@ -442,7 +442,7 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
|
||||
}
|
||||
{{/isString}}
|
||||
{{/items}}
|
||||
cJSON_AddItemToObject({{{baseName}}},"", localMapObject);
|
||||
cJSON_AddItemToObject({{{name}}},"", localMapObject);
|
||||
}
|
||||
}
|
||||
{{/isMapContainer}}
|
||||
@ -465,10 +465,10 @@ fail:
|
||||
{{classname}}_t *{{classname}}_local_var = NULL;
|
||||
|
||||
{{#vars}}
|
||||
// {{{classname}}}->{{{baseName}}}
|
||||
cJSON *{{{baseName}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}");
|
||||
// {{{classname}}}->{{{name}}}
|
||||
cJSON *{{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{name}}}");
|
||||
{{#required}}
|
||||
if (!{{{baseName}}}) {
|
||||
if (!{{{name}}}) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
@ -476,71 +476,71 @@ fail:
|
||||
{{^isContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsNumber({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsNumber({{{name}}}))
|
||||
{
|
||||
goto end; //Numeric
|
||||
}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsBool({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsBool({{{name}}}))
|
||||
{
|
||||
goto end; //Bool
|
||||
}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{{baseName}}}_e {{baseName}}Variable;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
{{{name}}}_e {{name}}Variable;
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //Enum
|
||||
}
|
||||
{{baseName}}Variable = {{baseName}}{{classname}}_FromString({{{baseName}}}->valuestring);
|
||||
{{name}}Variable = {{name}}{{classname}}_FromString({{{name}}}->valuestring);
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //String
|
||||
}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsNumber({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsNumber({{{name}}}))
|
||||
{
|
||||
goto end; //Byte
|
||||
}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
binary_t* decoded_str_{{{baseName}}};
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
binary_t* decoded_str_{{{name}}};
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //Binary
|
||||
}
|
||||
char* decoded = base64decode({{{baseName}}}->valuestring, strlen({{{baseName}}}->valuestring));
|
||||
decoded_str_{{{baseName}}}->data = malloc(strlen(decoded) - 1);
|
||||
if (!decoded_str_{{{baseName}}}->data) {
|
||||
char* decoded = base64decode({{{name}}}->valuestring, strlen({{{name}}}->valuestring));
|
||||
decoded_str_{{{name}}}->data = malloc(strlen(decoded) - 1);
|
||||
if (!decoded_str_{{{name}}}->data) {
|
||||
goto end;
|
||||
}
|
||||
memcpy(decoded_str_{{{baseName}}}->data,decoded,(strlen(decoded)-1));
|
||||
decoded_str_{{{baseName}}}->len = strlen(decoded) - 1;
|
||||
memcpy(decoded_str_{{{name}}}->data,decoded,(strlen(decoded)-1));
|
||||
decoded_str_{{{name}}}->len = strlen(decoded) - 1;
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //Date
|
||||
}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //DateTime
|
||||
}
|
||||
@ -549,34 +549,34 @@ fail:
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{datatypeWithEnum}}_e {{baseName}}_local_nonprim_enum;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
{{{baseName}}}_local_nonprim_enum = {{datatypeWithEnum}}_parseFromJSON({{{baseName}}}); //enum model
|
||||
{{datatypeWithEnum}}_e {{name}}_local_nonprim_enum;
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
{{{name}}}_local_nonprim_enum = {{datatypeWithEnum}}_parseFromJSON({{{name}}}); //enum model
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{baseName}}_local_nonprim = NULL;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
{{{baseName}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{baseName}}}); //nonprimitive
|
||||
{{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL;
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
{{{name}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}}); //nonprimitive
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //uuid
|
||||
}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{baseName}}}))
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if(!cJSON_IsString({{{name}}}))
|
||||
{
|
||||
goto end; //email
|
||||
}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
object_t *{{baseName}}_local_object = NULL;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
{{{baseName}}}_local_object = object_parseFromJSON({{{baseName}}}); //object
|
||||
object_t *{{name}}_local_object = NULL;
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
{{{name}}}_local_object = object_parseFromJSON({{{name}}}); //object
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
@ -584,64 +584,64 @@ fail:
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
list_t *{{{name}}}List;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
cJSON *{{{name}}}_local;
|
||||
if(!cJSON_IsArray({{{baseName}}})) {
|
||||
if(!cJSON_IsArray({{{name}}})) {
|
||||
goto end;//primitive container
|
||||
}
|
||||
{{{name}}}List = list_create();
|
||||
|
||||
cJSON_ArrayForEach({{{name}}}_local, {{{baseName}}})
|
||||
cJSON_ArrayForEach({{{name}}}_local, {{{name}}})
|
||||
{
|
||||
{{#items}}
|
||||
{{#isString}}
|
||||
if(!cJSON_IsString({{{baseName}}}_local))
|
||||
if(!cJSON_IsString({{{name}}}_local))
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
list_addElement({{{baseName}}}List , strdup({{{baseName}}}_local->valuestring));
|
||||
list_addElement({{{name}}}List , strdup({{{name}}}_local->valuestring));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
if(!cJSON_IsNumber({{{baseName}}}_local))
|
||||
if(!cJSON_IsNumber({{{name}}}_local))
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
list_addElement({{{baseName}}}List , &{{{baseName}}}_local->valuedouble);
|
||||
list_addElement({{{name}}}List , &{{{name}}}_local->valuedouble);
|
||||
{{/isString}}
|
||||
{{/items}}
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
list_t *{{{baseName}}}List;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
cJSON *{{{baseName}}}_local_nonprimitive;
|
||||
if(!cJSON_IsArray({{{baseName}}})){
|
||||
list_t *{{{name}}}List;
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
cJSON *{{{name}}}_local_nonprimitive;
|
||||
if(!cJSON_IsArray({{{name}}})){
|
||||
goto end; //nonprimitive container
|
||||
}
|
||||
|
||||
{{{baseName}}}List = list_create();
|
||||
{{{name}}}List = list_create();
|
||||
|
||||
cJSON_ArrayForEach({{{baseName}}}_local_nonprimitive,{{{baseName}}} )
|
||||
cJSON_ArrayForEach({{{name}}}_local_nonprimitive,{{{name}}} )
|
||||
{
|
||||
if(!cJSON_IsObject({{{baseName}}}_local_nonprimitive)){
|
||||
if(!cJSON_IsObject({{{name}}}_local_nonprimitive)){
|
||||
goto end;
|
||||
}
|
||||
{{#isEnum}}{{#items}}{{datatypeWithEnum}}_e {{/items}}{{/isEnum}}{{^isEnum}}{{complexType}}_t *{{/isEnum}}{{{baseName}}}Item = {{complexType}}_parseFromJSON({{{baseName}}}_local_nonprimitive);
|
||||
{{#isEnum}}{{#items}}{{datatypeWithEnum}}_e {{/items}}{{/isEnum}}{{^isEnum}}{{complexType}}_t *{{/isEnum}}{{{name}}}Item = {{complexType}}_parseFromJSON({{{name}}}_local_nonprimitive);
|
||||
|
||||
list_addElement({{{baseName}}}List, {{#isEnum}}{{#items}}(void *){{/items}}{{/isEnum}}{{{baseName}}}Item);
|
||||
list_addElement({{{name}}}List, {{#isEnum}}{{#items}}(void *){{/items}}{{/isEnum}}{{{name}}}Item);
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
list_t *{{{complexType}}}List;
|
||||
{{^required}}if ({{{baseName}}}) { {{/required}}
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
cJSON *{{{complexType}}}_local_map;
|
||||
if(!cJSON_IsObject({{{baseName}}})) {
|
||||
if(!cJSON_IsObject({{{name}}})) {
|
||||
goto end;//primitive map container
|
||||
}
|
||||
{{{complexType}}}List = list_create();
|
||||
keyValuePair_t *localMapKeyPair;
|
||||
cJSON_ArrayForEach({{{complexType}}}_local_map, {{{baseName}}})
|
||||
cJSON_ArrayForEach({{{complexType}}}_local_map, {{{name}}})
|
||||
{
|
||||
{{#isString}}
|
||||
if(!cJSON_IsString({{{complexType}}}_local_map))
|
||||
@ -674,64 +674,64 @@ fail:
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}_local_nonprim_enum{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim_enum{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}_local_nonprim{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{baseName}}Variable{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}decoded_str_{{{baseName}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{{^required}}{{{baseName}}} ? {{/required}}{{{complexType}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{complexType}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isMapContainer}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
|
@ -36,12 +36,12 @@ cJSON *{{classname}}_convertToJSON({{classname}}_e {{classname}});
|
||||
{{^isModel}}
|
||||
{{#isEnum}}
|
||||
{{#allowableValues}}
|
||||
typedef enum { {{#enumVars}} {{{value}}}{{#first}} = 0{{/first}}{{^-last}},{{/-last}}{{/enumVars}} } {{baseName}}_e;
|
||||
typedef enum { {{#enumVars}} {{{value}}}{{#first}} = 0{{/first}}{{^-last}},{{/-last}}{{/enumVars}} } {{name}}_e;
|
||||
{{/allowableValues}}
|
||||
|
||||
char* {{baseName}}_ToString({{baseName}}_e {{baseName}});
|
||||
char* {{name}}_ToString({{name}}_e {{name}});
|
||||
|
||||
{{baseName}}_e {{baseName}}_FromString(char* {{baseName}});
|
||||
{{name}}_e {{name}}_FromString(char* {{name}});
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{/isContainer}}
|
||||
@ -50,12 +50,12 @@ cJSON *{{classname}}_convertToJSON({{classname}}_e {{classname}});
|
||||
{{^isModel}}
|
||||
{{#isEnum}}
|
||||
{{#allowableValues}}
|
||||
typedef enum { {{#enumVars}} {{{value}}}{{^-last}},{{/-last}}{{/enumVars}} } {{baseName}}_e;
|
||||
typedef enum { {{#enumVars}} {{{value}}}{{^-last}},{{/-last}}{{/enumVars}} } {{name}}_e;
|
||||
{{/allowableValues}}
|
||||
|
||||
char* {{baseName}}_ToString({{baseName}}_e {{baseName}});
|
||||
char* {{name}}_ToString({{name}}_e {{name}});
|
||||
|
||||
{{baseName}}_e {{baseName}}_FromString(char* {{baseName}});
|
||||
{{name}}_e {{name}}_FromString(char* {{name}});
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{/items}}
|
||||
@ -69,64 +69,64 @@ typedef struct {{classname}}_t {
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{datatype}}_e {{baseName}}; //enum model
|
||||
{{datatype}}_e {{name}}; //enum model
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{datatype}}_t *{{baseName}}; //model
|
||||
{{datatype}}_t *{{name}}; //model
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{datatype}} *{{baseName}}; // uuid
|
||||
{{datatype}} *{{name}}; // uuid
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{datatype}} *{{baseName}}; // email
|
||||
{{datatype}} *{{name}}; // email
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{datatype}}_t *{{baseName}}; //object
|
||||
{{datatype}}_t *{{name}}; //object
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{datatype}} {{baseName}}; //numeric
|
||||
{{datatype}} {{name}}; //numeric
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{datatype}} {{baseName}}; //boolean
|
||||
{{datatype}} {{name}}; //boolean
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{baseName}}_e {{baseName}}; //enum
|
||||
{{name}}_e {{name}}; //enum
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{datatype}} *{{baseName}}; // string
|
||||
{{datatype}} *{{name}}; // string
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{datatype}} {{baseName}}; //Byte
|
||||
{{datatype}} {{name}}; //Byte
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{datatype}} {{baseName}}; //binary
|
||||
{{datatype}} {{name}}; //binary
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{datatype}} *{{baseName}}; //date
|
||||
{{datatype}} *{{name}}; //date
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{datatype}} *{{baseName}}; //date time
|
||||
{{datatype}} *{{name}}; //date time
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
{{datatype}}_t *{{baseName}}; //primitive container
|
||||
{{datatype}}_t *{{name}}; //primitive container
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{datatype}}_t *{{baseName}}; //nonprimitive container
|
||||
{{datatype}}_t *{{name}}; //nonprimitive container
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{{datatype}} {{baseName}}; //map
|
||||
{{datatype}} {{name}}; //map
|
||||
{{/isMapContainer}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
@ -139,64 +139,64 @@ typedef struct {{classname}}_t {
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{datatype}}_e {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{baseName}}_e {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isListContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isMapContainer}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
|
2
modules/openapi-generator/src/main/resources/Java/additionalModelTypeAnnotations.mustache
vendored
Normal file
2
modules/openapi-generator/src/main/resources/Java/additionalModelTypeAnnotations.mustache
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
{{#additionalModelTypeAnnotations}}{{.}}
|
||||
{{/additionalModelTypeAnnotations}}
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# https://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.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
@ -138,19 +154,19 @@ if $cygwin ; then
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@ -159,14 +175,9 @@ save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
10
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache
vendored
Normal file
10
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
# {{appName}} - MicroProfile Rest Client
|
||||
|
||||
{{#appDescription}}
|
||||
{{{appDescription}}}
|
||||
|
||||
{{/appDescription}}
|
||||
## Overview
|
||||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
|
||||
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
|
||||
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.
|
61
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache
vendored
Normal file
61
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{{>licenseInfo}}
|
||||
package {{package}};
|
||||
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
{{^disableMultipart}}
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
{{/disableMultipart}}
|
||||
|
||||
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
|
||||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||
|
||||
{{#appName}}
|
||||
/**
|
||||
* {{{appName}}}
|
||||
*
|
||||
{{#appDescription}}
|
||||
* <p>{{{appDescription}}}
|
||||
*
|
||||
{{/appDescription}}
|
||||
*/
|
||||
{{/appName}}
|
||||
|
||||
@RegisterRestClient
|
||||
@RegisterProvider(ApiExceptionMapper.class)
|
||||
@Path("{{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}")
|
||||
public interface {{classname}} {
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
|
||||
{{#summary}}
|
||||
/**
|
||||
* {{summary}}
|
||||
*
|
||||
{{#notes}}
|
||||
* {{notes}}
|
||||
*
|
||||
{{/notes}}
|
||||
*/
|
||||
{{/summary}}
|
||||
@{{httpMethod}}
|
||||
{{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}}
|
||||
{{#hasConsumes}}
|
||||
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} })
|
||||
{{/hasConsumes}}
|
||||
{{#hasProduces}}
|
||||
@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} })
|
||||
{{/hasProduces}}
|
||||
public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException, ProcessingException;
|
||||
{{/operation}}
|
||||
}
|
||||
{{/operations}}
|
||||
|
23
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_exception.mustache
vendored
Normal file
23
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_exception.mustache
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
{{>licenseInfo}}
|
||||
package {{apiPackage}};
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
public class ApiException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Response response;
|
||||
|
||||
public ApiException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ApiException(Response response) {
|
||||
super("Api response has status code " + response.getStatus());
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
public Response getResponse() {
|
||||
return this.response;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
{{>licenseInfo}}
|
||||
package {{apiPackage}};
|
||||
|
||||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
|
||||
|
||||
@Provider
|
||||
public class ApiExceptionMapper
|
||||
implements ResponseExceptionMapper<ApiException> {
|
||||
|
||||
@Override
|
||||
public boolean handles(int status, MultivaluedMap<String, Object> headers) {
|
||||
return status >= 400;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiException toThrowable(Response response) {
|
||||
return new ApiException(response);
|
||||
}
|
||||
}
|
75
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache
vendored
Normal file
75
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
{{>licenseInfo}}
|
||||
|
||||
package {{package}};
|
||||
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.eclipse.microprofile.rest.client.RestClientBuilder;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.MalformedURLException;
|
||||
{{^fullJavaUtil}}
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
{{/fullJavaUtil}}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
{{#appName}}
|
||||
* {{{appName}}} Test
|
||||
*
|
||||
{{/appName}}
|
||||
* API tests for {{classname}}
|
||||
*/
|
||||
{{#generateSpringBootApplication}}
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = SpringBootApplication.class)
|
||||
@WebAppConfiguration
|
||||
@IntegrationTest("server.port=0")
|
||||
{{/generateSpringBootApplication}}
|
||||
public class {{classname}}Test {
|
||||
|
||||
private {{classname}} client;
|
||||
private String baseUrl = "http://localhost:9080";
|
||||
|
||||
@Before
|
||||
public void setup() throws MalformedURLException {
|
||||
client = RestClientBuilder.newBuilder()
|
||||
.baseUrl(new URL(baseUrl))
|
||||
.register(ApiException.class)
|
||||
.build({{classname}}.class);
|
||||
}
|
||||
|
||||
{{#operations}}{{#operation}}
|
||||
/**
|
||||
{{#summary}}
|
||||
* {{summary}}
|
||||
*
|
||||
{{#notes}}
|
||||
* {{notes}}
|
||||
*
|
||||
{{/notes}}
|
||||
{{/summary}}
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void {{operationId}}Test() {
|
||||
// TODO: test validations
|
||||
{{#allParams}}
|
||||
{{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}}
|
||||
{{/allParams}}
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
//{{#returnType}}assertNotNull(response);{{/returnType}}
|
||||
|
||||
|
||||
}
|
||||
{{/operation}}{{/operations}}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{{#required}}
|
||||
@NotNull
|
||||
{{/required}}
|
||||
{{>beanValidationCore}}
|
@ -0,0 +1,20 @@
|
||||
{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{!
|
||||
minLength && maxLength set
|
||||
}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{!
|
||||
minLength set, maxLength not
|
||||
}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{!
|
||||
minLength not set, maxLength set
|
||||
}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{!
|
||||
@Size: minItems && maxItems set
|
||||
}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{!
|
||||
@Size: minItems set, maxItems not
|
||||
}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{!
|
||||
@Size: minItems not set && maxItems set
|
||||
}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{!
|
||||
check for integer or long / all others=decimal type with @Decimal*
|
||||
isInteger set
|
||||
}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{!
|
||||
isLong set
|
||||
}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{!
|
||||
Not Integer, not Long => we have a decimal value!
|
||||
}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}}
|
@ -0,0 +1 @@
|
||||
{{#required}} @NotNull{{/required}}{{>beanValidationCore}}
|
@ -0,0 +1 @@
|
||||
{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}}
|
@ -0,0 +1 @@
|
||||
{{#required}} @NotNull{{/required}}{{>beanValidationCore}}
|
1
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/bodyParams.mustache
vendored
Normal file
1
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/bodyParams.mustache
vendored
Normal file
@ -0,0 +1 @@
|
||||
{{#isBodyParam}}{{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{dataType}}} {{paramName}}{{/isBodyParam}}
|
@ -0,0 +1 @@
|
||||
{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}
|
33
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache
vendored
Normal file
33
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
@XmlType(name="{{datatypeWithEnum}}")
|
||||
@XmlEnum({{dataType}}.class)
|
||||
public enum {{datatypeWithEnum}} {
|
||||
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
|
||||
|
||||
private {{dataType}} value;
|
||||
|
||||
{{datatypeWithEnum}} ({{dataType}} v) {
|
||||
value = v;
|
||||
}
|
||||
|
||||
public {{dataType}} value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static {{datatypeWithEnum}} fromValue(String v) {
|
||||
for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
|
||||
if (String.valueOf(b.value).equals(v)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
{{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + v + "'");{{/useNullForUnknownEnumValue}}
|
||||
}
|
||||
}
|
48
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache
vendored
Normal file
48
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{{#jackson}}
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
{{/jackson}}
|
||||
|
||||
/**
|
||||
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
|
||||
*/
|
||||
public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
|
||||
{{#gson}}
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
|
||||
{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
{{/gson}}
|
||||
{{^gson}}
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
{{/gson}}
|
||||
|
||||
private {{{dataType}}} value;
|
||||
|
||||
{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
{{#jackson}}
|
||||
@JsonValue
|
||||
{{/jackson}}
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
{{#jackson}}
|
||||
@JsonCreator
|
||||
{{/jackson}}
|
||||
public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {
|
||||
for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
{{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}}
|
||||
}
|
||||
|
||||
}
|
1
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/formParams.mustache
vendored
Normal file
1
modules/openapi-generator/src/main/resources/Java/libraries/microprofile/formParams.mustache
vendored
Normal file
@ -0,0 +1 @@
|
||||
{{#isFormParam}}{{^isFile}}@Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}} @Multipart(value = "{{baseName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}}
|
@ -0,0 +1 @@
|
||||
{{#isFormParam}}{{^isFile}}{{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}} Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user