Merge remote-tracking branch 'origin/4.3.x' into 5.0.x

This commit is contained in:
William Cheng 2019-12-12 17:27:49 +08:00
commit 466a67c9bc
1220 changed files with 44302 additions and 10652 deletions

View File

@ -62,7 +62,7 @@ before_install:
- gem install bundler - gem install bundler
- npm install -g typescript - npm install -g typescript
- npm install -g npm - 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/ - npm config set registry http://registry.npmjs.org/
# set python 3.6.3 as default # set python 3.6.3 as default
- source ~/virtualenv/python3.6/bin/activate - source ~/virtualenv/python3.6/bin/activate

View File

@ -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 - Go: https://github.com/golang/go/wiki/CodeReviewComments
- ObjC: https://github.com/NYTimes/objective-c-style-guide - ObjC: https://github.com/NYTimes/objective-c-style-guide
- Perl: http://perldoc.perl.org/perlstyle.html - 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 - PowerShell: https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx
- Python: https://www.python.org/dev/peps/pep-0008/ - Python: https://www.python.org/dev/peps/pep-0008/
- R: https://google.github.io/styleguide/Rguide.xml - R: https://google.github.io/styleguide/Rguide.xml

View File

@ -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. # 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/ 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"] ENTRYPOINT ["docker-entrypoint.sh"]

View File

@ -2,23 +2,26 @@
<div align="center"> <div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.2-SNAPSHOT`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.3-SNAPSHOT`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/master)](https://cloud.drone.io/OpenAPITools/openapi-generator) [![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/master)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![iOS Build Status](https://app.bitrise.io/app/4a2b10a819d12b67/status.svg?token=859FMDR8QHwabCzwvZK6vQ&branch=master)](https://app.bitrise.io/app/4a2b10a819d12b67)
[`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/4.3.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/4.3.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/4.3.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/4.3.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=4.3.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=4.3.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=4.3.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=4.3.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/4.3.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) [![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/4.3.x)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![iOS Build Status](https://app.bitrise.io/app/4a2b10a819d12b67/status.svg?token=859FMDR8QHwabCzwvZK6vQ&branch=4.3.x)](https://app.bitrise.io/app/4a2b10a819d12b67)
[`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.0.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.0.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=5.0.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=5.0.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=5.0.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=5.0.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/5.0.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) [![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/5.0.x)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![iOS Build Status](https://app.bitrise.io/app/4a2b10a819d12b67/status.svg?token=859FMDR8QHwabCzwvZK6vQ&branch=5.0.x)](https://app.bitrise.io/app/4a2b10a819d12b67)
</div> </div>
<div align="center"> <div align="center">
@ -53,6 +56,8 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
[![NamSor](https://openapi-generator.tech/img/companies/namsor.png)](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [![NamSor](https://openapi-generator.tech/img/companies/namsor.png)](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
[![LightBow](https://openapi-generator.tech/img/companies/lightbow.png)](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [![LightBow](https://openapi-generator.tech/img/companies/lightbow.png)](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 #### 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 | | | 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) **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** **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**
**Configuration files** | [**Apache2**](https://httpd.apache.org/) **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) 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.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.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.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.1) (latest stable release) | 15.11.2019 | 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 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 --> <!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.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: For **Mac/Linux** users:
```sh ```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. 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. 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`) (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
<!-- RELEASE_VERSION --> <!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.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 --> <!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@ -577,13 +582,15 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Camptocamp](https://www.camptocamp.com/en) - [Camptocamp](https://www.camptocamp.com/en)
- [codecentric AG](https://www.codecentric.de/) - [codecentric AG](https://www.codecentric.de/)
- [Commencis](https://www.commencis.com/) - [Commencis](https://www.commencis.com/)
- [Crossover Health](https://crossoverhealth.com/)
- [Cupix](https://www.cupix.com/) - [Cupix](https://www.cupix.com/)
- [DB Systel](https://www.dbsystel.de) - [DB Systel](https://www.dbsystel.de)
- [DocSpring](https://docspring.com/)
- [dwango](https://dwango.co.jp/) - [dwango](https://dwango.co.jp/)
- [Edge Impulse](https://www.edgeimpulse.com/) - [Edge Impulse](https://www.edgeimpulse.com/)
- [Element AI](https://www.elementai.com/) - [Element AI](https://www.elementai.com/)
- [Embotics](https://www.embotics.com/)
- [Fenergo](https://www.fenergo.com/) - [Fenergo](https://www.fenergo.com/)
- [FormAPI](https://formapi.io/)
- [FreshCells](https://www.freshcells.de/) - [FreshCells](https://www.freshcells.de/)
- [Fuse](https://www.fuse.no/) - [Fuse](https://www.fuse.no/)
- [Gantner](https://www.gantner.com) - [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) - [JustStar](https://www.juststarinfo.com)
- [Klarna](https://www.klarna.com/) - [Klarna](https://www.klarna.com/)
- [Kronsoft Development](https://www.kronsoft.ro/home/) - [Kronsoft Development](https://www.kronsoft.ro/home/)
- [Linode](https://www.linode.com/)
- [Médiavision](https://www.mediavision.fr/) - [Médiavision](https://www.mediavision.fr/)
- [Metaswitch](https://www.metaswitch.com/) - [Metaswitch](https://www.metaswitch.com/)
- [Myworkout](https://myworkout.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) - [RedHat](https://www.redhat.com)
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development) - [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
- [REST United](https://restunited.com) - [REST United](https://restunited.com)
- [Sony Interactive Entertainment](https://www.sie.com/en/index.html)
- [Stingray](http://www.stingray.com) - [Stingray](http://www.stingray.com)
- [Suva](https://www.suva.ch/) - [Suva](https://www.suva.ch/)
- [Telstra](https://dev.telstra.com) - [Telstra](https://dev.telstra.com)
@ -621,6 +630,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [WSO2](https://wso2.com/) - [WSO2](https://wso2.com/)
- [Vouchery.io](https://vouchery.io) - [Vouchery.io](https://vouchery.io)
- [Xero](https://www.xero.com/) - [Xero](https://www.xero.com/)
- [Yahoo Japan](https://www.yahoo.co.jp/)
- [Yelp](https://www.yelp.com/) - [Yelp](https://www.yelp.com/)
- [Zalando](https://www.zalando.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-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 - [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-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 APIs](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 - [AngularNestJSOpenAPISwaggerでマイクロサービスを視野に入れた環境を考える](https://qiita.com/teracy55/items/0327c7a170ec772970c6) by [てらしー](https://twitter.com/teracy55)
## [6 - About Us](#table-of-contents) ## [6 - About Us](#table-of-contents)
@ -784,6 +802,7 @@ Here is a list of template creators:
* TypeScript (Node): @mhardorf * TypeScript (Node): @mhardorf
* TypeScript (Rxjs): @denyo * TypeScript (Rxjs): @denyo
* TypeScript (Inversify): @gualtierim * TypeScript (Inversify): @gualtierim
* TypeSCript (redux-query): @petejohansonxo
* Server Stubs * Server Stubs
* Ada: @stcarrez * Ada: @stcarrez
* C# ASP.NET 5: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * 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) | | Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) | | 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) | | 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) | | 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) | | 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 :heart: = Link to support the contributor directly

View 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"
}

View File

@ -7,6 +7,7 @@
./bin/java-petstore-jersey1.sh ./bin/java-petstore-jersey1.sh
./bin/java-petstore-jersey2-java6.sh ./bin/java-petstore-jersey2-java6.sh
./bin/java-petstore-jersey2.sh ./bin/java-petstore-jersey2.sh
./bin/java-petstore-microprofile.sh
./bin/java-petstore-native.sh ./bin/java-petstore-native.sh
./bin/java-petstore-okhttp-gson-parcelable.sh ./bin/java-petstore-okhttp-gson-parcelable.sh
./bin/java-petstore-okhttp-gson.sh ./bin/java-petstore-okhttp-gson.sh

View File

@ -27,7 +27,7 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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" echo "Removing files and folders under samples/client/petstore/java/feign/src/main"
rm -rf samples/client/petstore/java/feign/src/main rm -rf samples/client/petstore/java/feign/src/main

View 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

View File

@ -2,3 +2,4 @@
./bin/kotlin-springboot-petstore-server.sh ./bin/kotlin-springboot-petstore-server.sh
./bin/kotlin-springboot-petstore-server-reactive.sh ./bin/kotlin-springboot-petstore-server-reactive.sh
./bin/kotlin-springboot-petstore-server-model-mutable.sh

View 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

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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} java ${JAVA_OPTS} -jar ${executable} ${ags}

View 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

View 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%

View File

@ -2,6 +2,8 @@
./bin/swift4-petstore.sh ./bin/swift4-petstore.sh
./bin/swift4-petstore-promisekit.sh ./bin/swift4-petstore-promisekit.sh
./bin/swift4-petstore-result.sh
./bin/swift4-petstore-rxswift.sh ./bin/swift4-petstore-rxswift.sh
./bin/swift4-petstore-objcCompatible.sh ./bin/swift4-petstore-objcCompatible.sh
./bin/swift4-petstore-unwrapRequired.sh ./bin/swift4-petstore-unwrapRequired.sh
./bin/swift4-petstore-nonPublicApi.sh

View File

@ -0,0 +1,7 @@
{
"podSummary": "PetstoreClient",
"podHomepage": "https://github.com/openapitools/openapi-generator",
"podAuthors": "",
"projectName": "PetstoreClient",
"nonPublicApi": true
}

View 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

View 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
View 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

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M 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% java %JAVA_OPTS% -jar %executable% %ags%

View 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%

View File

@ -7,6 +7,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M 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% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -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 - Go: https://github.com/golang/go/wiki/CodeReviewComments
- ObjC: https://github.com/NYTimes/objective-c-style-guide - ObjC: https://github.com/NYTimes/objective-c-style-guide
- Perl: http://perldoc.perl.org/perlstyle.html - 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 - PowerShell: https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx
- Python: https://www.python.org/dev/peps/pep-0008/ - Python: https://www.python.org/dev/peps/pep-0008/
- R: https://google.github.io/styleguide/Rguide.xml - R: https://google.github.io/styleguide/Rguide.xml

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |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| |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| |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| |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| |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|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -15,6 +15,7 @@ sidebar_label: kotlin-server
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null| |parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null| |serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null|
|modelMutable|Create mutable models| |false|
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dl>|ktor| |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| |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| |featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|

View File

@ -15,6 +15,7 @@ sidebar_label: kotlin-spring
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null| |parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null| |serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null|
|modelMutable|Create mutable models| |false|
|title|server title name or client service name| |OpenAPI Kotlin Spring| |title|server title name or client service name| |OpenAPI Kotlin Spring|
|basePackage|base package (invokerPackage) for generated code| |org.openapitools| |basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|serverPort|configuration the port in which the sever is to run on| |8080| |serverPort|configuration the port in which the sever is to run on| |8080|

View File

@ -15,3 +15,4 @@ sidebar_label: kotlin-vertx
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null| |parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null| |serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null|
|modelMutable|Create mutable models| |false|

View File

@ -15,6 +15,7 @@ sidebar_label: kotlin
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null| |parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |null| |serializableModel|boolean - toggle &quot;implements Serializable&quot; 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| |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| |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| |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|

View File

@ -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| |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| |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get| |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| |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| |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| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

View File

@ -10,7 +10,8 @@ sidebar_label: swift4
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|projectName|Project name in Xcode| |null| |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| |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| |objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|podSource|Source information used for Podspec| |null| |podSource|Source information used for Podspec| |null|

View File

@ -22,11 +22,14 @@ import io.airlift.airline.Option;
import io.swagger.parser.OpenAPIParser; import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI; 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 io.swagger.v3.parser.core.models.SwaggerParseResult;
import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ModelUtils;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
@Command(name = "validate", description = "Validate specification") @Command(name = "validate", description = "Validate specification")
@ -58,6 +61,21 @@ public class Validate implements Runnable {
if (unusedModels != null) { if (unusedModels != null) {
unusedModels.forEach(name -> warnings.add("Unused model: " + name)); 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);
}
}
}
});
} }
} }

View File

@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate
[source,group] [source,group]
---- ----
plugins { plugins {
id "org.openapi.generator" version "4.2.2-SNAPSHOT" id "org.openapi.generator" version "4.2.3-SNAPSHOT"
} }
---- ----

View File

@ -18,5 +18,5 @@ gradle generateGoWithInvalidSpec
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash ```bash
gradle -PopenApiGeneratorVersion=4.2.2-SNAPSHOT openApiValidate gradle -PopenApiGeneratorVersion=4.2.3-SNAPSHOT openApiValidate
``` ```

View File

@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId> <artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION --> <!-- RELEASE_VERSION -->
<version>4.2.2-SNAPSHOT</version> <version>4.2.3-SNAPSHOT</version>
<!-- /RELEASE_VERSION --> <!-- /RELEASE_VERSION -->
<executions> <executions>
<execution> <execution>

View File

@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId> <artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION --> <!-- RELEASE_VERSION -->
<version>4.2.2-SNAPSHOT</version> <version>4.2.3-SNAPSHOT</version>
<!-- /RELEASE_VERSION --> <!-- /RELEASE_VERSION -->
<executions> <executions>
<execution> <execution>

View File

@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId> <artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION --> <!-- RELEASE_VERSION -->
<version>4.2.2-SNAPSHOT</version> <version>4.2.3-SNAPSHOT</version>
<!-- /RELEASE_VERSION --> <!-- /RELEASE_VERSION -->
<executions> <executions>
<execution> <execution>

View File

@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId> <artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION --> <!-- RELEASE_VERSION -->
<version>4.2.2-SNAPSHOT</version> <version>4.2.3-SNAPSHOT</version>
<!-- /RELEASE_VERSION --> <!-- /RELEASE_VERSION -->
<executions> <executions>
<execution> <execution>

View File

@ -200,7 +200,7 @@
<generex-version>1.0.2</generex-version> <generex-version>1.0.2</generex-version>
<jackson-version>2.9.10</jackson-version> <jackson-version>2.9.10</jackson-version>
<jackson-threetenbp-version>2.9.10</jackson-threetenbp-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> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -301,7 +301,7 @@
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>
<version>3.1.0</version> <version>3.2.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -347,6 +347,11 @@
<version>${kotlin-version}</version> <version>${kotlin-version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.5.0</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>
<repository> <repository>

View File

@ -30,12 +30,12 @@ public class ClientOptInput {
private List<AuthorizationValue> auths; private List<AuthorizationValue> auths;
public ClientOptInput openAPI(OpenAPI openAPI) { public ClientOptInput openAPI(OpenAPI openAPI) {
this.openAPI = openAPI; this.setOpenAPI(openAPI);
return this; return this;
} }
public ClientOptInput config(CodegenConfig codegenConfig) { public ClientOptInput config(CodegenConfig codegenConfig) {
this.config = codegenConfig; this.setConfig(codegenConfig);
return this; return this;
} }
@ -72,6 +72,10 @@ public class ClientOptInput {
@Deprecated @Deprecated
public void setConfig(CodegenConfig config) { public void setConfig(CodegenConfig config) {
this.config = config; this.config = config;
// TODO: ClientOptInputs needs to be retired
if (this.openAPI != null) {
this.config.setOpenAPI(this.openAPI);
}
} }
@Deprecated @Deprecated
@ -86,5 +90,9 @@ public class ClientOptInput {
@Deprecated @Deprecated
public void setOpenAPI(OpenAPI openAPI) { public void setOpenAPI(OpenAPI openAPI) {
this.openAPI = openAPI; this.openAPI = openAPI;
// TODO: ClientOptInputs needs to be retired
if (this.config != null) {
this.config.setOpenAPI(this.openAPI);
}
} }
} }

View File

@ -44,6 +44,7 @@ public class CodegenCallback {
public int hashCode() { public int hashCode() {
return Objects.hash(expression, hasMore, requests, vendorExtensions); return Objects.hash(expression, hasMore, requests, vendorExtensions);
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -64,10 +65,12 @@ public class CodegenCallback {
return Objects.equals(that.name, name) && Objects.equals(that.hasMore, hasMore) && return Objects.equals(that.name, name) && Objects.equals(that.hasMore, hasMore) &&
Objects.equals(that.urls, urls) && Objects.equals(that.vendorExtensions, vendorExtensions); Objects.equals(that.urls, urls) && Objects.equals(that.vendorExtensions, vendorExtensions);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, hasMore, urls, vendorExtensions); return Objects.hash(name, hasMore, urls, vendorExtensions);
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -77,4 +80,6 @@ public class CodegenCallback {
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }
} }

View File

@ -91,21 +91,25 @@ public class CodegenDiscriminator {
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CodegenDiscriminator that = (CodegenDiscriminator) o; CodegenDiscriminator that = (CodegenDiscriminator) o;
return Objects.equals(propertyName, that.propertyName) && return Objects.equals(propertyName, that.propertyName) &&
Objects.equals(propertyBaseName, that.propertyBaseName) &&
Objects.equals(mapping, that.mapping) && Objects.equals(mapping, that.mapping) &&
Objects.equals(mappedModels, that.mappedModels); Objects.equals(mappedModels, that.mappedModels);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(propertyName, mapping, mappedModels);
return Objects.hash(propertyName, propertyBaseName, mapping, mappedModels);
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this) final StringBuffer sb = new StringBuffer("CodegenDiscriminator{");
.append("propertyName", propertyName) sb.append("propertyName='").append(propertyName).append('\'');
.append("mapping", mapping) sb.append(", propertyBaseName='").append(propertyBaseName).append('\'');
.append("mappedModels", mappedModels) sb.append(", mapping=").append(mapping);
.toString(); sb.append(", mappedModels=").append(mappedModels);
sb.append('}');
return sb.toString();
} }
} }

View File

@ -70,157 +70,6 @@ public class CodegenModel {
//The type of the value from additional properties. Used in map like objects. //The type of the value from additional properties. Used in map like objects.
public String additionalPropertiesType; 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() { public String getParent() {
return parent; 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();
}
} }

View File

@ -244,34 +244,106 @@ public class CodegenOperation {
@Override @Override
public String toString() { 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 @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CodegenOperation that = (CodegenOperation) o; CodegenOperation that = (CodegenOperation) o;
return hasAuthMethods == that.hasAuthMethods &&
return Objects.equals(responseHeaders, that.responseHeaders) && hasConsumes == that.hasConsumes &&
Objects.equals(hasAuthMethods, that.hasAuthMethods) && hasProduces == that.hasProduces &&
Objects.equals(hasConsumes, that.hasConsumes) && hasParams == that.hasParams &&
Objects.equals(hasProduces, that.hasProduces) && hasOptionalParams == that.hasOptionalParams &&
Objects.equals(hasParams, that.hasParams) && hasRequiredParams == that.hasRequiredParams &&
Objects.equals(hasOptionalParams, that.hasOptionalParams) && returnTypeIsPrimitive == that.returnTypeIsPrimitive &&
Objects.equals(returnTypeIsPrimitive, that.returnTypeIsPrimitive) && returnSimpleType == that.returnSimpleType &&
Objects.equals(returnSimpleType, that.returnSimpleType) && subresourceOperation == that.subresourceOperation &&
Objects.equals(subresourceOperation, that.subresourceOperation) && isMapContainer == that.isMapContainer &&
Objects.equals(isMapContainer, that.isMapContainer) && isListContainer == that.isListContainer &&
Objects.equals(isListContainer, that.isListContainer) && isMultipart == that.isMultipart &&
Objects.equals(isMultipart, that.isMultipart) && hasMore == that.hasMore &&
Objects.equals(hasMore, that.hasMore) && isResponseBinary == that.isResponseBinary &&
Objects.equals(isResponseBinary, that.isResponseBinary) && isResponseFile == that.isResponseFile &&
Objects.equals(hasReference, that.hasReference) && hasReference == that.hasReference &&
Objects.equals(isResponseFile, that.isResponseFile) && isRestfulIndex == that.isRestfulIndex &&
Objects.equals(isDeprecated, that.isDeprecated) && isRestfulShow == that.isRestfulShow &&
Objects.equals(isCallbackRequest, that.isCallbackRequest) && 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(path, that.path) &&
Objects.equals(operationId, that.operationId) && Objects.equals(operationId, that.operationId) &&
Objects.equals(returnType, that.returnType) && Objects.equals(returnType, that.returnType) &&
@ -286,6 +358,7 @@ public class CodegenOperation {
Objects.equals(discriminator, that.discriminator) && Objects.equals(discriminator, that.discriminator) &&
Objects.equals(consumes, that.consumes) && Objects.equals(consumes, that.consumes) &&
Objects.equals(produces, that.produces) && Objects.equals(produces, that.produces) &&
Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) &&
Objects.equals(servers, that.servers) && Objects.equals(servers, that.servers) &&
Objects.equals(bodyParam, that.bodyParam) && Objects.equals(bodyParam, that.bodyParam) &&
Objects.equals(allParams, that.allParams) && Objects.equals(allParams, that.allParams) &&
@ -303,75 +376,28 @@ public class CodegenOperation {
Objects.equals(callbacks, that.callbacks) && Objects.equals(callbacks, that.callbacks) &&
Objects.equals(imports, that.imports) && Objects.equals(imports, that.imports) &&
Objects.equals(examples, that.examples) && Objects.equals(examples, that.examples) &&
Objects.equals(requestBodyExamples, that.requestBodyExamples) &&
Objects.equals(externalDocs, that.externalDocs) && Objects.equals(externalDocs, that.externalDocs) &&
Objects.equals(vendorExtensions, that.vendorExtensions) && Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(nickname, that.nickname) && Objects.equals(nickname, that.nickname) &&
Objects.equals(prioritizedContentTypes, that.prioritizedContentTypes) &&
Objects.equals(operationIdOriginal, that.operationIdOriginal) && Objects.equals(operationIdOriginal, that.operationIdOriginal) &&
Objects.equals(operationIdLowerCase, that.operationIdLowerCase) && Objects.equals(operationIdLowerCase, that.operationIdLowerCase) &&
Objects.equals(operationIdCamelCase, that.operationIdCamelCase); Objects.equals(operationIdCamelCase, that.operationIdCamelCase) &&
Objects.equals(operationIdSnakeCase, that.operationIdSnakeCase);
} }
@Override @Override
public int hashCode() { 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);
}
} }

View File

@ -43,6 +43,167 @@ public class CodegenParameter {
public CodegenProperty mostInnerItems; public CodegenProperty mostInnerItems;
public Map<String, Object> vendorExtensions = new HashMap<String, Object>(); public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
public boolean hasValidation; 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; public boolean isNullable;
/** /**
@ -174,223 +335,10 @@ public class CodegenParameter {
output.isListContainer = this.isListContainer; output.isListContainer = this.isListContainer;
output.isMapContainer = this.isMapContainer; output.isMapContainer = this.isMapContainer;
output.isExplode = this.isExplode; output.isExplode = this.isExplode;
output.style = this.style;
return output; 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 +
'}';
}
} }

View File

@ -62,6 +62,7 @@ public class CodegenProperty implements Cloneable {
public boolean isWriteOnly; public boolean isWriteOnly;
public boolean isNullable; public boolean isNullable;
public boolean isSelfReference; public boolean isSelfReference;
public boolean isCircularReference;
public List<String> _enum; public List<String> _enum;
public Map<String, Object> allowableValues; public Map<String, Object> allowableValues;
public CodegenProperty items; public CodegenProperty items;
@ -410,170 +411,6 @@ public class CodegenProperty implements Cloneable {
this.xmlNamespace = xmlNamespace; 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 @Override
public CodegenProperty clone() { public CodegenProperty clone() {
try { try {
@ -600,86 +437,188 @@ public class CodegenProperty implements Cloneable {
} }
} }
@java.lang.Override
public java.lang.String toString() { @Override
return "CodegenProperty{" + public String toString() {
"baseName='" + baseName + '\'' + final StringBuffer sb = new StringBuffer("CodegenProperty{");
", openApiType='" + openApiType + '\'' + sb.append("openApiType='").append(openApiType).append('\'');
", complexType='" + complexType + '\'' + sb.append(", baseName='").append(baseName).append('\'');
", getter='" + getter + '\'' + sb.append(", complexType='").append(complexType).append('\'');
", setter='" + setter + '\'' + sb.append(", getter='").append(getter).append('\'');
", description='" + description + '\'' + sb.append(", setter='").append(setter).append('\'');
", datatype='" + dataType + '\'' + sb.append(", description='").append(description).append('\'');
", datatypeWithEnum='" + datatypeWithEnum + '\'' + sb.append(", dataType='").append(dataType).append('\'');
", dataFormat='" + dataFormat + '\'' + sb.append(", datatypeWithEnum='").append(datatypeWithEnum).append('\'');
", name='" + name + '\'' + sb.append(", dataFormat='").append(dataFormat).append('\'');
", min='" + min + '\'' + sb.append(", name='").append(name).append('\'');
", max='" + max + '\'' + sb.append(", min='").append(min).append('\'');
", defaultValue='" + defaultValue + '\'' + sb.append(", max='").append(max).append('\'');
", defaultValueWithParam='" + defaultValueWithParam + '\'' + sb.append(", defaultValue='").append(defaultValue).append('\'');
", baseType='" + baseType + '\'' + sb.append(", defaultValueWithParam='").append(defaultValueWithParam).append('\'');
", containerType='" + containerType + '\'' + sb.append(", baseType='").append(baseType).append('\'');
", title='" + title + '\'' + sb.append(", containerType='").append(containerType).append('\'');
", unescapedDescription='" + unescapedDescription + '\'' + sb.append(", title='").append(title).append('\'');
", maxLength=" + maxLength + sb.append(", unescapedDescription='").append(unescapedDescription).append('\'');
", minLength=" + minLength + sb.append(", maxLength=").append(maxLength);
", pattern='" + pattern + '\'' + sb.append(", minLength=").append(minLength);
", example='" + example + '\'' + sb.append(", pattern='").append(pattern).append('\'');
", jsonSchema='" + jsonSchema + '\'' + sb.append(", example='").append(example).append('\'');
", minimum='" + minimum + '\'' + sb.append(", jsonSchema='").append(jsonSchema).append('\'');
", maximum='" + maximum + '\'' + sb.append(", minimum='").append(minimum).append('\'');
", exclusiveMinimum=" + exclusiveMinimum + sb.append(", maximum='").append(maximum).append('\'');
", exclusiveMaximum=" + exclusiveMaximum + sb.append(", exclusiveMinimum=").append(exclusiveMinimum);
", hasMore=" + hasMore + sb.append(", exclusiveMaximum=").append(exclusiveMaximum);
", required=" + required + sb.append(", hasMore=").append(hasMore);
", secondaryParam=" + secondaryParam + sb.append(", required=").append(required);
", hasMoreNonReadOnly=" + hasMoreNonReadOnly + sb.append(", secondaryParam=").append(secondaryParam);
", isPrimitiveType=" + isPrimitiveType + sb.append(", hasMoreNonReadOnly=").append(hasMoreNonReadOnly);
", isModel=" + isModel + sb.append(", isPrimitiveType=").append(isPrimitiveType);
", isContainer=" + isContainer + sb.append(", isModel=").append(isModel);
", isString=" + isString + sb.append(", isContainer=").append(isContainer);
", isNumeric=" + isNumeric + sb.append(", isString=").append(isString);
", isInteger=" + isInteger + sb.append(", isNumeric=").append(isNumeric);
", isLong=" + isLong + sb.append(", isInteger=").append(isInteger);
", isNumber=" + isNumber + sb.append(", isLong=").append(isLong);
", isFloat=" + isFloat + sb.append(", isNumber=").append(isNumber);
", isDouble=" + isDouble + sb.append(", isFloat=").append(isFloat);
", isByteArray=" + isByteArray + sb.append(", isDouble=").append(isDouble);
", isBinary=" + isBinary + sb.append(", isByteArray=").append(isByteArray);
", isFile=" + isFile + sb.append(", isBinary=").append(isBinary);
", isBoolean=" + isBoolean + sb.append(", isFile=").append(isFile);
", isDate=" + isDate + sb.append(", isBoolean=").append(isBoolean);
", isDateTime=" + isDateTime + sb.append(", isDate=").append(isDate);
", isUuid=" + isUuid + sb.append(", isDateTime=").append(isDateTime);
", isUri=" + isUri + sb.append(", isUuid=").append(isUuid);
", isEmail=" + isEmail + sb.append(", isUri=").append(isUri);
", isFreeFormObject=" + isFreeFormObject + sb.append(", isEmail=").append(isEmail);
", isListContainer=" + isListContainer + sb.append(", isFreeFormObject=").append(isFreeFormObject);
", isMapContainer=" + isMapContainer + sb.append(", isListContainer=").append(isListContainer);
", isEnum=" + isEnum + sb.append(", isMapContainer=").append(isMapContainer);
", isReadOnly=" + isReadOnly + sb.append(", isEnum=").append(isEnum);
", isWriteOnly=" + isWriteOnly + sb.append(", isReadOnly=").append(isReadOnly);
", isNullable=" + isNullable + sb.append(", isWriteOnly=").append(isWriteOnly);
", isSelfReference=" + isSelfReference + sb.append(", isNullable=").append(isNullable);
", _enum=" + _enum + sb.append(", isSelfReference=").append(isSelfReference);
", allowableValues=" + allowableValues + sb.append(", isCircularReference=").append(isCircularReference);
", items=" + items + sb.append(", _enum=").append(_enum);
", mostInnerItems=" + mostInnerItems + sb.append(", allowableValues=").append(allowableValues);
", vendorExtensions=" + vendorExtensions + sb.append(", items=").append(items);
", hasValidation=" + hasValidation + sb.append(", mostInnerItems=").append(mostInnerItems);
", isInherited=" + isInherited + sb.append(", vendorExtensions=").append(vendorExtensions);
", discriminatorValue='" + discriminatorValue + '\'' + sb.append(", hasValidation=").append(hasValidation);
", nameInCamelCase='" + nameInCamelCase + '\'' + sb.append(", isInherited=").append(isInherited);
", enumName='" + enumName + '\'' + sb.append(", discriminatorValue='").append(discriminatorValue).append('\'');
", maxItems=" + maxItems + sb.append(", nameInCamelCase='").append(nameInCamelCase).append('\'');
", minItems=" + minItems + sb.append(", nameInSnakeCase='").append(nameInSnakeCase).append('\'');
", isXmlAttribute=" + isXmlAttribute + sb.append(", enumName='").append(enumName).append('\'');
", xmlPrefix='" + xmlPrefix + '\'' + sb.append(", maxItems=").append(maxItems);
", xmlName='" + xmlName + '\'' + sb.append(", minItems=").append(minItems);
", xmlNamespace='" + xmlNamespace + '\'' + sb.append(", isXmlAttribute=").append(isXmlAttribute);
", isXmlWrapped=" + isXmlWrapped + 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);
}
} }

View File

@ -24,7 +24,7 @@ public class CodegenResponse {
public String code, message; public String code, message;
public boolean hasMore; public boolean hasMore;
public List<Map<String, Object>> examples; public List<Map<String, Object>> examples;
public String dataType, baseType, containerType; public String dataType, baseType, containerType, pattern;
public boolean hasHeaders; public boolean hasHeaders;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate, public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate,
isDateTime, isUuid, isEmail, isModel, isFreeFormObject; isDateTime, isUuid, isEmail, isModel, isFreeFormObject;
@ -43,50 +43,10 @@ public class CodegenResponse {
return "0".equals(code) || "default".equals(code); 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 @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (!(o instanceof CodegenResponse)) return false;
CodegenResponse that = (CodegenResponse) o; CodegenResponse that = (CodegenResponse) o;
return hasMore == that.hasMore && return hasMore == that.hasMore &&
hasHeaders == that.hasHeaders && hasHeaders == that.hasHeaders &&
@ -103,8 +63,8 @@ public class CodegenResponse {
isDateTime == that.isDateTime && isDateTime == that.isDateTime &&
isUuid == that.isUuid && isUuid == that.isUuid &&
isEmail == that.isEmail && isEmail == that.isEmail &&
isFreeFormObject == that.isFreeFormObject &&
isModel == that.isModel && isModel == that.isModel &&
isFreeFormObject == that.isFreeFormObject &&
isDefault == that.isDefault && isDefault == that.isDefault &&
simpleType == that.simpleType && simpleType == that.simpleType &&
primitiveType == that.primitiveType && primitiveType == that.primitiveType &&
@ -119,6 +79,7 @@ public class CodegenResponse {
Objects.equals(dataType, that.dataType) && Objects.equals(dataType, that.dataType) &&
Objects.equals(baseType, that.baseType) && Objects.equals(baseType, that.baseType) &&
Objects.equals(containerType, that.containerType) && Objects.equals(containerType, that.containerType) &&
Objects.equals(pattern, that.pattern) &&
Objects.equals(schema, that.schema) && Objects.equals(schema, that.schema) &&
Objects.equals(jsonSchema, that.jsonSchema) && Objects.equals(jsonSchema, that.jsonSchema) &&
Objects.equals(vendorExtensions, that.vendorExtensions); Objects.equals(vendorExtensions, that.vendorExtensions);
@ -126,9 +87,51 @@ public class CodegenResponse {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, hasHeaders, return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, pattern,
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate, hasHeaders, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray,
isDateTime, isUuid, isEmail, isFreeFormObject, isModel, isDefault, simpleType, primitiveType, isMapContainer, isBoolean, isDate, isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isDefault, simpleType,
isListContainer, isBinary, isFile, schema, jsonSchema, vendorExtensions); 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();
} }
} }

View File

@ -41,67 +41,6 @@ public class CodegenSecurity {
public List<Map<String, Object>> scopes; public List<Map<String, Object>> scopes;
public Boolean isCode, isPassword, isApplication, isImplicit; 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. // Return a copy of the security object, filtering out any scopes from the passed-in list.
public CodegenSecurity filterByScopeNames(List<String> filterScopes) { public CodegenSecurity filterByScopeNames(List<String> filterScopes) {
CodegenSecurity filteredSecurity = new CodegenSecurity(); CodegenSecurity filteredSecurity = new CodegenSecurity();
@ -144,4 +83,72 @@ public class CodegenSecurity {
return filteredSecurity; 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();
}
} }

View File

@ -1,9 +1,36 @@
package org.openapitools.codegen; package org.openapitools.codegen;
import java.util.List; import java.util.List;
import java.util.Objects;
public class CodegenServer { public class CodegenServer {
public String url; public String url;
public String description; public String description;
public List<CodegenServerVariable> variables; 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();
}
} }

View File

@ -1,6 +1,7 @@
package org.openapitools.codegen; package org.openapitools.codegen;
import java.util.List; import java.util.List;
import java.util.Objects;
public class CodegenServerVariable { public class CodegenServerVariable {
public String name; public String name;
@ -8,4 +9,34 @@ public class CodegenServerVariable {
public String description; public String description;
public List<String> enumValues; public List<String> enumValues;
public String value; 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();
}
} }

View File

@ -328,10 +328,61 @@ public class DefaultCodegen implements CodegenConfig {
} }
} }
} }
setCircularReferences(allModels);
return objs; 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 // override with any special post-processing
@SuppressWarnings("static-method") @SuppressWarnings("static-method")
public Map<String, Object> postProcessModels(Map<String, Object> objs) { 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>(); Map<String, Schema> allProperties = new LinkedHashMap<String, Schema>();
List<String> allRequired = new ArrayList<String>(); 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 // parent model
final String parentName = ModelUtils.getParentName(composed, allDefinitions); final String parentName = ModelUtils.getParentName(composed, allDefinitions);
final List<String> allParents = ModelUtils.getAllParentsName(composed, allDefinitions); final List<String> allParents = ModelUtils.getAllParentsName(composed, allDefinitions);
final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName); 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 // TODO revise the logic below to set dicriminator, xml attributes
if (supportsInheritance || supportsMixins) { if (supportsInheritance || supportsMixins) {
@ -2879,6 +2938,10 @@ public class DefaultCodegen implements CodegenConfig {
responseSchema = ModelUtils.getSchemaFromResponse(response); responseSchema = ModelUtils.getSchemaFromResponse(response);
} }
r.schema = responseSchema; r.schema = responseSchema;
if (responseSchema != null && responseSchema.getPattern() != null) {
r.pattern = toRegularExpression(responseSchema.getPattern());
}
r.message = escapeText(response.getDescription()); r.message = escapeText(response.getDescription());
// TODO need to revise and test examples in responses // TODO need to revise and test examples in responses
// ApiResponse does not support examples at the moment // ApiResponse does not support examples at the moment

View File

@ -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 // We have to create a new auth method instance because the original object must
// not be modified. // not be modified.
CodegenSecurity opSecurity = security.filterByScopeNames(opScopes); CodegenSecurity opSecurity = security.filterByScopeNames(opScopes);
opSecurity.hasMore = security.hasMore;
result.add(opSecurity); result.add(opSecurity);
filtered = true; filtered = true;
break; break;

View File

@ -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 // this will only import "fmt" and "strings" if there are items in pathParams
for (CodegenOperation operation : operations) { for (CodegenOperation operation : operations) {
if (operation.pathParams != null && operation.pathParams.size() > 0) { if (operation.pathParams != null && operation.pathParams.size() > 0) {
imports.add(createMapping("import", "fmt"));
imports.add(createMapping("import", "strings")); imports.add(createMapping("import", "strings"));
break; //just need to import once break; //just need to import once
} }

View File

@ -54,6 +54,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String SUPPORT_JAVA6 = "supportJava6"; public static final String SUPPORT_JAVA6 = "supportJava6";
public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping"; public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping";
public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix";
public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations";
protected String dateLibrary = "threetenbp"; protected String dateLibrary = "threetenbp";
protected boolean supportAsync = false; protected boolean supportAsync = false;
@ -91,6 +92,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected String parentArtifactId = ""; protected String parentArtifactId = "";
protected String parentVersion = ""; protected String parentVersion = "";
protected boolean parentOverridden = false; protected boolean parentOverridden = false;
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
public AbstractJavaCodegen() { public AbstractJavaCodegen() {
super(); 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.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(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_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_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); 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)) { if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
} else if (additionalProperties.containsKey(CodegenConstants.API_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() { private void sanitizeConfig() {
// Sanitize any config options here. We also have to update the additionalProperties because // 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 // 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; this.parentOverridden = parentOverridden;
} }
public void setAdditionalModelTypeAnnotations(final List<String> additionalModelTypeAnnotations) {
this.additionalModelTypeAnnotations = additionalModelTypeAnnotations;
}
@Override @Override
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
super.addAdditionPropertiesToCodeGenModel(codegenModel, schema); super.addAdditionPropertiesToCodeGenModel(codegenModel, schema);

View File

@ -43,6 +43,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson} 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); private static final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);
protected String artifactId; 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.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC));
cliOptions.add(new CliOption(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC)); cliOptions.add(new CliOption(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC));
cliOptions.add(CliOption.newBoolean(MODEL_MUTABLE, MODEL_MUTABLE_DESC, false));
} }
@Override @Override

View File

@ -347,6 +347,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
}); });
} }
} }
setCircularReferences(allModels);
for (Map.Entry<String, Object> entry : objs.entrySet()) { for (Map.Entry<String, Object> entry : objs.entrySet()) {
Map<String, Object> inner = (Map<String, Object>) entry.getValue(); Map<String, Object> inner = (Map<String, Object>) entry.getValue();
List<Map<String, Object>> models = (List<Map<String, Object>>) inner.get("models"); List<Map<String, Object>> models = (List<Map<String, Object>>) inner.get("models");

View File

@ -144,10 +144,19 @@ public class GoServerCodegen extends AbstractGoCodegen {
if (additionalProperties.containsKey("serverPort") && additionalProperties.get("serverPort") instanceof Integer) { if (additionalProperties.containsKey("serverPort") && additionalProperties.get("serverPort") instanceof Integer) {
this.setServerPort((int) additionalProperties.get("serverPort")); 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 { } else {
additionalProperties.put("serverPort", serverPort); additionalProperties.put("serverPort", serverPort);
} }
if (additionalProperties.containsKey("featureCORS")) { if (additionalProperties.containsKey("featureCORS")) {
this.setFeatureCORS(convertPropertyToBooleanAndWriteBack("featureCORS")); this.setFeatureCORS(convertPropertyToBooleanAndWriteBack("featureCORS"));
} else { } else {
@ -165,6 +174,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
supportingFiles.add(new SupportingFile("main.mustache", "", "main.go")); supportingFiles.add(new SupportingFile("main.mustache", "", "main.go"));
supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); 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("routers.mustache", sourceFolder, "routers.go"));
supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go")); supportingFiles.add(new SupportingFile("logger.mustache", sourceFolder, "logger.go"));
supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go")); supportingFiles.add(new SupportingFile("api.mustache", sourceFolder, "api.go"));

View File

@ -29,6 +29,9 @@ import org.openapitools.codegen.utils.ProcessUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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.io.File;
import java.util.*; import java.util.*;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -39,8 +42,7 @@ import static java.util.Collections.sort;
import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.camelize;
public class JavaClientCodegen extends AbstractJavaCodegen public class JavaClientCodegen extends AbstractJavaCodegen
implements BeanValidationFeatures, PerformBeanValidationFeatures, implements BeanValidationFeatures, PerformBeanValidationFeatures, GzipFeatures {
GzipFeatures {
static final String MEDIA_TYPE = "mediaType"; 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_1 = "retrofit";
public static final String RETROFIT_2 = "retrofit2"; public static final String RETROFIT_2 = "retrofit2";
public static final String VERTX = "vertx"; 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_GSON = "gson";
public static final String SERIALIZATION_LIBRARY_JACKSON = "jackson"; 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(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(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(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"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
libraryOption.setEnum(supportedLibraries); 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."; 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 @Override
public void processOpts() { public void processOpts() {
if ((WEBCLIENT.equals(getLibrary()) && "threetenbp".equals(dateLibrary)) || NATIVE.equals(getLibrary())) { if ((WEBCLIENT.equals(getLibrary()) && "threetenbp".equals(dateLibrary)) || NATIVE.equals(getLibrary())) {
dateLibrary = "java8"; dateLibrary = "java8";
} }
else if (MICROPROFILE.equals(getLibrary())) {
dateLibrary = "legacy";
}
super.processOpts(); super.processOpts();
@ -266,12 +281,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen
writeOptional(outputFolder, new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml")); writeOptional(outputFolder, new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml"));
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
supportingFiles.add(new SupportingFile("ApiClient.mustache", invokerFolder, "ApiClient.java")); 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")); 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) // 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/HttpBasicAuth.mustache", authFolder, "HttpBasicAuth.java"));
supportingFiles.add(new SupportingFile("auth/HttpBearerAuth.mustache", authFolder, "HttpBearerAuth.java")); supportingFiles.add(new SupportingFile("auth/HttpBearerAuth.mustache", authFolder, "HttpBearerAuth.java"));
supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.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"); 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("apiException.mustache", invokerFolder, "ApiException.java"));
supportingFiles.add(new SupportingFile("Configuration.mustache", invokerFolder, "Configuration.java")); supportingFiles.add(new SupportingFile("Configuration.mustache", invokerFolder, "Configuration.java"));
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.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")); 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("JSON.mustache", invokerFolder, "JSON.java"));
supportingFiles.add(new SupportingFile("GsonObjectMapper.mustache", invokerFolder, "GsonObjectMapper.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)); additionalProperties.put("convert", new CaseFormatLambda(LOWER_CAMEL, UPPER_UNDERSCORE));
apiTemplateFiles.put("api.mustache", ".java"); apiTemplateFiles.put("api.mustache", ".java");
supportingFiles.add(new SupportingFile("ResponseSpecBuilders.mustache", invokerFolder, "ResponseSpecBuilders.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 { } else {
LOGGER.error("Unknown library option (-l/--library): " + getLibrary()); 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) // 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/OAuth.mustache", authFolder, "OAuth.java"));
supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authFolder, "OAuthFlow.java")); supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authFolder, "OAuthFlow.java"));
} }
if (MICROPROFILE.equals(getLibrary())) {
objs = AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs);
}
return objs; return objs;
} }
@ -635,6 +664,23 @@ public class JavaClientCodegen extends AbstractJavaCodegen
model.imports.add("JsonCreator"); 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 @Override

View File

@ -57,8 +57,10 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
public static final String LENIENT_TYPE_CAST = "lenientTypeCast"; public static final String LENIENT_TYPE_CAST = "lenientTypeCast";
protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; protected static final String LIBRARY_PROMISE_KIT = "PromiseKit";
protected static final String LIBRARY_RX_SWIFT = "RxSwift"; 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 String projectName = "OpenAPIClient";
protected boolean nonPublicApi = false;
protected boolean unwrapRequired; protected boolean unwrapRequired;
protected boolean objcCompatible = false; protected boolean objcCompatible = false;
protected boolean lenientTypeCast = false; protected boolean lenientTypeCast = false;
@ -208,6 +210,9 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
"Optionally use libraries to manage response. Currently " "Optionally use libraries to manage response. Currently "
+ StringUtils.join(RESPONSE_LIBRARIES, ", ") + StringUtils.join(RESPONSE_LIBRARIES, ", ")
+ " are available.")); + " are available."));
cliOptions.add(new CliOption(CodegenConstants.NON_PUBLIC_API,
CodegenConstants.NON_PUBLIC_API_DESC
+ "(default: false)"));
cliOptions.add(new CliOption(UNWRAP_REQUIRED, cliOptions.add(new CliOption(UNWRAP_REQUIRED,
"Treat 'required' properties in response as non-optional " "Treat 'required' properties in response as non-optional "
+ "(which would crash the app if api returns null as opposed " + "(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; 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 // Setup unwrapRequired option, which makes all the
// properties with "required" non-optional // properties with "required" non-optional
if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { if (additionalProperties.containsKey(UNWRAP_REQUIRED)) {
@ -364,6 +377,9 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
if (ArrayUtils.contains(responseAs, LIBRARY_RX_SWIFT)) { if (ArrayUtils.contains(responseAs, LIBRARY_RX_SWIFT)) {
additionalProperties.put("useRxSwift", true); additionalProperties.put("useRxSwift", true);
} }
if (ArrayUtils.contains(responseAs, LIBRARY_RESULT)) {
additionalProperties.put("useResult", true);
}
// Setup swiftUseApiNamespace option, which makes all the API // Setup swiftUseApiNamespace option, which makes all the API
// classes inner-class of {{projectName}}API // classes inner-class of {{projectName}}API
@ -417,6 +433,11 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache", supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache",
sourceFolder, sourceFolder,
"JSONEncodingHelper.swift")); "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", supportingFiles.add(new SupportingFile("git_push.sh.mustache",
"", "",
"git_push.sh")); "git_push.sh"));
@ -555,7 +576,11 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
public String toDefaultValue(Schema p) { public String toDefaultValue(Schema p) {
if (p.getEnum() != null && !p.getEnum().isEmpty()) { if (p.getEnum() != null && !p.getEnum().isEmpty()) {
if (p.getDefault() != null) { 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)) { if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) {
@ -714,6 +739,10 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
this.projectName = projectName; this.projectName = projectName;
} }
public void setNonPublicApi(boolean nonPublicApi) {
this.nonPublicApi = nonPublicApi;
}
public void setUnwrapRequired(boolean unwrapRequired) { public void setUnwrapRequired(boolean unwrapRequired) {
this.unwrapRequired = unwrapRequired; this.unwrapRequired = unwrapRequired;
} }

View File

@ -18,8 +18,10 @@
package org.openapitools.codegen.languages; package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.Operation; 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.media.Schema;
import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponse;
import org.openapitools.codegen.*; import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -299,4 +301,14 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
String name = filename.substring((modelPackage() + File.separator).length()); String name = filename.substring((modelPackage() + File.separator).length());
return camelize(name); 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);
}
} }

View File

@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -54,7 +55,6 @@ public class ModelUtils {
return Boolean.parseBoolean(GlobalSettings.getProperty(generateAliasAsModelKey, "false")); return Boolean.parseBoolean(GlobalSettings.getProperty(generateAliasAsModelKey, "false"));
} }
/** /**
* Searches for the model by name in the map of models and returns it * 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 * @return schemas a list of unused schemas
*/ */
public static List<String> getUnusedSchemas(OpenAPI openAPI) { 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>(); List<String> unusedSchemas = new ArrayList<String>();
Map<String, Schema> schemas = getSchemas(openAPI); Map<String, Schema> schemas = getSchemas(openAPI);
@ -875,6 +886,7 @@ public class ModelUtils {
public static Map<String, List<String>> getChildrenMap(OpenAPI openAPI) { public static Map<String, List<String>> getChildrenMap(OpenAPI openAPI) {
Map<String, Schema> allSchemas = getSchemas(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() Map<String, List<Entry<String, Schema>>> groupedByParent = allSchemas.entrySet().stream()
.filter(entry -> isComposedSchema(entry.getValue())) .filter(entry -> isComposedSchema(entry.getValue()))
.collect(Collectors.groupingBy(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas))); .collect(Collectors.groupingBy(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas)));

View File

@ -50,7 +50,7 @@ void apiClient_free(apiClient_t *apiClient) {
} }
{{/isOAuth}} {{/isOAuth}}
{{#isApiKey}} {{#isApiKey}}
if(apiClient->accessToken) { if(apiClient->apiKeys) {
list_free(apiClient->apiKeys); list_free(apiClient->apiKeys);
} }
{{/isApiKey}} {{/isApiKey}}

View File

@ -74,17 +74,17 @@ return 0;
{{^isContainer}} {{^isContainer}}
{{^isModel}} {{^isModel}}
{{#isEnum}} {{#isEnum}}
char* {{baseName}}{{classname}}_ToString({{baseName}}_e {{baseName}}){ char* {{name}}{{classname}}_ToString({{name}}_e {{name}}){
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} }; char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
return {{baseName}}Array[{{baseName}}]; return {{name}}Array[{{name}}];
} }
{{baseName}}_e {{baseName}}{{classname}}_FromString(char* {{baseName}}){ {{name}}_e {{name}}{{classname}}_FromString(char* {{name}}){
int stringToReturn = 0; int stringToReturn = 0;
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} }; char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
size_t sizeofArray = sizeof({{baseName}}Array) / sizeof({{baseName}}Array[0]); size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]);
while(stringToReturn < sizeofArray) { while(stringToReturn < sizeofArray) {
if(strcmp({{baseName}}, {{baseName}}Array[stringToReturn]) == 0) { if(strcmp({{name}}, {{name}}Array[stringToReturn]) == 0) {
return stringToReturn; return stringToReturn;
} }
stringToReturn++; stringToReturn++;
@ -98,17 +98,17 @@ return 0;
{{#items}} {{#items}}
{{^isModel}} {{^isModel}}
{{#isEnum}} {{#isEnum}}
char* {{baseName}}{{classname}}_ToString({{baseName}}_e {{baseName}}){ char* {{name}}{{classname}}_ToString({{name}}_e {{name}}){
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} }; char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
return {{baseName}}Array[{{baseName}} - 1]; return {{name}}Array[{{name}} - 1];
} }
{{baseName}}_e {{baseName}}{{classname}}_FromString(char* {{baseName}}){ {{name}}_e {{name}}{{classname}}_FromString(char* {{name}}){
int stringToReturn = 0; int stringToReturn = 0;
char *{{baseName}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} }; char *{{name}}Array[] = { {{#allowableValues}}{{#enumVars}}"{{{value}}}"{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} };
size_t sizeofArray = sizeof({{baseName}}Array) / sizeof({{baseName}}Array[0]); size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]);
while(stringToReturn < sizeofArray) { while(stringToReturn < sizeofArray) {
if(strcmp({{baseName}}, {{baseName}}Array[stringToReturn]) == 0) { if(strcmp({{name}}, {{name}}Array[stringToReturn]) == 0) {
return stringToReturn + 1; return stringToReturn + 1;
} }
stringToReturn++; stringToReturn++;
@ -127,64 +127,64 @@ return 0;
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{#isEnum}} {{#isEnum}}
{{datatype}}_e {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}} {{/isFreeFormObject}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isNumeric}} {{#isNumeric}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}} {{/isNumeric}}
{{#isBoolean}} {{#isBoolean}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}} {{/isBoolean}}
{{#isEnum}} {{#isEnum}}
{{#isString}} {{#isString}}
{{baseName}}_e {{baseName}}{{#hasMore}},{{/hasMore}} {{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isByteArray}} {{#isByteArray}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}} {{/isByteArray}}
{{#isBinary}} {{#isBinary}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}} {{/isDateTime}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
{{#isContainer}} {{#isContainer}}
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}} {{/isMapContainer}}
{{/isContainer}} {{/isContainer}}
{{/vars}} {{/vars}}
@ -194,7 +194,7 @@ return 0;
return NULL; return NULL;
} }
{{#vars}} {{#vars}}
{{classname}}_local_var->{{{baseName}}} = {{{baseName}}}; {{classname}}_local_var->{{{name}}} = {{{name}}};
{{/vars}} {{/vars}}
return {{classname}}_local_var; return {{classname}}_local_var;
@ -208,58 +208,58 @@ void {{classname}}_free({{classname}}_t *{{classname}}) {
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{^isEnum}} {{^isEnum}}
{{{complexType}}}_free({{{classname}}}->{{{baseName}}}); {{{complexType}}}_free({{{classname}}}->{{{name}}});
{{/isEnum}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
free({{{classname}}}->{{{baseName}}}); free({{{classname}}}->{{{name}}});
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
free({{{classname}}}->{{{baseName}}}); free({{{classname}}}->{{{name}}});
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
object_free({{{classname}}}->{{{baseName}}}); object_free({{{classname}}}->{{{name}}});
{{/isFreeFormObject}} {{/isFreeFormObject}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
free({{{classname}}}->{{{baseName}}}); free({{{classname}}}->{{{name}}});
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isBinary}} {{#isBinary}}
free({{{classname}}}->{{{baseName}}}->data); free({{{classname}}}->{{{name}}}->data);
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
free({{{classname}}}->{{{baseName}}}); free({{{classname}}}->{{{name}}});
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
free({{{classname}}}->{{{baseName}}}); free({{{classname}}}->{{{name}}});
{{/isDateTime}} {{/isDateTime}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
{{#isContainer}} {{#isContainer}}
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
list_ForEach(listEntry, {{classname}}->{{baseName}}) { list_ForEach(listEntry, {{classname}}->{{name}}) {
free(listEntry->data); free(listEntry->data);
} }
list_free({{classname}}->{{baseName}}); list_free({{classname}}->{{name}});
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
list_ForEach(listEntry, {{classname}}->{{baseName}}) { list_ForEach(listEntry, {{classname}}->{{name}}) {
{{complexType}}_free(listEntry->data); {{complexType}}_free(listEntry->data);
} }
list_free({{classname}}->{{baseName}}); list_free({{classname}}->{{name}});
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
list_ForEach(listEntry, {{classname}}->{{baseName}}) { list_ForEach(listEntry, {{classname}}->{{name}}) {
keyValuePair_t *localMapKeyPair = (keyValuePair_t*) listEntry->data; keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data;
free (localKeyValue->key); free (localKeyValue->key);
free (localKeyValue->value); free (localKeyValue->value);
} }
list_free({{classname}}->{{baseName}}); list_free({{classname}}->{{name}});
{{/isMapContainer}} {{/isMapContainer}}
{{/isContainer}} {{/isContainer}}
{{/vars}} {{/vars}}
@ -270,30 +270,30 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
cJSON *item = cJSON_CreateObject(); cJSON *item = cJSON_CreateObject();
{{#vars}} {{#vars}}
// {{{classname}}}->{{{baseName}}} // {{{classname}}}->{{{name}}}
{{#required}} {{#required}}
{{^isEnum}} {{^isEnum}}
if (!{{{classname}}}->{{{baseName}}}) { if (!{{{classname}}}->{{{name}}}) {
goto fail; goto fail;
} }
{{/isEnum}} {{/isEnum}}
{{/required}} {{/required}}
{{^required}}{{^isEnum}}if({{{classname}}}->{{{baseName}}}) { {{/isEnum}}{{/required}} {{^required}}{{^isEnum}}if({{{classname}}}->{{{name}}}) { {{/isEnum}}{{/required}}
{{^isContainer}} {{^isContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isNumeric}} {{#isNumeric}}
if(cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddNumberToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //Numeric goto fail; //Numeric
} }
{{/isNumeric}} {{/isNumeric}}
{{#isBoolean}} {{#isBoolean}}
if(cJSON_AddBoolToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddBoolToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //Bool goto fail; //Bool
} }
{{/isBoolean}} {{/isBoolean}}
{{#isEnum}} {{#isEnum}}
{{#isString}} {{#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 goto fail; //Enum
} }
@ -301,30 +301,30 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //String goto fail; //String
} }
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isByteArray}} {{#isByteArray}}
if(cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddNumberToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //Byte goto fail; //Byte
} }
{{/isByteArray}} {{/isByteArray}}
{{#isBinary}} {{#isBinary}}
char* encoded_str_{{{baseName}}} = base64encode({{{classname}}}->{{{baseName}}}->data,{{{classname}}}->{{{baseName}}}->len); char* encoded_str_{{{name}}} = base64encode({{{classname}}}->{{{name}}}->data,{{{classname}}}->{{{name}}}->len);
if(cJSON_AddStringToObject(item, "{{{baseName}}}", encoded_str_{{{baseName}}}) == NULL) { if(cJSON_AddStringToObject(item, "{{{name}}}", encoded_str_{{{name}}}) == NULL) {
goto fail; //Binary goto fail; //Binary
} }
free (encoded_str_{{{baseName}}}); free (encoded_str_{{{name}}});
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //Date goto fail; //Date
} }
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //Date-Time goto fail; //Date-Time
} }
{{/isDateTime}} {{/isDateTime}}
@ -332,42 +332,42 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{#isEnum}} {{#isEnum}}
cJSON *{{{baseName}}}_enum_local_JSON = {{datatypeWithEnum}}_convertToJSON({{{classname}}}->{{{baseName}}}); cJSON *{{{name}}}_enum_local_JSON = {{datatypeWithEnum}}_convertToJSON({{{classname}}}->{{{name}}});
if({{{baseName}}}_enum_local_JSON == NULL) { if({{{name}}}_enum_local_JSON == NULL) {
goto fail; // enum goto fail; // enum
} }
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{baseName}}}_enum_local_JSON); cJSON_AddItemToObject(item, "{{{name}}}", {{{name}}}_enum_local_JSON);
if(item->child == NULL) { if(item->child == NULL) {
goto fail; goto fail;
} }
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
cJSON *{{{baseName}}}_local_JSON = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_convertToJSON({{{classname}}}->{{{baseName}}}); cJSON *{{{name}}}_local_JSON = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_convertToJSON({{{classname}}}->{{{name}}});
if({{{baseName}}}_local_JSON == NULL) { if({{{name}}}_local_JSON == NULL) {
goto fail; //model goto fail; //model
} }
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{baseName}}}_local_JSON); cJSON_AddItemToObject(item, "{{{name}}}", {{{name}}}_local_JSON);
if(item->child == NULL) { if(item->child == NULL) {
goto fail; goto fail;
} }
{{/isEnum}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //uuid goto fail; //uuid
} }
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{baseName}}}) == NULL) { if(cJSON_AddStringToObject(item, "{{{name}}}", {{{classname}}}->{{{name}}}) == NULL) {
goto fail; //Email goto fail; //Email
} }
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
cJSON *{{{baseName}}}_object = object_convertToJSON({{{classname}}}->{{{baseName}}}); cJSON *{{{name}}}_object = object_convertToJSON({{{classname}}}->{{{name}}});
if({{{baseName}}}_object == NULL) { if({{{name}}}_object == NULL) {
goto fail; //model goto fail; //model
} }
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{baseName}}}_object); cJSON_AddItemToObject(item, "{{{name}}}", {{{name}}}_object);
if(item->child == NULL) { if(item->child == NULL) {
goto fail; goto fail;
} }
@ -377,22 +377,22 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
{{#isContainer}} {{#isContainer}}
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}"); cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{name}}}");
if({{{name}}} == NULL) { if({{{name}}} == NULL) {
goto fail; //primitive container goto fail; //primitive container
} }
listEntry_t *{{{name}}}ListEntry; listEntry_t *{{{name}}}ListEntry;
list_ForEach({{{name}}}ListEntry, {{{classname}}}->{{{baseName}}}) { list_ForEach({{{name}}}ListEntry, {{{classname}}}->{{{name}}}) {
{{#items}} {{#items}}
{{#isString}} {{#isString}}
if(cJSON_AddStringToObject({{{baseName}}}, "", (char*){{{baseName}}}ListEntry->data) == NULL) if(cJSON_AddStringToObject({{{name}}}, "", (char*){{{name}}}ListEntry->data) == NULL)
{ {
goto fail; goto fail;
} }
{{/isString}} {{/isString}}
{{^isString}} {{^isString}}
if(cJSON_AddNumberToObject({{{baseName}}}, "", *(double *){{{baseName}}}ListEntry->data) == NULL) if(cJSON_AddNumberToObject({{{name}}}, "", *(double *){{{name}}}ListEntry->data) == NULL)
{ {
goto fail; goto fail;
} }
@ -401,33 +401,33 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
} }
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
cJSON *{{{baseName}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}"); cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{name}}}");
if({{{baseName}}} == NULL) { if({{{name}}} == NULL) {
goto fail; //nonprimitive container goto fail; //nonprimitive container
} }
listEntry_t *{{{baseName}}}ListEntry; listEntry_t *{{{name}}}ListEntry;
if ({{{classname}}}->{{{baseName}}}) { if ({{{classname}}}->{{{name}}}) {
list_ForEach({{{baseName}}}ListEntry, {{classname}}->{{{baseName}}}) { list_ForEach({{{name}}}ListEntry, {{classname}}->{{{name}}}) {
cJSON *itemLocal = {{complexType}}_convertToJSON({{#isEnum}}{{#items}}({{datatypeWithEnum}}_e){{/items}}{{/isEnum}}{{{baseName}}}ListEntry->data); cJSON *itemLocal = {{complexType}}_convertToJSON({{#isEnum}}{{#items}}({{datatypeWithEnum}}_e){{/items}}{{/isEnum}}{{{name}}}ListEntry->data);
if(itemLocal == NULL) { if(itemLocal == NULL) {
goto fail; goto fail;
} }
cJSON_AddItemToArray({{{baseName}}}, itemLocal); cJSON_AddItemToArray({{{name}}}, itemLocal);
} }
} }
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
cJSON *{{{baseName}}} = cJSON_AddObjectToObject(item, "{{{baseName}}}"); cJSON *{{{name}}} = cJSON_AddObjectToObject(item, "{{{name}}}");
if({{{baseName}}} == NULL) { if({{{name}}} == NULL) {
goto fail; //primitive map container goto fail; //primitive map container
} }
cJSON *localMapObject = cJSON_CreateObject(); //Memory free to be implemented in user code cJSON *localMapObject = cJSON_CreateObject(); //Memory free to be implemented in user code
listEntry_t *{{{baseName}}}ListEntry; listEntry_t *{{{name}}}ListEntry;
if ({{{classname}}}->{{{baseName}}}) { if ({{{classname}}}->{{{name}}}) {
list_ForEach({{{baseName}}}ListEntry, {{{classname}}}->{{{baseName}}}) { list_ForEach({{{name}}}ListEntry, {{{classname}}}->{{{name}}}) {
keyValuePair_t *localKeyValue = (keyValuePair_t*){{{baseName}}}ListEntry->data; keyValuePair_t *localKeyValue = (keyValuePair_t*){{{name}}}ListEntry->data;
{{#items}} {{#items}}
{{#isString}} {{#isString}}
if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL)
@ -442,7 +442,7 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) {
} }
{{/isString}} {{/isString}}
{{/items}} {{/items}}
cJSON_AddItemToObject({{{baseName}}},"", localMapObject); cJSON_AddItemToObject({{{name}}},"", localMapObject);
} }
} }
{{/isMapContainer}} {{/isMapContainer}}
@ -465,10 +465,10 @@ fail:
{{classname}}_t *{{classname}}_local_var = NULL; {{classname}}_t *{{classname}}_local_var = NULL;
{{#vars}} {{#vars}}
// {{{classname}}}->{{{baseName}}} // {{{classname}}}->{{{name}}}
cJSON *{{{baseName}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}"); cJSON *{{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{name}}}");
{{#required}} {{#required}}
if (!{{{baseName}}}) { if (!{{{name}}}) {
goto end; goto end;
} }
@ -476,71 +476,71 @@ fail:
{{^isContainer}} {{^isContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isNumeric}} {{#isNumeric}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsNumber({{{baseName}}})) if(!cJSON_IsNumber({{{name}}}))
{ {
goto end; //Numeric goto end; //Numeric
} }
{{/isNumeric}} {{/isNumeric}}
{{#isBoolean}} {{#isBoolean}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsBool({{{baseName}}})) if(!cJSON_IsBool({{{name}}}))
{ {
goto end; //Bool goto end; //Bool
} }
{{/isBoolean}} {{/isBoolean}}
{{#isEnum}} {{#isEnum}}
{{#isString}} {{#isString}}
{{{baseName}}}_e {{baseName}}Variable; {{{name}}}_e {{name}}Variable;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //Enum goto end; //Enum
} }
{{baseName}}Variable = {{baseName}}{{classname}}_FromString({{{baseName}}}->valuestring); {{name}}Variable = {{name}}{{classname}}_FromString({{{name}}}->valuestring);
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //String goto end; //String
} }
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isByteArray}} {{#isByteArray}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsNumber({{{baseName}}})) if(!cJSON_IsNumber({{{name}}}))
{ {
goto end; //Byte goto end; //Byte
} }
{{/isByteArray}} {{/isByteArray}}
{{#isBinary}} {{#isBinary}}
binary_t* decoded_str_{{{baseName}}}; binary_t* decoded_str_{{{name}}};
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //Binary goto end; //Binary
} }
char* decoded = base64decode({{{baseName}}}->valuestring, strlen({{{baseName}}}->valuestring)); char* decoded = base64decode({{{name}}}->valuestring, strlen({{{name}}}->valuestring));
decoded_str_{{{baseName}}}->data = malloc(strlen(decoded) - 1); decoded_str_{{{name}}}->data = malloc(strlen(decoded) - 1);
if (!decoded_str_{{{baseName}}}->data) { if (!decoded_str_{{{name}}}->data) {
goto end; goto end;
} }
memcpy(decoded_str_{{{baseName}}}->data,decoded,(strlen(decoded)-1)); memcpy(decoded_str_{{{name}}}->data,decoded,(strlen(decoded)-1));
decoded_str_{{{baseName}}}->len = strlen(decoded) - 1; decoded_str_{{{name}}}->len = strlen(decoded) - 1;
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //Date goto end; //Date
} }
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //DateTime goto end; //DateTime
} }
@ -549,34 +549,34 @@ fail:
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{#isEnum}} {{#isEnum}}
{{datatypeWithEnum}}_e {{baseName}}_local_nonprim_enum; {{datatypeWithEnum}}_e {{name}}_local_nonprim_enum;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
{{{baseName}}}_local_nonprim_enum = {{datatypeWithEnum}}_parseFromJSON({{{baseName}}}); //enum model {{{name}}}_local_nonprim_enum = {{datatypeWithEnum}}_parseFromJSON({{{name}}}); //enum model
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{baseName}}_local_nonprim = NULL; {{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
{{{baseName}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{baseName}}}); //nonprimitive {{{name}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}}); //nonprimitive
{{/isEnum}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //uuid goto end; //uuid
} }
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
if(!cJSON_IsString({{{baseName}}})) if(!cJSON_IsString({{{name}}}))
{ {
goto end; //email goto end; //email
} }
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
object_t *{{baseName}}_local_object = NULL; object_t *{{name}}_local_object = NULL;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
{{{baseName}}}_local_object = object_parseFromJSON({{{baseName}}}); //object {{{name}}}_local_object = object_parseFromJSON({{{name}}}); //object
{{/isFreeFormObject}} {{/isFreeFormObject}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
@ -584,64 +584,64 @@ fail:
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
list_t *{{{name}}}List; list_t *{{{name}}}List;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{name}}}_local; cJSON *{{{name}}}_local;
if(!cJSON_IsArray({{{baseName}}})) { if(!cJSON_IsArray({{{name}}})) {
goto end;//primitive container goto end;//primitive container
} }
{{{name}}}List = list_create(); {{{name}}}List = list_create();
cJSON_ArrayForEach({{{name}}}_local, {{{baseName}}}) cJSON_ArrayForEach({{{name}}}_local, {{{name}}})
{ {
{{#items}} {{#items}}
{{#isString}} {{#isString}}
if(!cJSON_IsString({{{baseName}}}_local)) if(!cJSON_IsString({{{name}}}_local))
{ {
goto end; goto end;
} }
list_addElement({{{baseName}}}List , strdup({{{baseName}}}_local->valuestring)); list_addElement({{{name}}}List , strdup({{{name}}}_local->valuestring));
{{/isString}} {{/isString}}
{{^isString}} {{^isString}}
if(!cJSON_IsNumber({{{baseName}}}_local)) if(!cJSON_IsNumber({{{name}}}_local))
{ {
goto end; goto end;
} }
list_addElement({{{baseName}}}List , &{{{baseName}}}_local->valuedouble); list_addElement({{{name}}}List , &{{{name}}}_local->valuedouble);
{{/isString}} {{/isString}}
{{/items}} {{/items}}
} }
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
list_t *{{{baseName}}}List; list_t *{{{name}}}List;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{baseName}}}_local_nonprimitive; cJSON *{{{name}}}_local_nonprimitive;
if(!cJSON_IsArray({{{baseName}}})){ if(!cJSON_IsArray({{{name}}})){
goto end; //nonprimitive container 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; 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}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
list_t *{{{complexType}}}List; list_t *{{{complexType}}}List;
{{^required}}if ({{{baseName}}}) { {{/required}} {{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{complexType}}}_local_map; cJSON *{{{complexType}}}_local_map;
if(!cJSON_IsObject({{{baseName}}})) { if(!cJSON_IsObject({{{name}}})) {
goto end;//primitive map container goto end;//primitive map container
} }
{{{complexType}}}List = list_create(); {{{complexType}}}List = list_create();
keyValuePair_t *localMapKeyPair; keyValuePair_t *localMapKeyPair;
cJSON_ArrayForEach({{{complexType}}}_local_map, {{{baseName}}}) cJSON_ArrayForEach({{{complexType}}}_local_map, {{{name}}})
{ {
{{#isString}} {{#isString}}
if(!cJSON_IsString({{{complexType}}}_local_map)) if(!cJSON_IsString({{{complexType}}}_local_map))
@ -674,64 +674,64 @@ fail:
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{#isEnum}} {{#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}}
{{^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}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}} {{/isFreeFormObject}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isNumeric}} {{#isNumeric}}
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}} {{/isNumeric}}
{{#isBoolean}} {{#isBoolean}}
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}} {{/isBoolean}}
{{#isEnum}} {{#isEnum}}
{{#isString}} {{#isString}}
{{^required}}{{{baseName}}} ? {{/required}}{{baseName}}Variable{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isByteArray}} {{#isByteArray}}
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}} {{/isByteArray}}
{{#isBinary}} {{#isBinary}}
{{^required}}{{{baseName}}} ? {{/required}}decoded_str_{{{baseName}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
{{^required}}{{{baseName}}} ? {{/required}}strdup({{{baseName}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}} {{/isDateTime}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
{{#isContainer}} {{#isContainer}}
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{^required}}{{{baseName}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{^required}}{{{baseName}}} ? {{/required}}{{{baseName}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
{{^required}}{{{baseName}}} ? {{/required}}{{{complexType}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}} {{^required}}{{{name}}} ? {{/required}}{{{complexType}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}} {{/isMapContainer}}
{{/isContainer}} {{/isContainer}}
{{/vars}} {{/vars}}

View File

@ -36,12 +36,12 @@ cJSON *{{classname}}_convertToJSON({{classname}}_e {{classname}});
{{^isModel}} {{^isModel}}
{{#isEnum}} {{#isEnum}}
{{#allowableValues}} {{#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}} {{/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}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{/isContainer}} {{/isContainer}}
@ -50,12 +50,12 @@ cJSON *{{classname}}_convertToJSON({{classname}}_e {{classname}});
{{^isModel}} {{^isModel}}
{{#isEnum}} {{#isEnum}}
{{#allowableValues}} {{#allowableValues}}
typedef enum { {{#enumVars}} {{{value}}}{{^-last}},{{/-last}}{{/enumVars}} } {{baseName}}_e; typedef enum { {{#enumVars}} {{{value}}}{{^-last}},{{/-last}}{{/enumVars}} } {{name}}_e;
{{/allowableValues}} {{/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}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{/items}} {{/items}}
@ -69,64 +69,64 @@ typedef struct {{classname}}_t {
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{#isEnum}} {{#isEnum}}
{{datatype}}_e {{baseName}}; //enum model {{datatype}}_e {{name}}; //enum model
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{datatype}}_t *{{baseName}}; //model {{datatype}}_t *{{name}}; //model
{{/isEnum}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
{{datatype}} *{{baseName}}; // uuid {{datatype}} *{{name}}; // uuid
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
{{datatype}} *{{baseName}}; // email {{datatype}} *{{name}}; // email
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
{{datatype}}_t *{{baseName}}; //object {{datatype}}_t *{{name}}; //object
{{/isFreeFormObject}} {{/isFreeFormObject}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isNumeric}} {{#isNumeric}}
{{datatype}} {{baseName}}; //numeric {{datatype}} {{name}}; //numeric
{{/isNumeric}} {{/isNumeric}}
{{#isBoolean}} {{#isBoolean}}
{{datatype}} {{baseName}}; //boolean {{datatype}} {{name}}; //boolean
{{/isBoolean}} {{/isBoolean}}
{{#isEnum}} {{#isEnum}}
{{#isString}} {{#isString}}
{{baseName}}_e {{baseName}}; //enum {{name}}_e {{name}}; //enum
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
{{datatype}} *{{baseName}}; // string {{datatype}} *{{name}}; // string
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isByteArray}} {{#isByteArray}}
{{datatype}} {{baseName}}; //Byte {{datatype}} {{name}}; //Byte
{{/isByteArray}} {{/isByteArray}}
{{#isBinary}} {{#isBinary}}
{{datatype}} {{baseName}}; //binary {{datatype}} {{name}}; //binary
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
{{datatype}} *{{baseName}}; //date {{datatype}} *{{name}}; //date
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
{{datatype}} *{{baseName}}; //date time {{datatype}} *{{name}}; //date time
{{/isDateTime}} {{/isDateTime}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
{{#isContainer}} {{#isContainer}}
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{datatype}}_t *{{baseName}}; //primitive container {{datatype}}_t *{{name}}; //primitive container
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{datatype}}_t *{{baseName}}; //nonprimitive container {{datatype}}_t *{{name}}; //nonprimitive container
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
{{datatype}} {{baseName}}; //map {{datatype}} {{name}}; //map
{{/isMapContainer}} {{/isMapContainer}}
{{/isContainer}} {{/isContainer}}
{{/vars}} {{/vars}}
@ -139,64 +139,64 @@ typedef struct {{classname}}_t {
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{#isModel}} {{#isModel}}
{{#isEnum}} {{#isEnum}}
{{datatype}}_e {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}} {{/isEnum}}
{{/isModel}} {{/isModel}}
{{#isUuid}} {{#isUuid}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isUuid}} {{/isUuid}}
{{#isEmail}} {{#isEmail}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEmail}} {{/isEmail}}
{{#isFreeFormObject}} {{#isFreeFormObject}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}} {{/isFreeFormObject}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isNumeric}} {{#isNumeric}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}} {{/isNumeric}}
{{#isBoolean}} {{#isBoolean}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}} {{/isBoolean}}
{{#isEnum}} {{#isEnum}}
{{#isString}} {{#isString}}
{{baseName}}_e {{baseName}}{{#hasMore}},{{/hasMore}} {{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{^isEnum}} {{^isEnum}}
{{#isString}} {{#isString}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isString}} {{/isString}}
{{/isEnum}} {{/isEnum}}
{{#isByteArray}} {{#isByteArray}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}} {{/isByteArray}}
{{#isBinary}} {{#isBinary}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBinary}} {{/isBinary}}
{{#isDate}} {{#isDate}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDate}} {{/isDate}}
{{#isDateTime}} {{#isDateTime}}
{{datatype}} *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}} {{/isDateTime}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isContainer}} {{/isContainer}}
{{#isContainer}} {{#isContainer}}
{{#isListContainer}} {{#isListContainer}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
{{datatype}}_t *{{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
{{datatype}} {{baseName}}{{#hasMore}},{{/hasMore}} {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}} {{/isMapContainer}}
{{/isContainer}} {{/isContainer}}
{{/vars}} {{/vars}}

View File

@ -0,0 +1,2 @@
{{#additionalModelTypeAnnotations}}{{.}}
{{/additionalModelTypeAnnotations}}

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -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 @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% 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. @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 @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome

View File

@ -1,5 +1,21 @@
#!/usr/bin/env sh #!/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 ## Gradle start up script for UN*X
@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` 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. # 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. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" 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\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if $cygwin ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
@ -138,19 +154,19 @@ if $cygwin ; then
else else
eval `echo args$i`="\"$arg\"" eval `echo args$i`="\"$arg\""
fi fi
i=$((i+1)) i=`expr $i + 1`
done done
case $i in case $i in
(0) set -- ;; 0) set -- ;;
(1) set -- "$args0" ;; 1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;; 2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;; 3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
@ -159,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }
APP_ARGS=$(save "$@") APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules # 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" 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" "$@" exec "$JAVACMD" "$@"

View 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.

View 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}}

View 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;
}
}

View File

@ -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);
}
}

View 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}}
}

View File

@ -0,0 +1,4 @@
{{#required}}
@NotNull
{{/required}}
{{>beanValidationCore}}

View File

@ -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}}

View File

@ -0,0 +1 @@
{{#required}} @NotNull{{/required}}{{>beanValidationCore}}

View File

@ -0,0 +1 @@
{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}}

View File

@ -0,0 +1 @@
{{#required}} @NotNull{{/required}}{{>beanValidationCore}}

View File

@ -0,0 +1 @@
{{#isBodyParam}}{{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{dataType}}} {{paramName}}{{/isBodyParam}}

View File

@ -0,0 +1 @@
{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}

View 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}}
}
}

View 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}}
}
}

View 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}}

View File

@ -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