Compare commits

...

64 Commits

Author SHA1 Message Date
William Cheng
3744273312 4.0.0 release (#2878)
* remove snapshot version

* update readme

* undo changes to example

* revert apache maven version

* update gradle property
2019-05-13 20:56:47 +08:00
William Cheng
dc0c24b955 Minor wording change (#2875)
* better wording for version of openapi doc

* update petstore samples
2019-05-13 15:59:59 +08:00
Akira Tanimura
25392b9fd9 [Ruby] update TargetRubyVersion in .rubocop.yml to 2.4 (#2876) 2019-05-13 14:52:58 +08:00
Jonas DOREL
305f78c52b JS Client - Add support for empty enum in server object (#2853)
* Add support for empty enum in server object

* Updated samples
2019-05-13 14:21:43 +08:00
William Cheng
9d3c1f2262 update groovy readme (#2874) 2019-05-12 11:50:12 +08:00
William Cheng
001854171e upgrade groovy to 2.5.7 (#2871) 2019-05-12 01:48:42 +08:00
William Cheng
92b994496c Add CAM to company list (#2869) 2019-05-11 14:15:59 +08:00
William Cheng
0994ec3909 update ts rxjs samples 2019-05-11 12:19:08 +08:00
Patrick Ruckstuhl
a91130d6b4 Update README.mustache (#2866)
Fixed wrong reference to fetch instead of rxjs
2019-05-11 11:48:31 +08:00
Vincent Devos
ef26ce68d4 [Kotlin] client improvement / remove WildCards in client/server (#2862) 2019-05-11 11:42:11 +08:00
William Cheng
9323cad06b [Core] Minor enhancements (#2863)
* fix getcontenttype, better working for skipFormModel

* add tests for allof
2019-05-11 11:11:06 +08:00
Vincent Devos
98afbe062b [GROOVY] update client generator to a stable version (#2847)
* [GROOVY] update client generator to a stable version

* fix tab

* fix remove using invokerPackage

* fix test
2019-05-11 11:10:25 +08:00
Fabrizio Ferrai
48314905da [Haskell-Servant] Upgrade to Servant 0.16 (#2849) 2019-05-11 11:08:53 +08:00
Béres Zoltán
757fcfeac6 Fixed vertex ApiClient template (#2841)
* updated java/vertex ApiClient template

* update java samples
2019-05-10 00:56:39 +08:00
Hemant Zope
8e91b8c62a [core] add support for model as query params (#2489)
* add support for model as query params

* add logging incase of multiple schemas are present
2019-05-09 15:31:58 +08:00
Vincent Devos
70108b753e [JAVA] fix artifactVersion is not taken from specification (#2798)
* [JAVA] fix artifactVersion is not taken from specification when not provided by generator option

* update jaxrs-spec samples

* update docs generator jaxrs
2019-05-09 15:19:52 +08:00
Fabrizio Ferrai
0ef579363d [haskell-servant] Fix parsing of special characters (#2676) 2019-05-09 15:08:51 +08:00
William Cheng
99e352af46 comment out elm script in ensure uptodate 2019-05-09 14:53:20 +08:00
Jon Rimmer
6d1a91e3c1 [Typescript] Warn about unset post-processing param (#2843) 2019-05-09 14:39:55 +08:00
Slavek Kabrda
21b8160d00 [Golang][client] Make it possible to generate go.mod and go.sum files - fixes #2796 (#2813) 2019-05-08 14:52:17 +08:00
Thiago Arrais
f2b1f770f8 [go] fix multipart for non-file inputs (#2792)
* [go] fix multipart for non-file inputs

* update relevant sample client
2019-05-08 11:19:06 +08:00
Matthieu Berthomé
ee43cc1520 handle composed schemas in InlineModelResolver (#2112)
* handle composed schemas in InlineModelResolver

* fix unit test -> TestUtils.parseSpec

* update samples

* fix samples

* update samples

* update samples

* add new files
2019-05-08 10:19:15 +08:00
fj-roman
7eb2be9c99 [Kotlin] add apiSuffix configuration (#2690)
* add apiSuffix configuration

* Add default value for Api suffix

* remove overriding method toApiName

* refactor the global option apiSuffix to kotlin specific feature

* add missing Option for apiSuffix

* extend readme.md for apiSuffix configuration

* update doc

* add testcase
2019-05-07 21:37:32 +08:00
Matthieu Berthomé
f0346aeeb2 python: api_client: add the multipart files after sanitization (#2122)
* python: api_client: add the multipart files after sanitization

* simplify prepare_post_parameters

* fix case of both post params and files set

* update samples

* update samples
2019-05-07 21:27:01 +08:00
Vincent Devos
a4f2e15bb7 [TypescriptAngular] gets package npm version from API specification (#2810) 2019-05-07 18:50:36 +08:00
Richard Whitehouse
31734c2717 [Rust Server] Support octet stream body param (#2725)
Add support for having a required octet stream as a body parameter.
2019-05-07 18:45:07 +08:00
Jérémie Bresson
16f94e7e62 Update swagger-parser to version 2.0.13-OpenAPITools.org-1 (#2775) 2019-05-06 22:58:48 +02:00
Vincent Devos
97e4270c0b [Java] improve docs with adding default value for additional properties (#2770)
* [Java] improve docs with adding default value for additional properties

* remove using File.separator for sourceFolder/projectTestFolder path

* Improve artifactId and artifactVersion description

* update doc java pkmst and sample
2019-05-06 22:31:12 +08:00
William Cheng
4fa284ed5d Add Elm petstore scripts to ensure-uptodate script (#2823)
* update elm petstore samples

* add elm to ensure uptodate script

* add elm-format

* add symlink to elm-format
2019-05-06 22:19:59 +08:00
William Cheng
909d454f9d [F#] minor improvements (#2825)
* Add template owner of F#

Add template owner of F#

* rename fsharp-giraffe-server

* add nmfisher to tech committee

* update windows batch file

* update doc
2019-05-06 22:11:50 +08:00
Thibault Duperron
5e92ec1b4c Fix default value for container jaxrs (#2618)
* Fix default value for container jaxrs

Fix #2600

* Samples
2019-05-06 22:06:46 +08:00
Felix Sonntag
6283625478 [Python][R] Escape single quotes in strings (#2808) (#2809) 2019-05-06 22:04:05 +08:00
topce
632364e290 fix multiple file upload (#2735)
for typescript-angular client
https://swagger.io/docs/specification/describing-request-body/file-upload/
2019-05-06 22:03:11 +08:00
Jim Schubert
e34e85427b [gradle] Display non-Stable generator stability in parens on openApiGenerators task (#2826) 2019-05-06 08:35:34 -04:00
sunn
b186883217 Add Qt5 server on the list of supported C++ server stubs (#2829) 2019-05-06 19:18:48 +08:00
Jim Schubert
6e1c8976fc [feat] Intro GeneratorMetadata (stability index) (#2816)
* [feat] Intro GeneratorMetadata (stability index)

GeneratorMetadata offers an immutable object created via Builder pattern
which allows generators to explicitly define their stability (stable,
beta, experimental, deprecated) as well as a message to be shown during
generation.

This is a step toward:

* Fleshing out the "Core" artifact (#845)
* Providing a place to encapsulate feature-oriented metadata (#840)
* Providing a means to communicate end of life scheduling (#116)

This new structure, specifically the Stability property, allows us to
offer future enhancements such as allowing users to filter down to only
"Stable" generators via CLI, and eventually any compat table (see #503).

* Mark deprecated generators as deprecated in-code

* Re-export docs/generators.md
2019-05-05 16:54:22 -04:00
Jim Schubert
26d0487a2f [travis] Avoiding build timeouts, removing run-in-docker.sh (#2820)
* Removes run-in-docker.sh from travis build
* Updates run-in-docker.sh so it will cache to a volume-bound .m2/repository directory as intended
2019-05-05 15:15:18 -04:00
William Cheng
e8a83dfe1f Add beta server stub generator for F#/Giraffe (#2802)
* Beta server stub generator for F#/Giraffe (#2705)

* first commit for F#/Giraffe

use CLI generator

work on handlers

add binding to url params

add parameter declaration to handler & fix array types

order models by dependency and add tests

add oauth handlers

add service generation

add service implementation

return json for map types and add all return types to service implementation

pare down record types for readability

move implementations to impl folder

fix additional handler invocation

remove logging

remove open api type provider package reference

add sane defaults for OAuth

add readme and reorganize files for easier ignore

fix oauth checks and move login to default template

typedef operation body params as model

add API test templates

fix test templates

set project & other folders when packageName is set

add ignore to test pipes

add ignore for oauth to hide compile warnings

escape model types for generic dictionaries

remove Boolean object from primitives

fix handler and param templates for multiple path params

remove "Model" from model module names and fix import mapping for dictionary

add package name to model imports

change model templates to use imports

move login to CustomHandlers

raise exception where oauth not properly configured

allow webhost configuration from CustomHandlers

remove explicit support for nullable types and render option in template instead

move Cookie options to CustomHandlers

add header params

integrate api key provider

add nullable to datetime types

fix test generation and pretty up model folder

add context path to handler test template

dont copy spec file

remove superseded copyright notices

remove superseded copyright notices

* remove carriage return in fsharp template

* remove superseded sample output directory

* fix bash build script

* update generated sample

* update documentation

* add new file

* fix compile issues
2019-05-06 01:30:51 +08:00
William Cheng
3c8d820e3a resize lightbow logo 2019-05-05 18:57:57 +08:00
William Cheng
9009538944 add lightbow logo 2019-05-05 18:17:14 +08:00
William Cheng
d0f537c0e7 add Lightbow as sponsor (#2822) 2019-05-05 18:14:27 +08:00
Jim Schubert
a02cb19d31 [docs] Document new templating engine, adding ability to reference templates by file to comlete the example (#2773) 2019-05-05 18:03:28 +08:00
Vincent Devos
c33547e0f1 [JAVA][KOTLIN] fix var Naming for all uppercase with Numbers (#2794) 2019-05-05 17:41:06 +08:00
Jonas DOREL
f2f12b9e04 [Documentation] Add instructions to build the javascript client module (#2806)
* Add instructions to build the module

* Updated samples
2019-05-05 17:32:05 +08:00
William Cheng
92eacdfda9 use mvn instead of run-in-docker (#2821) 2019-05-05 16:59:11 +08:00
William Cheng
9c89e6af25 Better handling of form data (#2818)
* better warning message, better handling of form payload

* fix form data detection

* better format
2019-05-05 16:05:18 +08:00
Fabrizio Ferrai
250e5284cd [haskell-servant] Add some missing types to the generated modules (#2675)
* Add some missing types to the generated modules

* Run bin/openapi3 script
2019-05-04 17:05:15 -05:00
Jim Schubert
9dcab9de6b Clarifies need to build project for sample output (#2819)
PR template seems to assume contributor is compiling the project, and would have had "latest" build completed locally. New contributors making template or documentation changes may not have built the project at all, and wouldn't know to do so based on previous PR template instructions.
2019-05-04 14:39:57 -04:00
Andy
6b94aba8a1 [Elm] Bugfix .encode in modelTypeDiscriminator (#2807)
The function is called `encode`. This fixed the call.

See dfa7e616c0/modules/openapi-generator/src/main/resources/elm/modelTypeArray.mustache (L11)
2019-05-04 15:24:47 +02:00
Jim Schubert
73d9d2d641 Apply strict spec option to CodegenConfig instance (#2814) 2019-05-03 19:32:05 -04:00
sunn
561c1e0646 Use super class methods for Model and Api Filenames (#2787) 2019-05-03 19:14:12 +02:00
Jim Schubert
a2fb88c1c1 [all] Adds strict spec option (#2783)
* [all] Adds strict spec option

Introduces an option to allow user customization of strict specification
behaviors. For instance, OpenAPI 3.x requires a path object name to be
prefixed with '/' so we append any missing '/', but this may not be
desirable to some users or generators. In this commit, this fix specifically is
the only modification affected.

* Clarify strict-spec docs, add option to README.md

* Update CLI options in docs/usage.md
2019-05-03 10:57:47 -04:00
William Cheng
e71eb3020c add warning about .net 2.0 framework without support (#2804) 2019-05-03 22:44:39 +08:00
Jérémie Bresson
814d5b3cc2 [java] add test for Enum_Test (#2801) 2019-05-03 10:15:34 +02:00
Vincent Devos
bd0d6af968 [TypeScript-axios] fix using withSeparateModelsAndApi and withoutPrefixEnums with additional-properties option (#2719) 2019-05-03 11:40:20 +08:00
sunn
d373cde1df [ASP.NET Core]Switch registry to MCR for dotnet images (#2789)
* Switch registry to MCR for dotnet images

* Update PetStore

* Reverted EOL image tag 2.0
2019-05-02 19:23:01 +02:00
sunn
d112eea088 Process server port (#2782) 2019-05-02 19:22:23 +02:00
sunn
1c16d9a9e8 [C++][Pistache]Fix import of model header (#2781)
* Fix import of model header

* use method from super class
2019-05-02 19:20:23 +02:00
Jim Schubert
bd775a992c [general] Remove swagger-codegen "lang" mappings (#2785)
For 4.0.0, we've removed the "lang" option. This removes any mappings
from swagger-codegen "lang" to openapi-generator "generator" options.
2019-05-02 17:53:41 +08:00
Alexis Yushin
4b414d81d4 dart2: Do not add non-nullable fields to model json (#2777)
* do not add non-nullable fields to model json

This fix would avoid adding and sending fields that are not isNullable in the request.

* updated sample for issue #2535
2019-05-02 16:31:38 +08:00
Erik Timmers
006cfa35e6 [elm] Fix repetitive enum prefixes (#2784)
Fixes #2759.
2019-05-02 10:05:39 +02:00
SalDiAngelus
f9d04c9c23 Fixed checking for optional properties when converting from json. (#2779) 2019-05-01 23:18:38 +02:00
sunn
1fddb69960 Allow socket address reuse option (#2780) 2019-05-01 23:16:53 +02:00
William Cheng
05053f5b8a [ASP.NET Core] minor format fix, better null check (#2778)
* aspnet core format fix, better null check

* minor wording change

* update doc
2019-05-01 16:55:14 -04:00
3536 changed files with 30248 additions and 5181 deletions

View File

@@ -1,7 +1,7 @@
### PR checklist
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
- [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh`, `./bin/openapi3/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`.
- [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh`, `./bin/openapi3/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`. If contributing template-only or documentation-only changes which will change sample output, be sure to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) first.
- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`~~, `3.4.x`, `4.0.x`~~. Default: `master`.
- [ ] Copied the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.

6
.gitignore vendored
View File

@@ -39,7 +39,9 @@ packages/
/target
/generated-files
test-output/
nbactions.xml
test-output/
# website
website/build/
@@ -173,12 +175,14 @@ samples/client/petstore/typescript-angular/tsd-debug.log
# aspnetcore
samples/server/petstore/aspnetcore/.vs/
effective.pom
# kotlin
samples/client/petstore/kotlin/src/main/kotlin/test/
samples/client/petstore/kotlin-threetenbp/build
samples/client/petstore/kotlin-string/build
samples/server/petstore/kotlin-server/ktor/build
samples/openapi3/client/petstore/kotlin/build
samples/server/petstore/kotlin-server/ktor/build
samples/server/petstore/kotlin-springboot/build
\?
# haskell

View File

@@ -3,6 +3,10 @@ language: java
jdk:
- openjdk8
# See https://docs.travis-ci.com/user/languages/java/#caching
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.m2
@@ -121,8 +125,9 @@ script:
# fail if generators contain tab '\t'
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
# run integration tests defined in maven pom.xml
- ./run-in-docker.sh mvn --quiet --batch-mode clean install
- mvn --quiet --batch-mode verify -Psamples
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
- mvn --quiet --batch-mode --show-version clean install
- mvn --quiet --batch-mode --show-version verify -Psamples
after_success:
# push to maven repo
- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
@@ -162,3 +167,4 @@ after_success:
env:
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5

View File

@@ -18,6 +18,13 @@ elif [ "$NODE_INDEX" = "2" ]; then
if [[ $project_version == *"-SNAPSHOT" ]]; then
echo "Running node $NODE_INDEX to test ensure-up-to-date"
java -version
# install elm-format for formatting elm code
npm install -g elm-format
# symlink elm-format
sudo ln -s /opt/circleci/.nvm/versions/node/v12.1.0/bin/elm-format /usr/local/bin/elm-format
./bin/utils/ensure-up-to-date
fi
#elif [ "$NODE_INDEX" = "3" ]; then

View File

@@ -0,0 +1,7 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- This directory matches what is defined in run-in-docker.sh -->
<localRepository>/var/maven/.m2/repository</localRepository>
</settings>

View File

@@ -40,15 +40,15 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
#### Thank you to our bronze sponsors!
[![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)
## Overview
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (both 2.0 and 3.0 are supported). Currently, the following languages/frameworks are supported:
| | Languages/Frameworks |
|-|-|
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **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 - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **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 - 7.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, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
**API documentation generators** | **HTML**, **Confluence Wiki**
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
**Others** | **GraphQL**, **JMeter**, **MySQL Schema**
@@ -88,8 +88,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
OpenAPI Generator Version | Release Date | Notes
---------------------------- | ------------ | -----
4.0.0 (upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| 20.12.2018 | Major release with breaking changes (with or without fallback)
[3.3.4](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.3.4) (latest stable release) | 30.11.2018 | Bugfix release
[4.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.0.0) (latest stable release) | 13.05.2019 | Major release with breaking changes (with or without fallback)
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
@@ -145,16 +144,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar`
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.0/openapi-generator-cli-4.0.0.jar`
For **Mac/Linux** users:
```sh
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar -O openapi-generator-cli.jar
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.0/openapi-generator-cli-4.0.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.0/openapi-generator-cli-4.0.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -214,7 +213,7 @@ To build from source, you need the following installed and available in your `$P
* [Java 8](http://java.oracle.com)
* [Apache maven 3.3.4 or greater](http://maven.apache.org/)
* [Apache Maven 3.3.4 or greater](http://maven.apache.org/)
After cloning the project, you can build it from source with this command:
```sh
@@ -357,10 +356,10 @@ npm install @openapitools/openapi-generator-cli -g
openapi-generator version
```
Or install a particualar OpenAPI Generator version (e.g. v3.3.4):
Or install a particualar OpenAPI Generator version (e.g. v4.0.0):
```sh
npm install @openapitools/openapi-generator-cli@cli-3.3.4 -g
npm install @openapitools/openapi-generator-cli@cli-4.0.0 -g
```
Or install it as dev-dependency:
@@ -383,7 +382,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`)
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar)
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.0/openapi-generator-cli-4.0.0.jar)
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@@ -447,6 +446,7 @@ SYNOPSIS
[--remove-operation-id-prefix]
[--reserved-words-mappings <reserved word mappings>...]
[(-s | --skip-overwrite)] [--skip-validate-spec]
[--strict-spec <true/false strict behavior>]
[(-t <template directory> | --template-dir <template directory>)]
[--type-mappings <type mappings>...] [(-v | --verbose)]
@@ -519,6 +519,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [BIMData.io](https://bimdata.io)
- [Bithost GmbH](https://www.bithost.ch)
- [Boxever](https://www.boxever.com/)
- [CAM](https://www.cam-inc.co.jp/)
- [Camptocamp](https://www.camptocamp.com/en)
- [codecentric AG](https://www.codecentric.de/)
- [Cupix](https://www.cupix.com/)
@@ -596,7 +597,6 @@ OpenAPI Generator core team members are contributors who have been making signif
Here is a list of template creators:
* API Clients:
* Ada: @stcarrez
* Akka-Scala: @cchafer
* Apex: @asnelling
* Bash: @bkryza
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
@@ -642,6 +642,7 @@ Here is a list of template creators:
* Rust: @farcaller
* Rust (rust-server): @metaswitch
* Scala (scalaz & http4s): @tbrown1979
* Scala (Akka): @cchafer
* Swift: @tkqubo
* Swift 3: @hexelon
* Swift 4: @ehyche
@@ -662,6 +663,7 @@ Here is a list of template creators:
* C++ Pistache: @sebymiano
* C++ Restbed: @stkrwork
* Erlang Server: @galaxie
* F# (Giraffe) Server: @nmfisher
* Go Server: @guohuang
* Go (Gin) Server: @kemokemo
* GraphQL Express Server: @renepardon
@@ -744,6 +746,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Elixir | @mrmstn (2018/12) |
| Elm | @eriktim (2018/09) |
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
| F# | @nmfisher (2019/05) |
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) @kemokemo (2018/09 |
| GraphQL | @renepardon (2018/12) |
| Groovy | |

View File

@@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} $@"
ags="generate -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/2.1/ -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -25,8 +25,11 @@ then
mvn -B clean package
fi
# auto format elm code using elm-format
export ELM_POST_PROCESS_FILE="/usr/local/bin/elm-format --elm-version=0.18 --yes"
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm-0.18 --additional-properties elmVersion=0.18 $@"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm-0.18 --additional-properties elmVersion=0.18 --enable-post-process-file $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -25,8 +25,11 @@ then
mvn -B clean package
fi
# auto format elm code using elm-format
export ELM_POST_PROCESS_FILE="/usr/local/bin/elm-format --elm-version=0.19 --yes"
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm $@"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm --enable-post-process-file $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,32 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/fsharp-giraffe-server -g fsharp-giraffe-server -o samples/server/petstore/fsharp-giraffe $@"
java ${JAVA_OPTS} -jar ${executable} ${ags}

View File

@@ -27,5 +27,5 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g groovy -o samples/client/petstore/groovy -DhideGenerationTimestamp=true $@"
ags="generate -t modules/openapi-generator/src/main/resources/Groovy/ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g groovy -o samples/client/petstore/groovy -DhideGenerationTimestamp=true $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g akka-scala -o samples/client/petstore/scala-akka $@"
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala -o samples/client/petstore/scala-httpclient $@"
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-httpclient-deprecated -o samples/client/petstore/scala-httpclient $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -52,6 +52,8 @@ declare -a scripts=(
"./bin/elixir-petstore.sh"
"./bin/go-petstore.sh"
"./bin/go-gin-petstore-server.sh"
"./bin/groovy-petstore.sh"
#"./bin/elm-petstore-all.sh"
"./bin/meta-codegen.sh"
# OTHERS
"./bin/utils/export_docs_generators.sh"

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 "fsharp-giraffe-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g fsharp-giraffe-server -o samples\server\petstore\fsharp-giraffe
java %JAVA_OPTS% -jar %executable% %ags%

View File

@@ -16,7 +16,7 @@ The following generators are available:
- [cpp-restsdk](generators/cpp-restsdk.md)
- [cpp-tizen](generators/cpp-tizen.md)
- [csharp](generators/csharp.md)
- [csharp-dotnet2](generators/csharp-dotnet2.md)
- [csharp-dotnet2](generators/csharp-dotnet2.md) (deprecated)
- [csharp-netcore](generators/csharp-netcore.md)
- [dart](generators/dart.md)
- [dart-jaguar](generators/dart-jaguar.md)
@@ -47,10 +47,10 @@ The following generators are available:
- [rust](generators/rust.md)
- [scala-akka](generators/scala-akka.md)
- [scala-gatling](generators/scala-gatling.md)
- [scala-httpclient-deprecated](generators/scala-httpclient-deprecated.md)
- [scala-httpclient-deprecated](generators/scala-httpclient-deprecated.md) (deprecated)
- [scalaz](generators/scalaz.md)
- [swift2-deprecated](generators/swift2-deprecated.md)
- [swift3-deprecated](generators/swift3-deprecated.md)
- [swift2-deprecated](generators/swift2-deprecated.md) (deprecated)
- [swift3-deprecated](generators/swift3-deprecated.md) (deprecated)
- [swift4](generators/swift4.md)
- [typescript-angular](generators/typescript-angular.md)
- [typescript-angularjs](generators/typescript-angularjs.md)
@@ -71,6 +71,7 @@ The following generators are available:
- [cpp-restbed-server](generators/cpp-restbed-server.md)
- [csharp-nancyfx](generators/csharp-nancyfx.md)
- [erlang-server](generators/erlang-server.md)
- [fsharp-giraffe-server](generators/fsharp-giraffe-server.md)
- [go-gin-server](generators/go-gin-server.md)
- [go-server](generators/go-server.md)
- [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md)

View File

@@ -28,6 +28,6 @@ sidebar_label: aspnetcore
|operationModifier|Operation Modifier can be virtual, abstract or partial| |virtual|
|buildTarget|Target to build an application or library| |program|
|generateBody|Generates method body.| |true|
|operationIsAsync|Set methods to async or sync.| |false|
|operationIsAsync|Set methods to async or sync (default).| |false|
|operationResultTask|Set methods result to Task&lt;&gt;.| |false|
|modelClassModifier|Model Class Modifier can be nothing or partial| |partial|

View File

@@ -19,5 +19,5 @@ sidebar_label: cwiki
|licenseUrl|a URL pointing to the full license| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null|

View File

@@ -13,5 +13,5 @@ sidebar_label: dynamic-html
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null|

View File

@@ -0,0 +1,25 @@
---
id: generator-opts-server-fsharp-giraffe-server
title: Config Options for fsharp-giraffe-server
sidebar_label: fsharp-giraffe-server
---
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|licenseUrl|The URL of the license| |http://localhost|
|licenseName|The name of the license| |NoLicense|
|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright|
|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI|
|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library|
|packageName|F# module name (convention: Title.Case).| |OpenAPI|
|packageVersion|F# package version.| |1.0.0|
|packageGuid|The GUID that will be associated with the C# project| |null|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false|
|generateBody|Generates method body.| |true|
|buildTarget|Target the build for a program or library.| |program|

View File

@@ -0,0 +1,25 @@
---
id: generator-opts-server-fsharp-giraffe
title: Config Options for fsharp-giraffe
sidebar_label: fsharp-giraffe
---
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|licenseUrl|The URL of the license| |http://localhost|
|licenseName|The name of the license| |NoLicense|
|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright|
|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI|
|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library|
|packageName|F# module name (convention: Title.Case).| |OpenAPI|
|packageVersion|F# package version.| |1.0.0|
|packageGuid|The GUID that will be associated with the C# project| |null|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false|
|generateBody|Generates method body.| |true|
|buildTarget|Target the build for a program or library.| |program|

View File

@@ -11,35 +11,34 @@ sidebar_label: groovy
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-groovy|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/groovy|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|configPackage|configuration package for generated code| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|

View File

@@ -19,5 +19,5 @@ sidebar_label: html
|licenseUrl|a URL pointing to the full license| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null|

View File

@@ -23,5 +23,5 @@ sidebar_label: html2
|pythonPackageName|package name for generated python code| |null|
|packageName|C# package name| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null|

View File

@@ -11,34 +11,34 @@ sidebar_label: java-inflector
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.controllers|
|invokerPackage|root package for generated code| |org.openapitools.controllers|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-inflector-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/gen/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|

View File

@@ -11,39 +11,39 @@ sidebar_label: java-msf4j
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>Jersey core 1.x</dd><dt>**jersey2**</dt><dd>Jersey core 2.x</dd><dl>|jersey2|
|serverPort|The port on which the server should be started| |8080|
|library|library template (sub-template)|<dl><dt>**jersey1**</dt><dd>Jersey core 1.x</dd><dt>**jersey2**</dt><dd>Jersey core 2.x</dd><dl>|jersey2|

View File

@@ -11,40 +11,37 @@ sidebar_label: java-pkmst
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |com.prokarma.pkmst.model|
|apiPackage|package for generated api classes| |com.prokarma.pkmst.controller|
|invokerPackage|root package for generated code| |com.prokarma.pkmst.controller|
|groupId|groupId in generated pom.xml| |com.prokarma|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |pkmst-microservice|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|threetenbp|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|basePackage|base package for java source code| |null|
|serviceName|Service Name| |null|
|title|server title name or client service name| |null|

View File

@@ -11,40 +11,40 @@ sidebar_label: java-play-framework
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |apimodels|
|apiPackage|package for generated api classes| |controllers|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-playframework|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |/app|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|threetenbp|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|title|server title name or client service name| |null|
|configPackage|configuration package for generated code| |null|
|basePackage|base package for generated code| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|title|server title name or client service name| |openapi-java-playframework|
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|basePackage|base package for generated code| |org.openapitools|
|controllerOnly|Whether to generate only API interface stubs without the server files.| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useInterfaces|Makes the controllerImp implements an interface to facilitate automatic completion when updating from version x to y of your spec| |true|

View File

@@ -13,32 +13,32 @@ sidebar_label: java-undertow-server
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|invokerPackage|root package for generated code| |org.openapitools.handler|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-undertow-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|

View File

@@ -11,36 +11,36 @@ sidebar_label: java-vertx
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.server.api.model|
|apiPackage|package for generated api classes| |org.openapitools.server.api.verticle|
|invokerPackage|root package for generated code| |org.openapitools|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-vertx-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|java8|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|rxInterface|When specified, API interfaces are generated with RX and methods return Single&lt;&gt; and Comparable.| |false|
|vertxSwaggerRouterVersion|Specify the version of the swagger router library| |null|

View File

@@ -11,37 +11,37 @@ sidebar_label: java
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.client.model|
|apiPackage|package for generated api classes| |org.openapitools.client.api|
|invokerPackage|root package for generated code| |org.openapitools.client|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|threetenbp|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false|
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false|
|parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false|

View File

@@ -11,42 +11,42 @@ sidebar_label: jaxrs-cxf-cdi
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-cxf-cdi-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/gen/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|library|library template (sub-template) to use|<dl><dt>**&lt;default&gt;**</dt><dd>JAXRS</dd><dl>|&lt;default&gt;|
|serverPort|The port on which the server should be started| |8080|
|library|library template (sub-template)|<dl><dt>**&lt;default&gt;**</dt><dd>JAXRS</dd><dl>|&lt;default&gt;|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false|

View File

@@ -11,37 +11,37 @@ sidebar_label: jaxrs-cxf-client
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-client|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/gen/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|useBeanValidation|Use BeanValidation API annotations| |false|
|useGzipFeatureForTests|Use Gzip Feature for tests| |false|
|useLoggingFeatureForTests|Use Logging Feature for tests| |false|

View File

@@ -11,41 +11,41 @@ sidebar_label: jaxrs-cxf-extended
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|serverPort|The port on which the server should be started| |8080|
|generateSpringApplication|Generate Spring application| |false|
|useSpringAnnotationConfig|Use Spring Annotation Config| |false|
|useSwaggerFeature|Use Swagger Feature| |false|

View File

@@ -11,41 +11,41 @@ sidebar_label: jaxrs-cxf
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|serverPort|The port on which the server should be started| |8080|
|generateSpringApplication|Generate Spring application| |false|
|useSpringAnnotationConfig|Use Spring Annotation Config| |false|
|useSwaggerFeature|Use Swagger Feature| |false|

View File

@@ -11,41 +11,41 @@ sidebar_label: jaxrs-jersey
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>Jersey core 1.x</dd><dt>**jersey2**</dt><dd>Jersey core 2.x</dd><dl>|jersey2|
|serverPort|The port on which the server should be started| |8080|
|library|library template (sub-template)|<dl><dt>**jersey1**</dt><dd>Jersey core 1.x</dd><dt>**jersey2**</dt><dd>Jersey core 2.x</dd><dl>|jersey2|
|supportJava6|Whether to support Java6 with the Jersey1/2 library.| |false|
|useTags|use tags for creating interface and controller classnames| |false|

View File

@@ -11,41 +11,41 @@ sidebar_label: jaxrs-resteasy-eap
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-resteasy-eap-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|serverPort|The port on which the server should be started| |8080|
|useBeanValidation|Use BeanValidation API annotations| |true|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true|
|useSwaggerFeature|Use dynamic Swagger generator| |false|

View File

@@ -11,39 +11,39 @@ sidebar_label: jaxrs-resteasy
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-resteasy-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|serverPort|The port on which the server should be started| |8080|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|

View File

@@ -11,42 +11,42 @@ sidebar_label: jaxrs-spec
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|legacy|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|implFolder|folder for generated implementation code| |null|
|title|a title describing the application| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|implFolder|folder for generated implementation code| |src/main/java|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
|serverPort|The port on which the server should be started| |null|
|library|library template (sub-template) to use|<dl><dt>**&lt;default&gt;**</dt><dd>JAXRS</dd><dl>|&lt;default&gt;|
|serverPort|The port on which the server should be started| |8080|
|library|library template (sub-template)|<dl><dt>**&lt;default&gt;**</dt><dd>JAXRS</dd><dl>|&lt;default&gt;|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false|

View File

@@ -8,13 +8,14 @@ sidebar_label: kotlin-server
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|sourceFolder|source folder for generated code| |src/main/kotlin|
|packageName|Generated artifact package name.| |org.openapitools|
|packageName|Generated artifact package name.| |org.openapitools.server|
|apiSuffix|suffix for api classes| |Api|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|artifactId|Generated artifact id (name of jar).| |null|
|artifactId|Generated artifact id (name of jar).| |kotlin-server|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|library|library template (sub-template) to use|<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|
|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|
|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true|

View File

@@ -9,8 +9,9 @@ sidebar_label: kotlin-spring
| ------ | ----------- | ------ | ------- |
|sourceFolder|source folder for generated code| |src/main/kotlin|
|packageName|Generated artifact package name.| |org.openapitools|
|apiSuffix|suffix for api classes| |Api|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|artifactId|Generated artifact id (name of jar).| |null|
|artifactId|Generated artifact id (name of jar).| |openapi-spring|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
@@ -25,4 +26,4 @@ sidebar_label: kotlin-spring
|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false|
|serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false|
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
|library|library template (sub-template) to use|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application.</dd><dl>|spring-boot|
|library|library template (sub-template)|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application.</dd><dl>|spring-boot|

View File

@@ -8,11 +8,12 @@ sidebar_label: kotlin
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|sourceFolder|source folder for generated code| |src/main/kotlin|
|packageName|Generated artifact package name.| |org.openapitools|
|packageName|Generated artifact package name.| |org.openapitools.client|
|apiSuffix|suffix for api classes| |Api|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|artifactId|Generated artifact id (name of jar).| |null|
|artifactId|Generated artifact id (name of jar).| |kotlin-client|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310</dd><dt>**threetenbp**</dt><dd>Threetenbp</dd><dl>|null|
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd><dl>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310</dd><dt>**threetenbp**</dt><dd>Threetenbp</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|

View File

@@ -11,40 +11,40 @@ sidebar_label: spring
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|modelPackage|package for generated models| |null|
|apiPackage|package for generated api classes| |null|
|invokerPackage|root package for generated code| |null|
|groupId|groupId in generated pom.xml| |null|
|artifactId|artifactId in generated pom.xml| |null|
|artifactVersion|artifact version in generated pom.xml| |null|
|artifactUrl|artifact URL in generated pom.xml| |null|
|artifactDescription|artifact description in generated pom.xml| |null|
|scmConnection|SCM connection in generated pom.xml| |null|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |null|
|scmUrl|SCM URL in generated pom.xml| |null|
|developerName|developer name in generated pom.xml| |null|
|developerEmail|developer email in generated pom.xml| |null|
|developerOrganization|developer organization in generated pom.xml| |null|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|licenseName|The name of the license| |null|
|licenseUrl|The URL of the license| |null|
|sourceFolder|source folder for generated code| |null|
|modelPackage|package for generated models| |org.openapitools.model|
|apiPackage|package for generated api classes| |org.openapitools.api|
|invokerPackage|root package for generated code| |org.openapitools.api|
|groupId|groupId in generated pom.xml| |org.openapitools|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-spring|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|sourceFolder|source folder for generated code| |src/main/java|
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
|hideGenerationTimestamp|hides the timestamp when files were generated| |null|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|null|
|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>|null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd><dl>|threetenbp|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd><dl>|false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|booleanGetterPrefix|Set booleanGetterPrefix (default value 'get')| |null|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|snapshotVersion|Uses a SNAPSHOT version.| |null|
|title|server title name or client service name| |null|
|configPackage|configuration package for generated code| |null|
|basePackage|base package (invokerPackage) for generated code| |null|
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd><dl>|null|
|title|server title name or client service name| |OpenAPI Spring|
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false|
@@ -62,4 +62,4 @@ sidebar_label: spring
|useOptional|Use Optional container for optional parameters| |false|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
|returnSuccessCode|Generated server returns 2xx code| |false|
|library|library template (sub-template) to use|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application using the SpringFox integration.</dd><dt>**spring-mvc**</dt><dd>Spring-MVC Server application using the SpringFox integration.</dd><dt>**spring-cloud**</dt><dd>Spring-Cloud-Feign client with Spring-Boot auto-configured settings.</dd><dl>|spring-boot|
|library|library template (sub-template)|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application using the SpringFox integration.</dd><dt>**spring-mvc**</dt><dd>Spring-MVC Server application using the SpringFox integration.</dd><dt>**spring-cloud**</dt><dd>Spring-Cloud-Feign client with Spring-Boot auto-configured settings.</dd><dl>|spring-boot|

View File

@@ -14,15 +14,15 @@ sidebar_label: typescript-angular
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|supportsES6|Generate code that conforms to ES6.| |false|
|npmName|The name under which you want to publish generated npm package. Required to generate a full angular package| |null|
|npmVersion|The version of your npm package. Default is '1.0.0'| |null|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|snapshot|When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).| |false|
|ngVersion|The version of Angular. Default is '7.0.0'| |null|
|serviceSuffix|The suffix of the generated service. Default is 'Service'.| |null|
|serviceFileSuffix|The suffix of the file of the generated service (service&lt;suffix&gt;.ts). Default is '.service'.| |null|
|modelSuffix|The suffix of the generated model. Default is ''.| |null|
|modelFileSuffix|The suffix of the file of the generated model (model&lt;suffix&gt;.ts). Default is ''.| |null|
|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'. Default is 'camelCase'.| |null|
|ngVersion|The version of Angular.| |7.0.0|
|serviceSuffix|The suffix of the generated service.| |Service|
|serviceFileSuffix|The suffix of the file of the generated service (service&lt;suffix&gt;.ts).| |.service|
|modelSuffix|The suffix of the generated model.| |null|
|modelFileSuffix|The suffix of the file of the generated model (model&lt;suffix&gt;.ts).| |null|
|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase|

View File

@@ -15,8 +15,8 @@ sidebar_label: typescript-axios
|supportsES6|Generate code that conforms to ES6.| |false|
|npmName|The name under which you want to publish generated npm package| |null|
|npmVersion|The version of your npm package| |null|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null|
|snapshot|When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes| |false|
|withoutPrefixEnums|Dont prefix enum names with class names| |false|
|withoutPrefixEnums|Don't prefix enum names with class names| |false|

View File

@@ -18,7 +18,7 @@ The transform logic needs to implement [CodegenConfig.java](https://github.com/o
> * Maven Plugin: `templateDirectory`
> * Gradle Plugin: `templateDir`
Built-in templates are written in Mustache and processed by [jmustache](https://github.com/samskivert/jmustache). We plan to eventually support Handlebars and user-defined template engines via plugins.
Built-in templates are written in Mustache and processed by [jmustache](https://github.com/samskivert/jmustache). Beginning with version 4.0.0, we support experimental Handlebars and user-defined template engines via plugins.
OpenAPI Generator supports user-defined templates. This approach is often the easiest when creating a custom template. Our generators implement a combination of language and framework features, and it's fully possible to use an existing generator to implement a custom template for a different framework. Suppose you have internal utilities which you'd like to incorporate into generated code (e.g. logging, monitoring, fault-handling)... this is easy to add via custom templates.
@@ -261,6 +261,165 @@ Congratulations! You've now modified one of the built-in templates to meet your
Adding/modifying template logic simply requires a little bit of [mustache](https://mustache.github.io/), for which you can use existing templates as a guide.
### Custom Engines
> Custom template engine support is *experimental*
If Mustache or the experimental Handlebars engines don't suit your needs, you can define an adapter to your templating engine of choice. To do this, you'll need to define a new project which consumes the `openapi-generator-core` artifact, and at a minimum implement `TemplatingEngineAdapter`.
This example:
* creates an adapter providing the fundamental logic to compile [Pebble Templates](https://pebbletemplates.io)
* will be implemented in Kotlin to demonstrate ServiceLoader configuration specific to Kotlin (Java will be similar)
* requires Gradle 5.0+
* provides project setup instructions for IntelliJ
To begin, create a [new Gradle project](https://www.jetbrains.com/help/idea/getting-started-with-gradle.html) with Kotlin support. To do this, go to `File``New``Project`, choose "Gradle" and "Kotlin". Specify groupId `org.openapitools.examples` and artifactId `pebble-template-adapter`.
Ensure the new project uses Gradle 5.0. Navigate to the newly created directory and execute:
```bash
gradle wrapper --gradle-version 5.0
```
In `build.gradle`, we'll add a dependency for OpenAPI Tools core which defines the interface and an abstract helper type for implementing the adapter. We'll also pull in the Pebble artifact. We'll be evaluating this new artifact locally, so we'll also add the Maven plugin for installing to the local maven repository. We'll also create a fatjar using the `shadow` plugin to simplify our classpath.
Modifications to the new project's `build.gradle` should be made in the `plugins` and `dependencies` nodes:
```diff
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.11'
id "com.github.johnrengelman.shadow" version "5.0.0"
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile "org.openapitools:openapi-generator-core:4.0.0-SNAPSHOT"
compile "io.pebbletemplates:pebble:3.0.8"
}
```
The above configuration for the `shadow` plugin is strictly optional. It is not needed, for instance, if you plan to publish your adapter and consume it via the Maven or Gradle plugins.
Next, create a new class file called `PebbleTemplateEngineAdapter` under `src/kotlin`. We'll define the template adapter's name as `pebble` and we'll also list this as the only supported file extension. We'll implement the adapter by extending `AbstractTemplatingEngineAdapter`, which includes reusable logic, such as retrieving a list of all possible template names for our provided template extensions(s).
The class in its simplest form looks like this (with inline comments):
```kotlin
// Allows specifying engine by class name
// e.g. -e org.openapitools.examples.templating.PebbleTemplateAdapter
@file:JvmName("PebbleTemplateAdapter")
package org.openapitools.examples.templating
// imports
class PebbleTemplateAdapter : AbstractTemplatingEngineAdapter() {
// initialize the template compilation engine
private val engine: PebbleEngine = PebbleEngine.Builder()
.cacheActive(false)
.loader(DelegatingLoader(listOf(FileLoader(), ClasspathLoader())))
.build()
// allows targeting engine by id/name: -e pebble
override fun getIdentifier(): String = "pebble"
override fun compileTemplate(
generator: TemplatingGenerator?,
bundle: MutableMap<String, Any>?,
templateFile: String?
): String {
// This will convert, for example, model.mustache to model.pebble
val modifiedTemplate = this.getModifiedFileLocation(templateFile).first()
// Uses generator built-in template resolution strategy to find the full template file
val filePath = generator?.getFullTemplatePath(modifiedTemplate)
val writer = StringWriter()
// Conditionally writes out the template if found.
if (filePath != null) {
engine.getTemplate(filePath.toAbsolutePath().toString())?.evaluate(writer, bundle)
}
return writer.toString()
}
override fun getFileExtensions(): Array<String> = arrayOf("pebble")
}
```
Lastly, create a file `resources/META-INF/services/org.openapitools.codegen.api.TemplatingEngineAdapter`, containing the full class path to the above class:
```
org.openapitools.examples.templating.PebbleTemplateAdapter
```
This allows the adapter to load via ServiceLoader, and to be referenced via the identifier `pebble`. This is optional; if you don't provide the above file and contents, you'll only be able to load the engine via full class name (explained in a bit).
Now, build the fatjar for this new adapter:
```bash
./gradlew shadowJar
```
To test compilation of some templates, we'll need to first create one or more template files. Create a temp directory at `/tmp/pebble-example/templates` and add the following files.
*api.pebble*
```
package {{packageName}}
import (
"net/http"
{% for item in imports %}
"{{item.import}}"
{% endfor %}
)
type Generated{{classname}}Servicer
// etc
```
*model.pebble*
```
package {{packageName}}
{% for item in models %}
{% if item.isEnum %}
// TODO: enum
{% else %}
{% if item.description is not empty %}// {{item.description}}{% endif %}
type {{item.classname}} struct {
{% for var in item.model.vars %}
{% if var.description is not empty %}// {{var.description}}{% endif %}
{{var.name}} {% if var.isNullable %}*{% endif %}{{var.dataType}} `json:"{{var.baseName}}{% if var.required == false %},omitempty{% endif %}"{% if var.withXml == true %} xml:"{{var.baseName}}{% if var.isXmlAttribute %},attr{% endif %}"{% endif %}`
{% endfor %}
}
{% endif %}
{{model.name}}
{% endfor %}
```
> Find object structures passed to templates later in this document's **Structures** section.
Finally, we can compile some code by explicitly defining our classpath and jar entrypoint for CLI (be sure to modify `/your/path` below)
```bash
java $JAVA_OPTS -cp /your/path/build/libs/pebble-template-adapter-1.0-SNAPSHOT-all.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \
org.openapitools.codegen.OpenAPIGenerator \
generate \
-g go \
-i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/petstore-minimal.json \
-e pebble \
-o /tmp/pebble-example/out \
-t /tmp/pebble-example/templates \
-Dmodels -DmodelDocs=false -DmodelTests=false -Dapis -DapiTests=false -DapiDocs=false
```
Notice how we've targeted our custom template engine adapter via `-e pebble`. If you don't include the SPI file under `META-INF/services`, you'll need to specify the exact classpath: `org.openapitools.examples.templating.PebbleTemplateAdapter`. Notice that the target class here matches the Kotlin class name. This is because of the `@file:JvmName` annotation.
Congratulations on creating a custom templating engine adapter!
## Structures
Aside from transforming an API document, the implementing class gets to decide how to apply the data structure to templates. We can decide which data structure to apply to which template files. You have the following structures at your disposal.

View File

@@ -239,7 +239,9 @@ SYNOPSIS
[--api-package <api package>] [--artifact-id <artifact id>]
[--artifact-version <artifact version>]
[(-c <configuration file> | --config <configuration file>)]
[-D <system properties>...] [--enable-post-process-file]
[-D <system properties>...]
[(-e <templating engine> | --engine <templating engine>)]
[--enable-post-process-file]
[(-g <generator name> | --generator-name <generator name>)]
[--generate-alias-as-model] [--git-repo-id <git repo id>]
[--git-user-id <git user id>] [--group-id <group id>]
@@ -259,6 +261,7 @@ SYNOPSIS
[--remove-operation-id-prefix]
[--reserved-words-mappings <reserved word mappings>...]
[(-s | --skip-overwrite)] [--skip-validate-spec]
[--strict-spec <true/false strict behavior>]
[(-t <template directory> | --template-dir <template directory>)]
[--type-mappings <type mappings>...] [(-v | --verbose)]
@@ -289,9 +292,11 @@ OPTIONS
artifact version in generated pom.xml
-c <configuration file>, --config <configuration file>
Path to json configuration file. File content should be in a json
format {"optionKey":"optionValue", "optionKey1":"optionValue1"...}
Supported options can be different for each language. Run
Path to configuration file configuration file. It can be json or
yaml.If file is json, the content should have the format
{"optionKey":"optionValue", "optionKey1":"optionValue1"...}.If file
is yaml, the content should have the format optionKey:
optionValueSupported options can be different for each language. Run
config-help -g {generator name} command for language specific config
options.
@@ -299,11 +304,17 @@ OPTIONS
sets specified system properties in the format of
name=value,name=value (or multiple options, each with name=value)
-e <templating engine>, --engine <templating engine>
templating engine: "mustache" (default) or "handlebars" (beta)
--enable-post-process-file
enablePostProcessFile
-g <generator name>, --generator-name <generator name>
generator to use (see langs command for list)
generator to use (see list command for list)
--generate-alias-as-model
Generate alias to map, array as models
--git-repo-id <git repo id>
Git repo ID, e.g. openapi-generator.
@@ -354,6 +365,9 @@ OPTIONS
piping the JSON output of debug options (e.g. `-DdebugOperations`)
to an external parser directly while testing a generator.
--minimal-update
Only write output files that have changed.
--model-name-prefix <model name prefix>
Prefix that will be prepended to all model names. Default is the
empty string.
@@ -368,6 +382,9 @@ OPTIONS
-o <output directory>, --output <output directory>
where to write the generated files (current dir by default)
--package-name <package name>
package for generated classes (where supported)
--release-note <release note>
Release note, default to 'Minor update'.
@@ -386,12 +403,17 @@ OPTIONS
--skip-validate-spec
Skips the default behavior of validating an input specification.
--strict-spec <true/false strict behavior>
'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to.
e.g. when false, no fixes will be applied to documents which pass
validation but don't follow the spec.
-t <template directory>, --template-dir <template directory>
folder containing the template files
--type-mappings <type mappings>
sets mappings between OpenAPI spec types and generated code types in
the format of OpenaAPIType=generatedType,OpenAPIType=generatedType.
the format of OpenAPIType=generatedType,OpenAPIType=generatedType.
For example: array=List,map=Map,string=String. You can also have
multiple occurrences of this option.

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -214,6 +214,12 @@ public class Generate implements Runnable {
description = "Skips the default behavior of validating an input specification.")
private Boolean skipValidateSpec;
@Option(name = {"--strict-spec"},
title = "true/false strict behavior",
description = "'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec.",
arity = 1)
private Boolean strictSpecBehavior;
@Option(name = {"--log-to-stderr"},
title = "Log to STDERR",
description = "write all log messages (not just errors) to STDOUT."
@@ -368,10 +374,15 @@ public class Generate implements Runnable {
if (generateAliasAsModel != null) {
configurator.setGenerateAliasAsModel(generateAliasAsModel);
}
if (minimalUpdate != null) {
configurator.setEnableMinimalUpdate(minimalUpdate);
}
if (strictSpecBehavior != null) {
configurator.setStrictSpecBehavior(strictSpecBehavior);
}
applySystemPropertiesKvpList(systemProperties, configurator);
applyInstantiationTypesKvpList(instantiationTypes, configurator);
applyImportMappingsKvpList(importMappings, configurator);

View File

@@ -8,6 +8,8 @@ import io.airlift.airline.Option;
import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.CodegenConfigLoader;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
import java.util.Comparator;
import java.util.List;
@@ -70,16 +72,27 @@ public class ListGenerators implements Runnable {
sb.append(System.lineSeparator());
list.forEach(generator -> {
GeneratorMetadata meta = generator.getGeneratorMetadata();
if (docusaurus) {
sb.append("* ");
String id = "generators/" + generator.getName();
sb.append("[").append(generator.getName()).append("](").append(id).append(")");
sb.append("[").append(generator.getName());
if (meta != null && meta.getStability() != null && meta.getStability() != Stability.STABLE) {
sb.append(" (").append(meta.getStability().value()).append(")");
}
sb.append("](").append(id).append(")");
// trailing space is important for markdown list formatting
sb.append(" ");
} else {
sb.append(" - ");
sb.append(generator.getName());
if (meta != null && meta.getStability() != null && meta.getStability() != Stability.STABLE) {
sb.append(" (").append(meta.getStability().value()).append(")");
}
}
sb.append(System.lineSeparator());
});

View File

@@ -277,6 +277,26 @@ public class GenerateTest {
};
}
@Test
public void testStrictSpec() throws Exception {
setupAndRunGenericTest("--strict-spec", "true");
new FullVerifications() {
{
configurator.setStrictSpecBehavior(true);
times = 1;
}
};
setupAndRunGenericTest("--strict-spec", "false");
new FullVerifications() {
{
configurator.setStrictSpecBehavior(false);
times = 1;
}
};
}
@Test
public void testPackageName() throws Exception {
final String value = "io.foo.bar.baz";

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -13,4 +13,4 @@
<artifactId>openapi-generator-core</artifactId>
<name>openapi-generator-core</name>
<url>https://github.com/openapitools/openapi-generator</url>
</project>
</project>

View File

@@ -16,6 +16,8 @@
package org.openapitools.codegen.api;
import java.nio.file.Path;
/**
* interface to the full template content
* implementers might take into account the -t cli option,
@@ -25,9 +27,19 @@ public interface TemplatingGenerator {
/**
* returns the template content by name
*
* @param name the template name (e.g. model.mustache)
*
* @return the contents of that template
*/
String getFullTemplateContents(String name);
/**
* Returns the path of a template, allowing access to the template where consuming literal contents aren't desirable or possible.
*
* @param name the template name (e.g. model.mustache)
*
* @return The {@link Path} to the template
*/
Path getFullTemplatePath(String name);
}

View File

@@ -0,0 +1,99 @@
package org.openapitools.codegen.meta;
/**
* Represents metadata about a generator.
*/
public class GeneratorMetadata {
private Stability stability;
private String generationMessage;
private GeneratorMetadata(Builder builder) {
stability = builder.stability;
generationMessage = builder.generationMessage;
}
/**
* Creates a new builder object for {@link GeneratorMetadata}.
*
* @return A new builder instance.
*/
public static Builder newBuilder() {
return new Builder();
}
/**
* Creates a new builder object for {@link GeneratorMetadata}, accepting another instance from which to copy properties.
*
* @param copy An existing instance to copy defaults from
*
* @return A new builder instance, with values preset to those of 'copy'.
*/
public static Builder newBuilder(GeneratorMetadata copy) {
Builder builder = new Builder();
if (copy != null) {
builder.stability = copy.getStability();
builder.generationMessage = copy.getGenerationMessage();
}
return builder;
}
/**
* Returns a message which can be displayed during generation.
*
* @return A message, if defined.
*/
public String getGenerationMessage() {
return generationMessage;
}
/**
* Returns an enum describing the stability index of the generator.
*
* @return The defined stability index.
*/
public Stability getStability() {
return stability;
}
/**
* {@code GeneratorMetadata} builder static inner class.
*/
public static final class Builder {
private Stability stability;
private String generationMessage;
private Builder() {
}
/**
* Sets the {@code stability} and returns a reference to this Builder so that the methods can be chained together.
*
* @param stability the {@code stability} to set
* @return a reference to this Builder
*/
public Builder stability(Stability stability) {
this.stability = stability;
return this;
}
/**
* Sets the {@code generationMessage} and returns a reference to this Builder so that the methods can be chained together.
*
* @param generationMessage the {@code generationMessage} to set
* @return a reference to this Builder
*/
public Builder generationMessage(String generationMessage) {
this.generationMessage = generationMessage;
return this;
}
/**
* Returns a {@code GeneratorMetadata} built from the parameters previously set.
*
* @return a {@code GeneratorMetadata} built with parameters of this {@code GeneratorMetadata.Builder}
*/
public GeneratorMetadata build() {
return new GeneratorMetadata(this);
}
}
}

View File

@@ -0,0 +1,37 @@
package org.openapitools.codegen.meta;
/**
* Represents the "stability index" of a generator or feature, based on the stability indexes defined in the node.js ecosystem.
*/
public enum Stability {
/**
* The feature or features are considered complete and "production-ready".
*/
STABLE("stable"),
/**
* The feature may be partially incomplete, but breaking changes will be avoided between major releases.
*/
BETA("beta"),
/**
* The feature is still under active development and subject to non-backward compatible changes or removal in any
* future version. Use of the feature is not recommended in production environments.
*/
EXPERIMENTAL("experimental"),
/**
* The feature may emit warnings. Backward compatibility is not guaranteed. Removal is likely to occur in a subsequent major release.
*/
DEPRECATED("deprecated");
private String description;
Stability(String description) {
this.description = description;
}
/**
* Returns a value for this stability index.
*
* @return The descriptive value of this enum.
*/
public String value() { return description; }
}

View File

@@ -48,7 +48,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"
classpath "org.openapitools:openapi-generator-gradle-plugin:4.0.0"
}
}
@@ -599,7 +599,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath('org.openapitools:openapi-generator-gradle-plugin:3.3.4') {
classpath('org.openapitools:openapi-generator-gradle-plugin:4.0.0') {
exclude group: 'com.google.guava'
}
}

View File

@@ -1,4 +1,4 @@
openApiGeneratorVersion=4.0.0-SNAPSHOT
openApiGeneratorVersion=4.0.0
# BEGIN placeholders
# these are just placeholders to allow contributors to build directly

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

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

View File

@@ -1 +1 @@
openApiGeneratorVersion=4.0.0-beta3
openApiGeneratorVersion=4.0.0

View File

@@ -22,6 +22,8 @@ import org.gradle.internal.logging.text.StyledTextOutput
import org.gradle.internal.logging.text.StyledTextOutputFactory
import org.openapitools.codegen.CodegenConfigLoader
import org.openapitools.codegen.CodegenType
import org.openapitools.codegen.meta.GeneratorMetadata
import org.openapitools.codegen.meta.Stability
/**
* A task which lists out the generators available in OpenAPI Generator
@@ -55,8 +57,18 @@ open class GeneratorsTask : DefaultTask() {
generators.filter { it.tag == type }
.sortedBy { it.name }
.forEach({ generator ->
val meta: GeneratorMetadata? = generator.generatorMetadata
append(" - ")
append(generator.name)
meta?.stability?.let {
if (it != Stability.STABLE) {
append(" (${it.value()})")
}
}
append(System.lineSeparator())
})

View File

@@ -11,7 +11,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
<version>4.0.0</version>
<executions>
<execution>
<goals>
@@ -57,6 +57,7 @@ mvn clean compile
- `logToStderr` - write all log messages (not just errors) to STDOUT
- `enablePostProcessFile` - enable file post-processing hook
- `skipValidateSpec` - Whether or not to skip validating the input spec prior to generation. By default, invalid specifications will result in an error.
- `strictSpec` - Whether or not to treat an input document strictly against the spec. 'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec.
- `generateAliasAsModel` - generate alias (array, map) as model
- `generateApis` - generate the apis (`true` by default)
- `generateApiTests` - generate the api tests (`true` by default. Only available if `generateApis` is `true`)

View File

@@ -12,7 +12,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
<version>4.0.0</version>
<executions>
<execution>
<goals>

View File

@@ -12,7 +12,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
<version>4.0.0</version>
<executions>
<execution>
<goals>

View File

@@ -12,7 +12,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.3.4</version>
<version>4.0.0</version>
<executions>
<execution>
<goals>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>openapi-generator-maven-plugin</artifactId>

View File

@@ -235,6 +235,12 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "skipValidateSpec", required = false)
private Boolean skipValidateSpec;
/**
* To treat a document strictly against the spec.
*/
@Parameter(name = "strictSpec", required = false)
private Boolean strictSpecBehavior;
/**
* To generate alias (array, map) as model
*/
@@ -459,6 +465,10 @@ public class CodeGenMojo extends AbstractMojo {
configurator.setValidateSpec(!skipValidateSpec);
}
if (strictSpecBehavior != null) {
configurator.setStrictSpecBehavior(strictSpecBehavior);
}
if (logToStderr != null) {
configurator.setLogToStderr(logToStderr);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>openapi-generator-online</artifactId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -313,7 +313,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-core</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0</version>
</dependency>
</dependencies>
<repositories>

View File

@@ -25,6 +25,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.meta.GeneratorMetadata;
import java.io.File;
import java.util.List;
@@ -32,6 +33,8 @@ import java.util.Map;
import java.util.Set;
public interface CodegenConfig {
GeneratorMetadata getGeneratorMetadata();
CodegenType getTag();
String getName();
@@ -270,4 +273,8 @@ public interface CodegenConfig {
public boolean isEnableMinimalUpdate();
public void setEnableMinimalUpdate(boolean isEnableMinimalUpdate);
boolean isStrictSpecBehavior();
void setStrictSpecBehavior(boolean strictSpecBehavior);
}

View File

@@ -37,6 +37,9 @@ public class CodegenConstants {
public static final String API_PACKAGE = "apiPackage";
public static final String API_PACKAGE_DESC = "package for generated api classes";
public static final String API_SUFFIX = "apiSuffix";
public static final String API_SUFFIX_DESC = "suffix for api classes";
public static final String MODEL_PACKAGE = "modelPackage";
public static final String MODEL_PACKAGE_DESC = "package for generated models";
@@ -70,10 +73,10 @@ public class CodegenConstants {
public static final String GROUP_ID_DESC = "groupId in generated pom.xml";
public static final String ARTIFACT_ID = "artifactId";
public static final String ARTIFACT_ID_DESC = "artifactId in generated pom.xml";
public static final String ARTIFACT_ID_DESC = "artifactId in generated pom.xml. This also becomes part of the generated library's filename";
public static final String ARTIFACT_VERSION = "artifactVersion";
public static final String ARTIFACT_VERSION_DESC = "artifact version in generated pom.xml";
public static final String ARTIFACT_VERSION_DESC = "artifact version in generated pom.xml. This also becomes part of the generated library's filename";
public static final String ARTIFACT_URL = "artifactUrl";
public static final String ARTIFACT_URL_DESC = "artifact URL in generated pom.xml";

View File

@@ -44,6 +44,8 @@ import org.openapitools.codegen.CodegenDiscriminator.MappedModel;
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.config.GeneratorProperties;
import org.openapitools.codegen.examples.ExampleGenerator;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
import org.openapitools.codegen.serializer.SerializerUtils;
import org.openapitools.codegen.templating.MustacheEngineAdapter;
import org.openapitools.codegen.utils.ModelUtils;
@@ -63,6 +65,7 @@ import static org.openapitools.codegen.utils.StringUtils.*;
public class DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class);
protected GeneratorMetadata generatorMetadata;
protected String inputSpec;
protected String outputFolder = "";
protected Set<String> defaultIncludes = new HashSet<String>();
@@ -118,6 +121,9 @@ public class DefaultCodegen implements CodegenConfig {
// flag to indicate whether to only update files whose contents have changed
protected boolean enableMinimalUpdate = false;
// acts strictly upon a spec, potentially modifying it to have consistent behavior across generators.
protected boolean strictSpecBehavior = true;
// make openapi available to all methods
protected OpenAPI openAPI;
@@ -705,10 +711,18 @@ public class DefaultCodegen implements CodegenConfig {
this.modelPackage = modelPackage;
}
public String getModelNamePrefix() {
return modelNamePrefix;
}
public void setModelNamePrefix(String modelNamePrefix) {
this.modelNamePrefix = modelNamePrefix;
}
public String getModelNameSuffix() {
return modelNameSuffix;
}
public void setModelNameSuffix(String modelNameSuffix) {
this.modelNameSuffix = modelNameSuffix;
}
@@ -717,18 +731,34 @@ public class DefaultCodegen implements CodegenConfig {
this.apiPackage = apiPackage;
}
public Boolean getSortParamsByRequiredFlag() {
return sortParamsByRequiredFlag;
}
public void setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag) {
this.sortParamsByRequiredFlag = sortParamsByRequiredFlag;
}
public Boolean getPrependFormOrBodyParameters() {
return prependFormOrBodyParameters;
}
public void setPrependFormOrBodyParameters(Boolean prependFormOrBodyParameters) {
this.prependFormOrBodyParameters = prependFormOrBodyParameters;
}
public Boolean getEnsureUniqueParams() {
return ensureUniqueParams;
}
public void setEnsureUniqueParams(Boolean ensureUniqueParams) {
this.ensureUniqueParams = ensureUniqueParams;
}
public Boolean getAllowUnicodeIdentifiers() {
return allowUnicodeIdentifiers;
}
public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) {
this.allowUnicodeIdentifiers = allowUnicodeIdentifiers;
}
@@ -813,6 +843,16 @@ public class DefaultCodegen implements CodegenConfig {
return camelize(name);
}
/**
* Returns metadata about the generator.
*
* @return A provided {@link GeneratorMetadata} instance
*/
@Override
public GeneratorMetadata getGeneratorMetadata() {
return generatorMetadata;
}
/**
* Return the operation ID (method name)
*
@@ -929,6 +969,15 @@ public class DefaultCodegen implements CodegenConfig {
* returns string presentation of the example path (it's a constructor)
*/
public DefaultCodegen() {
CodegenType codegenType = getTag();
if (codegenType == null) {
codegenType = CodegenType.OTHER;
}
generatorMetadata = GeneratorMetadata.newBuilder()
.stability(Stability.STABLE)
.generationMessage(String.format(Locale.ROOT, "OpenAPI Generator: %s (%s)", getName(), codegenType.toValue()))
.build();
defaultIncludes = new HashSet<String>(
Arrays.asList("double",
"int",
@@ -1283,6 +1332,7 @@ public class DefaultCodegen implements CodegenConfig {
/**
* Return property value depending on property type.
*
* @param schema property type
* @return property value
*/
@@ -1447,7 +1497,8 @@ public class DefaultCodegen implements CodegenConfig {
} else if (ModelUtils.isDoubleSchema(schema)) {
return SchemaTypeUtil.DOUBLE_FORMAT;
} else {
LOGGER.warn("Unknown `format` detected for " + schema.getName() + ": " + schema.getFormat());
LOGGER.warn("Unknown `format` {} detected for type `number`. Defaulting to `number`", schema.getFormat());
return "number";
}
} else if (ModelUtils.isIntegerSchema(schema)) {
if (ModelUtils.isLongSchema(schema)) {
@@ -1888,7 +1939,7 @@ public class DefaultCodegen implements CodegenConfig {
*/
public CodegenProperty fromProperty(String name, Schema p) {
if (p == null) {
LOGGER.error("Undefined property/schema for `{}`. Default to type:string.", name);
LOGGER.error("Undefined property/schema for `{}`. Default to type:string.", name);
return null;
}
LOGGER.debug("debugging fromProperty for " + name + " : " + p);
@@ -2038,7 +2089,7 @@ public class DefaultCodegen implements CodegenConfig {
if (innerSchema == null) {
LOGGER.error("Undefined array inner type for `{}`. Default to String.", p.getName());
innerSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type");
((ArraySchema)p).setItems(innerSchema);
((ArraySchema) p).setItems(innerSchema);
}
} else if (ModelUtils.isMapSchema(p)) {
Schema innerSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getAdditionalProperties(p));
@@ -2120,7 +2171,7 @@ public class DefaultCodegen implements CodegenConfig {
if (innerSchema == null) {
LOGGER.error("Undefined array inner type for `{}`. Default to String.", p.getName());
innerSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type");
((ArraySchema)p).setItems(innerSchema);
((ArraySchema) p).setItems(innerSchema);
}
CodegenProperty cp = fromProperty(itemName, innerSchema);
updatePropertyForArray(property, cp);
@@ -2387,11 +2438,13 @@ public class DefaultCodegen implements CodegenConfig {
}
operationId = removeNonNameElementToCamelCase(operationId);
if (path.startsWith("/")) {
op.path = path;
} else {
if (isStrictSpecBehavior() && !path.startsWith("/")) {
// modifies an operation.path to strictly conform to OpenAPI Spec
op.path = "/" + path;
} else {
op.path = path;
}
op.operationId = toOperationId(operationId);
op.summary = escapeText(operation.getSummary());
op.unescapedNotes = operation.getDescription();
@@ -2510,8 +2563,9 @@ public class DefaultCodegen implements CodegenConfig {
CodegenParameter bodyParam = null;
RequestBody requestBody = operation.getRequestBody();
if (requestBody != null) {
if ("application/x-www-form-urlencoded".equalsIgnoreCase(getContentType(requestBody)) ||
"multipart/form-data".equalsIgnoreCase(getContentType(requestBody))) {
if (getContentType(requestBody) != null &&
(getContentType(requestBody).toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") ||
getContentType(requestBody).toLowerCase(Locale.ROOT).startsWith("multipart/form-data"))) {
// process form parameters
formParams = fromRequestBodyToFormParameters(requestBody, imports);
for (CodegenParameter cp : formParams) {
@@ -2878,8 +2932,22 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.vendorExtensions.putAll(parameter.getExtensions());
}
if (parameter.getSchema() != null) {
Schema parameterSchema = ModelUtils.unaliasSchema(this.openAPI, parameter.getSchema());
Schema s;
if(parameter.getSchema() != null) {
s = parameter.getSchema();
} else if (parameter.getContent() != null) {
Content content = parameter.getContent();
if (content.size() > 1) {
LOGGER.warn("Multiple schemas found in content, returning only the first one");
}
MediaType mediaType = content.values().iterator().next();
s = mediaType.getSchema();
} else {
s = null;
}
if (s != null) {
Schema parameterSchema = ModelUtils.unaliasSchema(this.openAPI, s);
if (parameterSchema == null) {
LOGGER.warn("warning! Schema not found for parameter \"" + parameter.getName() + "\", using String");
parameterSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to missing type definition.");
@@ -4189,6 +4257,7 @@ public class DefaultCodegen implements CodegenConfig {
protected String getContentType(RequestBody requestBody) {
if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) {
LOGGER.debug("Cannot determine the content type. Returning null.");
return null;
}
return new ArrayList<>(requestBody.getContent().keySet()).get(0);
@@ -4270,7 +4339,9 @@ public class DefaultCodegen implements CodegenConfig {
}
for (String consume : consumesInfo) {
if ("application/x-www-form-urlencoded".equalsIgnoreCase(consume) || "multipart/form-data".equalsIgnoreCase(consume)) {
if (consume != null &&
consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") ||
consume.toLowerCase(Locale.ROOT).startsWith("multipart/form-data")) {
return true;
}
}
@@ -4761,6 +4832,15 @@ public class DefaultCodegen implements CodegenConfig {
cliOptions.add(option);
}
protected void updateOption(String key, String defaultValue) {
for(int i = 0; i < cliOptions.size(); i++) {
if(cliOptions.get(i).getOpt().equals(key)) {
cliOptions.get(i).setDefault(defaultValue);
return;
}
}
}
protected void addSwitch(String key, String description, Boolean defaultValue) {
CliOption option = CliOption.newBoolean(key, description);
if (defaultValue != null)
@@ -4844,7 +4924,7 @@ public class DefaultCodegen implements CodegenConfig {
}
private void setParameterNullable(CodegenParameter parameter, CodegenProperty property) {
if(parameter == null || property == null) {
if (parameter == null || property == null) {
return;
}
parameter.isNullable = property.isNullable;
@@ -4893,11 +4973,31 @@ public class DefaultCodegen implements CodegenConfig {
/**
* Set the boolean value indicating the state of the option for updating only changed files
*
* @param enableMinimalUpdate true to enable minimal update
* @param enableMinimalUpdate true to enable minimal update
*/
@Override
public void setEnableMinimalUpdate(boolean enableMinimalUpdate) {
this.enableMinimalUpdate = enableMinimalUpdate;
}
/**
* Indicates whether the codegen configuration should treat documents as strictly defined by the OpenAPI specification.
*
* @return true to act strictly upon spec documents, potentially modifying the spec to strictly fit the spec.
*/
@Override
public boolean isStrictSpecBehavior() {
return this.strictSpecBehavior;
}
/**
* Sets the boolean valid indicating whether generation will work strictly against the specification, potentially making
* minor changes to the input document.
*
* @param strictSpecBehavior true if we will behave strictly, false to allow specification documents which pass validation to be loosely interpreted against the spec.
*/
@Override
public void setStrictSpecBehavior(final boolean strictSpecBehavior) {
this.strictSpecBehavior = strictSpecBehavior;
}
}

View File

@@ -35,6 +35,8 @@ import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.config.GeneratorProperties;
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.ignore.CodegenIgnoreProcessor;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
import org.openapitools.codegen.templating.MustacheEngineAdapter;
import org.openapitools.codegen.config.GeneratorProperties;
import org.openapitools.codegen.utils.ImplementationVersion;
@@ -45,6 +47,7 @@ import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.URL;
import java.nio.file.Path;
import java.time.ZonedDateTime;
import java.util.*;
@@ -431,9 +434,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
if (unusedModels.contains(name)) {
if (Boolean.FALSE.equals(skipFormModel)) {
// if skipFormModel sets to true, still generate the model and log the result
LOGGER.info("Model " + name + " (marked as unused due to form parameters) is generated due to skipFormModel=false (default)");
LOGGER.info("Model " + name + " (marked as unused due to form parameters) is generated due to the system property skipFormModel=false (default)");
} else {
LOGGER.info("Model " + name + " not generated since it's marked as unused (due to form parameters) and skipFormModel set to true");
LOGGER.info("Model " + name + " not generated since it's marked as unused (due to form parameters) and skipFormModel (system property) set to true");
continue;
}
}
@@ -882,6 +885,23 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
throw new RuntimeException("missing config!");
}
if (config.getGeneratorMetadata() == null) {
LOGGER.warn(String.format(Locale.ROOT, "Generator '%s' is missing generator metadata!", config.getName()));
} else {
GeneratorMetadata generatorMetadata = config.getGeneratorMetadata();
if (StringUtils.isNotEmpty(generatorMetadata.getGenerationMessage())) {
LOGGER.info(generatorMetadata.getGenerationMessage());
}
Stability stability = generatorMetadata.getStability();
String stabilityMessage = String.format(Locale.ROOT, "Generator '%s' is considered %s.", config.getName(), stability.value());
if (stability == Stability.DEPRECATED) {
LOGGER.warn(stabilityMessage);
} else {
LOGGER.info(stabilityMessage);
}
}
// resolve inline models
InlineModelResolver inlineModelResolver = new InlineModelResolver();
inlineModelResolver.flatten(openAPI);
@@ -917,6 +937,19 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
return readTemplate(getFullTemplateFile(config, templateName));
}
/**
* Returns the path of a template, allowing access to the template where consuming literal contents aren't desirable or possible.
*
* @param name the template name (e.g. model.mustache)
*
* @return The {@link Path} to the template
*/
@Override
public Path getFullTemplatePath(String name) {
String fullPath = getFullTemplateFile(config, name);
return java.nio.file.Paths.get(fullPath);
}
protected File processTemplateToFile(Map<String, Object> templateData, String templateName, String outputFilename) throws IOException {
String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar);
if (ignoreProcessor.allowsFile(new File(adjustedOutputFilename))) {

View File

@@ -312,6 +312,35 @@ public class InlineModelResolver {
}
}
private void flattenComposedChildren(OpenAPI openAPI, String key, List<Schema> children) {
if (children == null || children.isEmpty()) {
return;
}
ListIterator<Schema> listIterator = children.listIterator();
while (listIterator.hasNext()) {
Schema component = listIterator.next();
if (component instanceof ObjectSchema) {
ObjectSchema op = (ObjectSchema) component;
if (op.get$ref() == null && op.getProperties() != null && op.getProperties().size() > 0) {
String innerModelName = resolveModelName(op.getTitle(), key);
Schema innerModel = modelFromProperty(op, innerModelName);
String existing = matchGenerated(innerModel);
if (existing == null) {
openAPI.getComponents().addSchemas(innerModelName, innerModel);
addGenerated(innerModelName, innerModel);
Schema schema = new Schema().$ref(innerModelName);
schema.setRequired(op.getRequired());
listIterator.set(schema);
} else {
Schema schema = new Schema().$ref(existing);
schema.setRequired(op.getRequired());
listIterator.set(schema);
}
}
}
}
}
/**
* Flatten inline models in components
*
@@ -326,7 +355,13 @@ public class InlineModelResolver {
List<String> modelNames = new ArrayList<String>(models.keySet());
for (String modelName : modelNames) {
Schema model = models.get(modelName);
if (model instanceof Schema) {
if (ModelUtils.isComposedSchema(model)) {
ComposedSchema m = (ComposedSchema) model;
// inline child schemas
flattenComposedChildren(openAPI, modelName + "_allOf", m.getAllOf());
flattenComposedChildren(openAPI, modelName + "_anyOf", m.getAnyOf());
flattenComposedChildren(openAPI, modelName + "_oneOf", m.getOneOf());
} else if (model instanceof Schema) {
Schema m = (Schema) model;
Map<String, Schema> properties = m.getProperties();
flattenProperties(properties, modelName);
@@ -353,20 +388,6 @@ public class InlineModelResolver {
}
}
}
} else if (ModelUtils.isComposedSchema(model)) {
ComposedSchema m = (ComposedSchema) model;
if (m.getAllOf() != null && !m.getAllOf().isEmpty()) {
Schema child = null;
for (Schema component : m.getAllOf()) {
if (component.get$ref() == null) {
child = component;
}
}
if (child != null) {
Map<String, Schema> properties = child.getProperties();
flattenProperties(properties, modelName);
}
}
}
}
}

View File

@@ -58,23 +58,6 @@ public class CodegenConfigurator implements Serializable {
public static final Logger LOGGER = LoggerFactory.getLogger(CodegenConfigurator.class);
private static Map<String, String> nameMigrationMap = new HashMap<>();
static {
nameMigrationMap.put("akka-scala", new ScalaAkkaClientCodegen().getName());
nameMigrationMap.put("scala", new ScalaHttpClientCodegen().getName());
nameMigrationMap.put("jaxrs", new JavaJerseyServerCodegen().getName());
nameMigrationMap.put("qt5cpp", new CppQt5ClientCodegen().getName());
nameMigrationMap.put("cpprest", new CppRestSdkClientCodegen().getName());
nameMigrationMap.put("tizen", new CppTizenClientCodegen().getName());
nameMigrationMap.put("sinatra", new RubySinatraServerCodegen().getName());
nameMigrationMap.put("swift", new SwiftClientCodegen().getName());
nameMigrationMap.put("lumen", new PhpLumenServerCodegen().getName());
nameMigrationMap.put("slim", new PhpSlimServerCodegen().getName());
nameMigrationMap.put("ze-ph", new PhpZendExpressivePathHandlerServerCodegen().getName());
nameMigrationMap.put("nancyfx", new CSharpNancyFXServerCodegen().getName());
}
private String generatorName;
private String inputSpec;
private String outputDir;
@@ -85,6 +68,7 @@ public class CodegenConfigurator implements Serializable {
private boolean validateSpec;
private boolean enablePostProcessFile;
private boolean enableMinimalUpdate;
private boolean strictSpecBehavior;
private String templateDir;
private String templatingEngineName;
private String auth;
@@ -117,11 +101,10 @@ public class CodegenConfigurator implements Serializable {
public CodegenConfigurator() {
this.validateSpec = true;
this.strictSpecBehavior = true;
this.setOutputDir(".");
}
// TODO: When setLang is removed, please remove nameMigrationMap and its usage(s).
/**
* Set the "language". This has drifted away from language-only to include framework and
* hyphenated generator types as well as language.
@@ -150,15 +133,7 @@ public class CodegenConfigurator implements Serializable {
* @return The fluent instance of {@link CodegenConfigurator}
*/
public CodegenConfigurator setGeneratorName(final String generatorName) {
if (nameMigrationMap.containsKey(generatorName)) {
String newValue = nameMigrationMap.get(generatorName);
LOGGER.warn(String.format(Locale.ROOT,
"The name '%s' is a deprecated. Please update to the new name of '%s'.",
generatorName, newValue));
this.generatorName = newValue;
} else {
this.generatorName = generatorName;
}
this.generatorName = generatorName;
return this;
}
@@ -252,6 +227,15 @@ public class CodegenConfigurator implements Serializable {
return this;
}
public boolean isStrictSpecBehavior() {
return strictSpecBehavior;
}
public CodegenConfigurator setStrictSpecBehavior(boolean strictSpecBehavior) {
this.strictSpecBehavior = strictSpecBehavior;
return this;
}
public boolean isVerbose() {
return verbose;
}
@@ -557,6 +541,8 @@ public class CodegenConfigurator implements Serializable {
config.languageSpecificPrimitives().addAll(languageSpecificPrimitives);
config.reservedWordsMappings().putAll(reservedWordMappings);
config.setStrictSpecBehavior(isStrictSpecBehavior());
checkAndSetAdditionalProperty(apiPackage, CodegenConstants.API_PACKAGE);
checkAndSetAdditionalProperty(modelPackage, CodegenConstants.MODEL_PACKAGE);
checkAndSetAdditionalProperty(invokerPackage, CodegenConstants.INVOKER_PACKAGE);

View File

@@ -52,7 +52,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String SUPPORT_JAVA6 = "supportJava6";
public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping";
public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix";
public static final String BOOLEAN_GETTER_PREFIX_DEFAULT = "get";
public static final String USE_NULL_FOR_UNKNOWN_ENUM_VALUE = "useNullForUnknownEnumValue";
protected String dateLibrary = "threetenbp";
@@ -86,7 +85,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected String modelDocPath = "docs/";
protected boolean supportJava6 = false;
protected boolean disableHtmlEscaping = false;
protected String booleanGetterPrefix = BOOLEAN_GETTER_PREFIX_DEFAULT;
protected String booleanGetterPrefix = "get";
protected boolean useNullForUnknownEnumValue = false;
protected String parentGroupId = "";
protected String parentArtifactId = "";
@@ -144,31 +143,30 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_URL, CodegenConstants.ARTIFACT_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_DESCRIPTION, CodegenConstants.ARTIFACT_DESCRIPTION_DESC));
cliOptions.add(new CliOption(CodegenConstants.SCM_CONNECTION, CodegenConstants.SCM_CONNECTION_DESC));
cliOptions.add(new CliOption(CodegenConstants.SCM_DEVELOPER_CONNECTION, CodegenConstants.SCM_DEVELOPER_CONNECTION_DESC));
cliOptions.add(new CliOption(CodegenConstants.SCM_URL, CodegenConstants.SCM_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_NAME, CodegenConstants.DEVELOPER_NAME_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_EMAIL, CodegenConstants.DEVELOPER_EMAIL_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION, CodegenConstants.DEVELOPER_ORGANIZATION_DESC));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION_URL, CodegenConstants.DEVELOPER_ORGANIZATION_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME, CodegenConstants.LICENSE_NAME_DESC));
cliOptions.add(new CliOption(CodegenConstants.LICENSE_URL, CodegenConstants.LICENSE_URL_DESC));
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC));
cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC));
cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, CodegenConstants
.SERIALIZE_BIG_DECIMAL_AS_STRING_DESC));
cliOptions.add(CliOption.newBoolean(FULL_JAVA_UTIL, "whether to use fully qualified name for classes under java.util. This option only works for Java API client"));
cliOptions.add(new CliOption("hideGenerationTimestamp", "hides the timestamp when files were generated"));
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC).defaultValue(this.getInvokerPackage()));
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC).defaultValue(this.getGroupId()));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC).defaultValue(this.getArtifactId()));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC).defaultValue(this.getArtifactVersion()));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_URL, CodegenConstants.ARTIFACT_URL_DESC).defaultValue(this.getArtifactUrl()));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_DESCRIPTION, CodegenConstants.ARTIFACT_DESCRIPTION_DESC).defaultValue(this.getArtifactDescription()));
cliOptions.add(new CliOption(CodegenConstants.SCM_CONNECTION, CodegenConstants.SCM_CONNECTION_DESC).defaultValue(this.getScmConnection()));
cliOptions.add(new CliOption(CodegenConstants.SCM_DEVELOPER_CONNECTION, CodegenConstants.SCM_DEVELOPER_CONNECTION_DESC).defaultValue(this.getScmDeveloperConnection()));
cliOptions.add(new CliOption(CodegenConstants.SCM_URL, CodegenConstants.SCM_URL_DESC).defaultValue(this.getScmUrl()));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_NAME, CodegenConstants.DEVELOPER_NAME_DESC).defaultValue(this.getDeveloperName()));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_EMAIL, CodegenConstants.DEVELOPER_EMAIL_DESC).defaultValue(this.getDeveloperEmail()));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION, CodegenConstants.DEVELOPER_ORGANIZATION_DESC).defaultValue(this.getDeveloperOrganization()));
cliOptions.add(new CliOption(CodegenConstants.DEVELOPER_ORGANIZATION_URL, CodegenConstants.DEVELOPER_ORGANIZATION_URL_DESC).defaultValue(this.getDeveloperOrganizationUrl()));
cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME, CodegenConstants.LICENSE_NAME_DESC).defaultValue(this.getLicenseName()));
cliOptions.add(new CliOption(CodegenConstants.LICENSE_URL, CodegenConstants.LICENSE_URL_DESC).defaultValue(this.getLicenseUrl()));
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC).defaultValue(this.getSourceFolder()));
cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC, this.getSerializableModel()));
cliOptions.add(CliOption.newBoolean(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING_DESC, serializeBigDecimalAsString));
cliOptions.add(CliOption.newBoolean(FULL_JAVA_UTIL, "whether to use fully qualified name for classes under java.util. This option only works for Java API client", fullJavaUtil));
cliOptions.add(CliOption.newBoolean(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC, this.isHideGenerationTimestamp()));
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)"));
CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use");
Map<String, String> dateOptions = new HashMap<String, String>();
CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use").defaultValue(this.getDateLibrary());
Map<String, String> dateOptions = new HashMap<>();
dateOptions.put("java8", "Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets \"" + JAVA8_MODE + "\" to true");
dateOptions.put("threetenbp", "Backport of JSR310 (preferred for jdk < 1.8)");
dateOptions.put("java8-localdatetime", "Java 8 using LocalDateTime (for legacy app only)");
@@ -177,20 +175,26 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
dateLibrary.setEnum(dateOptions);
cliOptions.add(dateLibrary);
CliOption java8Mode = new CliOption(JAVA8_MODE, "Option. Use Java8 classes instead of third party equivalents");
Map<String, String> java8ModeOptions = new HashMap<String, String>();
CliOption java8Mode = new CliOption(JAVA8_MODE, "Option. Use Java8 classes instead of third party equivalents").defaultValue(String.valueOf(this.java8Mode));
Map<String, String> java8ModeOptions = new HashMap<>();
java8ModeOptions.put("true", "Use Java 8 classes such as Base64");
java8ModeOptions.put("false", "Various third party libraries as needed");
java8Mode.setEnum(java8ModeOptions);
cliOptions.add(java8Mode);
cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)"));
cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix (default value '" + BOOLEAN_GETTER_PREFIX_DEFAULT + "')"));
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(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_VERSION, CodegenConstants.PARENT_VERSION_DESC));
cliOptions.add(CliOption.newString(CodegenConstants.SNAPSHOT_VERSION, CodegenConstants.SNAPSHOT_VERSION_DESC));
CliOption snapShotVersion = CliOption.newString(CodegenConstants.SNAPSHOT_VERSION, CodegenConstants.SNAPSHOT_VERSION_DESC);
Map<String, String> snapShotVersionOptions = new HashMap<>();
snapShotVersionOptions.put("true", "Use a SnapShot Version");
snapShotVersionOptions.put("false", "Use a Release Version");
snapShotVersion.setEnum(snapShotVersionOptions);
cliOptions.add(snapShotVersion);
}
@Override
@@ -262,15 +266,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
}
if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) {
this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION));
} else if (this.getVersionFromSpecification() != null) {
this.setArtifactVersion(this.getVersionFromSpecification());
} else {
//not set, use to be passed to template
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
}
if (additionalProperties.containsKey(CodegenConstants.SNAPSHOT_VERSION)) {
Boolean useSnapshotVersion = Boolean.valueOf((String) additionalProperties.get(CodegenConstants.SNAPSHOT_VERSION));
@@ -580,14 +575,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return toModelName(name) + "Test";
}
@Override
public String toApiName(String name) {
if (name.length() == 0) {
return "DefaultApi";
}
return camelize(name) + "Api";
}
@Override
public String toApiFilename(String name) {
return toApiName(name);
@@ -607,7 +594,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
// if it's all uppper case, do nothing
if (name.matches("^[A-Z_]*$")) {
if (name.matches("^[A-Z0-9_]*$")) {
return name;
}
@@ -991,10 +978,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
}
@Override
public void postProcessParameter(CodegenParameter parameter) {
}
@Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
// recursively add import for mapping one type to multiple imports
@@ -1024,8 +1007,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
List<Map<String, String>> imports = (List<Map<String, String>>) objs.get("imports");
Pattern pattern = Pattern.compile("java\\.util\\.(List|ArrayList|Map|HashMap)");
for (Iterator<Map<String, String>> itr = imports.iterator(); itr.hasNext(); ) {
String _import = itr.next().get("import");
if (pattern.matcher(_import).matches()) {
String itrImport = itr.next().get("import");
if (pattern.matcher(itrImport).matches()) {
itr.remove();
}
}
@@ -1034,30 +1017,45 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
@Override
public void preprocessOpenAPI(OpenAPI openAPI) {
if (openAPI == null || openAPI.getPaths() == null) {
if (openAPI == null) {
return;
}
for (String pathname : openAPI.getPaths().keySet()) {
PathItem path = openAPI.getPaths().get(pathname);
if (path.readOperations() == null) {
continue;
}
for (Operation operation : path.readOperations()) {
LOGGER.info("Processing operation " + operation.getOperationId());
if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) {
String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json";
List<String> consumes = new ArrayList<String>(getConsumesInfo(openAPI, operation));
String contentType = consumes == null || consumes.isEmpty() ? defaultContentType : consumes.get(0);
operation.addExtension("x-contentType", contentType);
if (openAPI.getPaths() != null) {
for (String pathname : openAPI.getPaths().keySet()) {
PathItem path = openAPI.getPaths().get(pathname);
if (path.readOperations() == null) {
continue;
}
String accepts = getAccept(openAPI, operation);
operation.addExtension("x-accepts", accepts);
for (Operation operation : path.readOperations()) {
LOGGER.info("Processing operation " + operation.getOperationId());
if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) {
String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json";
List<String> consumes = new ArrayList<>(getConsumesInfo(openAPI, operation));
String contentType = consumes == null || consumes.isEmpty() ? defaultContentType : consumes.get(0);
operation.addExtension("x-contentType", contentType);
}
String accepts = getAccept(openAPI, operation);
operation.addExtension("x-accepts", accepts);
}
}
}
// If no artifactVersion is provided in additional properties, version from API specification is used.
// If none of them is provided then fallbacks to default version
if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)) {
this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION));
} else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) {
this.setArtifactVersion(openAPI.getInfo().getVersion());
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
} else {
//not set, use to be passed to template
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
}
}
protected static String getAccept(OpenAPI openAPI, Operation operation) {
private static String getAccept(OpenAPI openAPI, Operation operation) {
String accepts = null;
String defaultContentType = "application/json";
Set<String> producesInfo = getProducesInfo(openAPI, operation);
@@ -1212,66 +1210,130 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.invokerPackage = invokerPackage;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getArtifactId() {
return artifactId;
}
public void setArtifactId(String artifactId) {
this.artifactId = artifactId;
}
public String getArtifactVersion() {
return artifactVersion;
}
public void setArtifactVersion(String artifactVersion) {
this.artifactVersion = artifactVersion;
}
public String getArtifactUrl() {
return artifactUrl;
}
public void setArtifactUrl(String artifactUrl) {
this.artifactUrl = artifactUrl;
}
public String getArtifactDescription() {
return artifactDescription;
}
public void setArtifactDescription(String artifactDescription) {
this.artifactDescription = artifactDescription;
}
public String getScmConnection() {
return scmConnection;
}
public void setScmConnection(String scmConnection) {
this.scmConnection = scmConnection;
}
public String getScmDeveloperConnection() {
return scmDeveloperConnection;
}
public void setScmDeveloperConnection(String scmDeveloperConnection) {
this.scmDeveloperConnection = scmDeveloperConnection;
}
public String getScmUrl() {
return scmUrl;
}
public void setScmUrl(String scmUrl) {
this.scmUrl = scmUrl;
}
public String getDeveloperName() {
return developerName;
}
public void setDeveloperName(String developerName) {
this.developerName = developerName;
}
public String getDeveloperEmail() {
return developerEmail;
}
public void setDeveloperEmail(String developerEmail) {
this.developerEmail = developerEmail;
}
public String getDeveloperOrganization() {
return developerOrganization;
}
public void setDeveloperOrganization(String developerOrganization) {
this.developerOrganization = developerOrganization;
}
public String getDeveloperOrganizationUrl() {
return developerOrganizationUrl;
}
public void setDeveloperOrganizationUrl(String developerOrganizationUrl) {
this.developerOrganizationUrl = developerOrganizationUrl;
}
public String getLicenseName() {
return licenseName;
}
public void setLicenseName(String licenseName) {
this.licenseName = licenseName;
}
public String getLicenseUrl() {
return licenseUrl;
}
public void setLicenseUrl(String licenseUrl) {
this.licenseUrl = licenseUrl;
}
public String getSourceFolder() {
return sourceFolder;
}
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
public String getTestFolder() {
return testFolder;
}
public void setTestFolder(String testFolder) {
this.testFolder = testFolder;
}
@@ -1280,6 +1342,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.serializeBigDecimalAsString = s;
}
public Boolean getSerializableModel() {
return serializableModel;
}
public void setSerializableModel(Boolean serializableModel) {
this.serializableModel = serializableModel;
}
@@ -1297,6 +1363,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.withXml = withXml;
}
public String getDateLibrary() {
return dateLibrary;
}
public void setDateLibrary(String library) {
this.dateLibrary = library;
}
@@ -1313,6 +1383,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.disableHtmlEscaping = disabled;
}
public String getBooleanGetterPrefix() {
return booleanGetterPrefix;
}
public void setBooleanGetterPrefix(String booleanGetterPrefix) {
this.booleanGetterPrefix = booleanGetterPrefix;
}
@@ -1351,19 +1425,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return sb.toString();
}
/**
* Gets version from API specification.
*
* @return API version
*/
private String getVersionFromSpecification() {
if (this.openAPI != null && this.openAPI.getInfo() != null) {
return this.openAPI.getInfo().getVersion();
} else {
return null;
}
}
/**
* Builds a SNAPSHOT version from a given version.
*

View File

@@ -42,7 +42,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
protected String implFolder = "src/main/java";
protected String testResourcesFolder = "src/test/resources";
protected String title = "OpenAPI Server";
protected String serverPort = "8080";
protected boolean useBeanValidation = true;
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);
@@ -54,19 +54,24 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
invokerPackage = "org.openapitools.api";
artifactId = "openapi-jaxrs-server";
dateLibrary = "legacy"; //TODO: add joda support to all jax-rs
apiPackage = "org.openapitools.api";
modelPackage = "org.openapitools.model";
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
updateOption(this.DATE_LIBRARY, this.getDateLibrary());
additionalProperties.put("title", title);
// java inflector uses the jackson lib
additionalProperties.put("jackson", "true");
cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC));
cliOptions.add(new CliOption("title", "a title describing the application"));
cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC).defaultValue(implFolder));
cliOptions.add(new CliOption("title", "a title describing the application").defaultValue(title));
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations",useBeanValidation));
cliOptions.add(new CliOption(SERVER_PORT, "The port on which the server should be started"));
cliOptions.add(new CliOption(SERVER_PORT, "The port on which the server should be started").defaultValue(serverPort));
}
@@ -97,6 +102,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
@Override
public void preprocessOpenAPI(OpenAPI openAPI) {
super.preprocessOpenAPI(openAPI);
/* TODO there should be no need for the following logic
if ("/".equals(swagger.getBasePath())) {
swagger.setBasePath("");
@@ -106,7 +112,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
if (!this.additionalProperties.containsKey(SERVER_PORT)) {
URL url = URLPathUtils.getServerURL(openAPI);
// 8080 is the default value for a JEE Server:
this.additionalProperties.put(SERVER_PORT, URLPathUtils.getPort(url, 8080));
this.additionalProperties.put(SERVER_PORT, URLPathUtils.getPort(url, serverPort));
}
if (openAPI.getPaths() != null) {

View File

@@ -41,6 +41,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
protected String artifactVersion = "1.0.0";
protected String groupId = "org.openapitools";
protected String packageName = "org.openapitools";
protected String apiSuffix = "Api";
protected String sourceFolder = "src/main/kotlin";
@@ -195,6 +196,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
cliOptions.clear();
addOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC, sourceFolder);
addOption(CodegenConstants.PACKAGE_NAME, "Generated artifact package name.", packageName);
addOption(CodegenConstants.API_SUFFIX, CodegenConstants.API_SUFFIX_DESC, apiSuffix);
addOption(CodegenConstants.GROUP_ID, "Generated artifact package's organization (i.e. maven groupId).", groupId);
addOption(CodegenConstants.ARTIFACT_ID, "Generated artifact id (name of jar).", artifactId);
addOption(CodegenConstants.ARTIFACT_VERSION, "Generated artifact's package version.", artifactVersion);
@@ -337,6 +339,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
}
if (additionalProperties.containsKey(CodegenConstants.API_SUFFIX)) {
this.setApiSuffix((String) additionalProperties.get(CodegenConstants.API_SUFFIX));
}
if (additionalProperties.containsKey(CodegenConstants.ARTIFACT_ID)) {
this.setArtifactId((String) additionalProperties.get(CodegenConstants.ARTIFACT_ID));
} else {
@@ -396,6 +402,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
this.packageName = packageName;
}
public void setApiSuffix(String apiSuffix) {
this.apiSuffix = apiSuffix;
}
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
@@ -463,6 +473,14 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
return super.toInstantiationType(p);
}
@Override
public String toApiName(String name) {
if (name.length() == 0) {
return "DefaultApi";
}
return (this.apiSuffix.isEmpty() ? camelize(name) : camelize(name) + this.apiSuffix);
}
/**
* Return the fully-qualified "Model" name for import
*
@@ -717,7 +735,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
}
// if it's all uppper case, do nothing
if (name.matches("^[A-Z_]*$")) {
if (name.matches("^[A-Z0-9_]*$")) {
return name;
}

View File

@@ -45,7 +45,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
private static final String UNDEFINED_VALUE = "undefined";
protected String modelPropertyNaming = "camelCase";
protected Boolean supportsES6 = true;
protected Boolean supportsES6 = false;
protected HashSet<String> languageGenericTypes;
public AbstractTypeScriptClientCodegen() {
@@ -120,7 +120,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
typeMapping.put("Error", "Error");
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false"));
cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue(String.valueOf(this.getSupportsES6())));
}
@@ -130,6 +130,10 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
if (StringUtils.isEmpty(System.getenv("TS_POST_PROCESS_FILE"))) {
LOGGER.info("Hint: Environment variable 'TS_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export TS_POST_PROCESS_FILE=\"/usr/local/bin/prettier --write\"' (Linux/Mac)");
LOGGER.info("Note: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
}
else if (!this.isEnablePostProcessFile()) {
LOGGER.info("Warning: Environment variable 'TS_POST_PROCESS_FILE' is set but file post-processing is not enabled. To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
}
if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) {

View File

@@ -142,9 +142,9 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
addOption(COMPATIBILITY_VERSION, "ASP.Net Core CompatibilityVersion", compatibilityVersion);
aspnetCoreVersion.addEnum("2.0", "ASP.NET COre V2.0");
aspnetCoreVersion.addEnum("2.1", "ASP.NET COre V2.1");
aspnetCoreVersion.addEnum("2.2", "ASP.NET COre V2.2");
aspnetCoreVersion.addEnum("2.0", "ASP.NET COre 2.0");
aspnetCoreVersion.addEnum("2.1", "ASP.NET Core 2.1");
aspnetCoreVersion.addEnum("2.2", "ASP.NET Core 2.2");
aspnetCoreVersion.setDefault("2.2");
aspnetCoreVersion.setOptValue(aspnetCoreVersion.getDefault());
addOption(aspnetCoreVersion.getOpt(), aspnetCoreVersion.getDescription(), aspnetCoreVersion.getOptValue());
@@ -180,13 +180,13 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
classModifier.setOptValue(classModifier.getDefault());
addOption(classModifier.getOpt(), classModifier.getDescription(), classModifier.getOptValue());
operationModifier.addEnum("virtual", "Keep method virtual ");
operationModifier.addEnum("virtual", "Keep method virtual");
operationModifier.addEnum("abstract", "Make method abstract");
operationModifier.setDefault("virtual");
operationModifier.setOptValue(operationModifier.getDefault());
addOption(operationModifier.getOpt(), operationModifier.getDescription(), operationModifier.getOptValue());
buildTarget.addEnum("program", "Generate code for standalone server");
buildTarget.addEnum("program", "Generate code for a standalone server");
buildTarget.addEnum("library", "Generate code for a server abstract class lbrary");
buildTarget.setDefault("program");
buildTarget.setOptValue(buildTarget.getDefault());
@@ -197,7 +197,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
generateBody);
addSwitch(OPERATION_IS_ASYNC,
"Set methods to async or sync.",
"Set methods to async or sync (default).",
operationIsAsync);
addSwitch(OPERATION_RESULT_TASK,

View File

@@ -22,9 +22,16 @@ import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(CSharpDotNet2ClientCodegen.class);
public static final String CLIENT_PACKAGE = "clientPackage";
protected String clientPackage = "Org.OpenAPITools.Client";
protected String apiDocPath = "docs/";
@@ -33,6 +40,10 @@ public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen {
public CSharpDotNet2ClientCodegen() {
super();
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.DEPRECATED)
.build();
// clear import mapping (from default generator) as C# (2.0) does not use it
// at the moment
importMapping.clear();
@@ -62,6 +73,8 @@ public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen {
@Override
public void processOpts() {
LOGGER.warn("Per Microsoft Product Lifecycle (https://support.microsoft.com/en-us/lifecycle/search?sort=PN&alpha=.NET%20Framework&Filter=FilterNO), support for .NET Framework 2.0 ended in 2011 so there may be security issues using the auto-generated C# 2.0 source code.");
super.processOpts();
if (additionalProperties.containsKey(CLIENT_PACKAGE)) {

View File

@@ -264,7 +264,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
@Override
public String toModelFilename(String name) {
return camelize(toModelName(name));
return toModelName(name);
}
@Override
@@ -285,7 +285,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
@Override
public String toApiFilename(String name) {
return modelNamePrefix + camelize(name) + "Api";
return toApiName(name);
}
/**

View File

@@ -17,11 +17,16 @@
package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.servers.Server;
import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.utils.URLPathUtils;
import java.io.File;
import java.net.URL;
import static org.openapitools.codegen.utils.StringUtils.*;
@@ -188,7 +193,14 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
}
return result;
}
@Override
public void preprocessOpenAPI(OpenAPI openAPI) {
URL url = URLPathUtils.getServerURL(openAPI);
String port = URLPathUtils.getPort(url, "8080");
this.additionalProperties.put("serverPort", port);
}
@Override
public String toApiFilename(String name) {
return modelNamePrefix + sanitizeName(camelize(name)) + "ApiHandler";

View File

@@ -289,12 +289,12 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
@Override
public String toModelFilename(String name) {
return sanitizeName(toModelName(name));
return toModelName(name);
}
@Override
public String toApiFilename(String name) {
return sanitizeName(toModelName(name) + "Api");
return toApiName(name);
}
/**

View File

@@ -193,12 +193,12 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
@Override
public String toModelFilename(String name) {
return camelize(name);
return toModelName(name);
}
@Override
public String toApiFilename(String name) {
return camelize(name) + "Api";
return toApiName(name);
}
@SuppressWarnings("unchecked")

View File

@@ -694,7 +694,10 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
}
final String prefix = toEnumName(property);
for (Map<String, Object> enumVar : enumVars) {
enumVar.put("name", prefix + enumVar.get("name"));
if (!enumVar.containsKey("_isPrefixed")) {
enumVar.put("name", prefix + enumVar.get("name"));
enumVar.put("_isPrefixed", true);
}
}
}

View File

@@ -0,0 +1,287 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.languages;
import com.samskivert.mustache.Mustache;
import io.swagger.v3.oas.models.OpenAPI;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.CodegenOperation;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.CodegenModel;
import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.utils.URLPathUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.ArrayList;
import static java.util.UUID.randomUUID;
public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen {
public static final String USE_SWASHBUCKLE = "useSwashbuckle";
public static final String GENERATE_BODY = "generateBody";
public static final String BUILD_TARGET = "buildTarget";
public static final String PROJECT_SDK = "projectSdk";
public static final String SDK_WEB = "Microsoft.NET.Sdk.Web";
public static final String SDK_LIB = "Microsoft.NET.Sdk";
private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
@SuppressWarnings("hiding")
protected Logger LOGGER = LoggerFactory.getLogger(FsharpGiraffeServerCodegen.class);
private boolean useSwashbuckle = false;
protected int serverPort = 8080;
protected String serverHost = "0.0.0.0";
private boolean generateBody = true;
private String buildTarget = "program";
private String projectSdk = SDK_WEB;
public FsharpGiraffeServerCodegen() {
super();
modelPackage = "Model";
apiTemplateFiles.put("Handler.mustache", "Handler.fs");
apiTemplateFiles.put("HandlerParams.mustache", "HandlerParams.fs");
apiTemplateFiles.put("ServiceInterface.mustache", "ServiceInterface.fs");
apiTemplateFiles.put("ServiceImpl.mustache", "Service.fs");
apiTestTemplateFiles.put("HandlerTests.mustache", ".fs");
apiTestTemplateFiles.put("HandlerTestsHelper.mustache", "Helper.fs");
modelTemplateFiles.put("Model.mustache", ".fs");
embeddedTemplateDir = templateDir = "fsharp-giraffe-server";
cliOptions.clear();
// CLI options
addOption(CodegenConstants.LICENSE_URL,
CodegenConstants.LICENSE_URL_DESC,
licenseUrl);
addOption(CodegenConstants.LICENSE_NAME,
CodegenConstants.LICENSE_NAME_DESC,
licenseName);
addOption(CodegenConstants.PACKAGE_COPYRIGHT,
CodegenConstants.PACKAGE_COPYRIGHT_DESC,
packageCopyright);
addOption(CodegenConstants.PACKAGE_AUTHORS,
CodegenConstants.PACKAGE_AUTHORS_DESC,
packageAuthors);
addOption(CodegenConstants.PACKAGE_TITLE,
CodegenConstants.PACKAGE_TITLE_DESC,
packageTitle);
addOption(CodegenConstants.PACKAGE_NAME,
"F# module name (convention: Title.Case).",
packageName);
addOption(CodegenConstants.PACKAGE_VERSION,
"F# package version.",
packageVersion);
addOption(CodegenConstants.OPTIONAL_PROJECT_GUID,
CodegenConstants.OPTIONAL_PROJECT_GUID_DESC,
null);
addOption(CodegenConstants.SOURCE_FOLDER,
CodegenConstants.SOURCE_FOLDER_DESC,
sourceFolder);
// CLI Switches
addSwitch(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG,
CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC,
sortParamsByRequiredFlag);
addSwitch(CodegenConstants.USE_DATETIME_OFFSET,
CodegenConstants.USE_DATETIME_OFFSET_DESC,
useDateTimeOffsetFlag);
addSwitch(CodegenConstants.USE_COLLECTION,
CodegenConstants.USE_COLLECTION_DESC,
useCollection);
addSwitch(CodegenConstants.RETURN_ICOLLECTION,
CodegenConstants.RETURN_ICOLLECTION_DESC,
returnICollection);
addSwitch(USE_SWASHBUCKLE,
"Uses the Swashbuckle.AspNetCore NuGet package for documentation.",
useSwashbuckle);
addSwitch(GENERATE_BODY,
"Generates method body.",
generateBody);
addOption(BUILD_TARGET,
"Target the build for a program or library.",
buildTarget);
}
@Override
public CodegenType getTag() {
return CodegenType.SERVER;
}
@Override
public String getName() {
return "fsharp-giraffe-server";
}
@Override
public String getHelp() {
return "Generates a F# Giraffe server (beta).";
}
@Override
public void preprocessOpenAPI(OpenAPI openAPI) {
super.preprocessOpenAPI(openAPI);
URL url = URLPathUtils.getServerURL(openAPI);
additionalProperties.put("serverHost", url.getHost());
additionalProperties.put("serverPort", URLPathUtils.getPort(url, 8080));
}
@Override
public void processOpts() {
super.processOpts();
boolean isLibrary = false;
if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_GUID)) {
setPackageGuid((String) additionalProperties.get(CodegenConstants.OPTIONAL_PROJECT_GUID));
}
additionalProperties.put("packageGuid", packageGuid);
if (additionalProperties.containsKey(USE_SWASHBUCKLE)) {
useSwashbuckle = convertPropertyToBooleanAndWriteBack(USE_SWASHBUCKLE);
} else {
additionalProperties.put(USE_SWASHBUCKLE, useSwashbuckle);
}
additionalProperties.put(PROJECT_SDK, projectSdk);
// TODO - should we be supporting a Giraffe class library?
if (isLibrary)
LOGGER.warn("Library flag not currently supported.");
String authFolder = sourceFolder + File.separator + "auth";
String serviceFolder = sourceFolder + File.separator + "services";
String implFolder = sourceFolder + File.separator + "impl";
String helperFolder = sourceFolder + File.separator + "helpers";
supportingFiles.add(new SupportingFile("build.sh.mustache", projectFolder, "build.sh"));
supportingFiles.add(new SupportingFile("build.bat.mustache", projectFolder, "build.bat"));
supportingFiles.add(new SupportingFile("README.mustache", projectFolder, "README.md"));
supportingFiles.add(new SupportingFile("gitignore.mustache", projectFolder, ".gitignore"));
supportingFiles.add(new SupportingFile("Project.fsproj.mustache", sourceFolder, packageName + ".fsproj"));
supportingFiles.add(new SupportingFile("Program.mustache", sourceFolder, "Program.fs"));
supportingFiles.add(new SupportingFile("AuthSchemes.mustache", authFolder, "AuthSchemes.fs"));
supportingFiles.add(new SupportingFile("Helpers.mustache", helperFolder, "Helpers.fs"));
supportingFiles.add(new SupportingFile("CustomHandlers.mustache", implFolder, "CustomHandlers.fs"));
supportingFiles.add(new SupportingFile("Project.Tests.fsproj.mustache", testFolder, packageName + "Tests.fsproj"));
supportingFiles.add(new SupportingFile("TestHelper.mustache", testFolder, "TestHelper.fs"));
// TODO - support Swashbuckle
if (useSwashbuckle)
LOGGER.warn("Swashbuckle flag not currently supported, this will be ignored.");
}
public void setPackageGuid(String packageGuid) {
this.packageGuid = packageGuid;
}
@Override
public String modelFileFolder() {
return super.modelFileFolder().replace("Model", "model");
}
@Override
public String apiFileFolder() {
return super.apiFileFolder() + File.separator + "api";
}
private String implFileFolder() {
return outputFolder + File.separator + sourceFolder + File.separator + "impl";
}
@Override()
public String toModelImport(String name) {
return packageName + "." + modelPackage() + "." + name;
}
@Override
public String apiFilename(String templateName, String tag) {
String result = super.apiFilename(templateName, tag);
if (templateName.endsWith("Impl.mustache")) {
int ix = result.lastIndexOf(File.separatorChar);
result = result.substring(0, ix) + result.substring(ix, result.length() - 2) + "fs";
result = result.replace(apiFileFolder(), implFileFolder());
}
return result;
}
@Override
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
generateJSONSpecFile(objs);
generateYAMLSpecFile(objs);
return super.postProcessSupportingFileData(objs);
}
@Override
protected void processOperation(CodegenOperation operation) {
super.processOperation(operation);
// HACK: Unlikely in the wild, but we need to clean operation paths for MVC Routing
if (operation.path != null) {
String original = operation.path;
operation.path = operation.path.replace("?", "/");
if (!original.equals(operation.path)) {
LOGGER.warn("Normalized " + original + " to " + operation.path + ". Please verify generated source.");
}
}
// Converts, for example, PUT to HttpPut for controller attributes
operation.httpMethod = "Http" + operation.httpMethod.substring(0, 1) + operation.httpMethod.substring(1).toLowerCase(Locale.ROOT);
}
@Override
public Mustache.Compiler processCompiler(Mustache.Compiler compiler) {
// To avoid unexpected behaviors when options are passed programmatically such as { "useCollection": "" }
return super.processCompiler(compiler).emptyStringIsFalse(true);
}
@Override
public String toRegularExpression(String pattern) {
return escapeText(pattern);
}
}

View File

@@ -60,7 +60,6 @@ public class GoClientCodegen extends AbstractGoCodegen {
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS,
CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC)
.defaultValue(Boolean.FALSE.toString()));
}
@Override
@@ -95,6 +94,8 @@ public class GoClientCodegen extends AbstractGoCodegen {
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go"));
supportingFiles.add(new SupportingFile("client.mustache", "", "client.go"));
supportingFiles.add(new SupportingFile("response.mustache", "", "response.go"));
supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod"));
supportingFiles.add(new SupportingFile("go.sum", "", "go.sum"));
supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml"));
if (additionalProperties.containsKey(WITH_GO_CODEGEN_COMMENT)) {

View File

@@ -17,19 +17,16 @@
package org.openapitools.codegen.languages;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.*;
import java.io.File;
import java.util.List;
import java.util.Map;
import static org.openapitools.codegen.utils.StringUtils.camelize;
public class GroovyClientCodegen extends AbstractJavaCodegen {
public static final String CONFIG_PACKAGE = "configPackage";
protected String title = "Petstore Server";
protected String configPackage = "";
public GroovyClientCodegen() {
super();
@@ -40,7 +37,7 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
languageSpecificPrimitives.add("File");
languageSpecificPrimitives.add("Map");
sourceFolder = projectFolder + File.separator + "groovy";
sourceFolder = projectFolder + "/groovy";
outputFolder = "generated-code/groovy";
modelTemplateFiles.put("model.mustache", ".groovy");
apiTemplateFiles.put("api.mustache", ".groovy");
@@ -55,15 +52,18 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
apiPackage = "org.openapitools.api";
modelPackage = "org.openapitools.model";
configPackage = "org.openapitools.configuration";
invokerPackage = "org.openapitools.api";
artifactId = "openapi-groovy";
dateLibrary = "legacy"; //TODO: add joda support to groovy
additionalProperties.put("title", title);
additionalProperties.put(CONFIG_PACKAGE, configPackage);
// clioOptions default redefinition need to be updated
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
updateOption(DATE_LIBRARY, this.getDateLibrary());
cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code"));
}
@Override
@@ -78,25 +78,32 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
@Override
public String getHelp() {
return "Generates a Groovy API client (beta).";
return "Generates a Groovy API client.";
}
@Override
public void processOpts() {
super.processOpts();
if (additionalProperties.containsKey(CONFIG_PACKAGE)) {
this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE));
}
supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle"));
// TODO readme to be added later
//supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("ApiUtils.mustache",
(sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), "ApiUtils.groovy"));
}
@Override
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> operations, List<Object> allModels) {
Map<String, Object> objs = (Map<String, Object>) operations.get("operations");
List<CodegenOperation> ops = (List<CodegenOperation>) objs.get("operation");
for (CodegenOperation op : ops) {
// Overwrite path to map variable with path parameters
op.path = op.path.replace("{", "${");
}
return operations;
}
@Override
public String toApiName(String name) {
if (name.length() == 0) {
@@ -106,10 +113,6 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
return camelize(name) + "Api";
}
public void setConfigPackage(String configPackage) {
this.configPackage = configPackage;
}
@Override
public String escapeQuotationMark(String input) {
// remove ' to avoid code injection

View File

@@ -301,7 +301,6 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
*/
private void setGenerateToSchema(CodegenModel model) {
for (CodegenProperty var : model.vars) {
LOGGER.warn(var.dataType);
if (var.dataType.contentEquals("Value") || var.dataType.contains(" Value")) {
additionalProperties.put("generateToSchema", false);
}
@@ -349,7 +348,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
@Override
public String getSchemaType(Schema p) {
String schemaType = super.getSchemaType(p);
LOGGER.debug("debugging swager type: " + p.getType() + ", " + p.getFormat() + " => " + schemaType);
LOGGER.debug("debugging OpenAPI type: " + p.getType() + ", " + p.getFormat() + " => " + schemaType);
String type = null;
if (typeMapping.containsKey(schemaType)) {
type = typeMapping.get(schemaType);

View File

@@ -58,12 +58,18 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
invokerPackage = "org.openapitools.api";
artifactId = "openapi-jaxrs-client";
dateLibrary = "legacy"; //TODO: add joda support to all jax-rs
apiPackage = "org.openapitools.api";
modelPackage = "org.openapitools.model";
outputFolder = "generated-code/JavaJaxRS-CXF";
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
updateOption(this.DATE_LIBRARY, this.getDateLibrary());
// clear model and api doc template as this codegen
// does not support auto-generated markdown doc at the moment
//TODO: add doc templates
@@ -72,16 +78,13 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
typeMapping.put("date", "LocalDate");
importMapping.put("LocalDate", "org.joda.time.LocalDate");
embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf";
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests"));
cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests"));
cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response"));
}

View File

@@ -77,6 +77,9 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
outputFolder = "generated-code/JavaJaxRS-CXF";
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
apiTemplateFiles.put("apiServiceImpl.mustache", ".java");
// clear model and api doc template as this codegen

View File

@@ -94,6 +94,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
public JavaClientCodegen() {
super();
outputFolder = "generated-code" + File.separator + "java";
embeddedTemplateDir = templateDir = "Java";
invokerPackage = "org.openapitools.client";
@@ -101,6 +102,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen
apiPackage = "org.openapitools.client.api";
modelPackage = "org.openapitools.client.model";
// cliOptions default redefinition need to be updated
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
modelTestTemplateFiles.put("model_test.mustache", ".java");
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library."));

View File

@@ -46,6 +46,8 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen {
invokerPackage = "org.openapitools.controllers";
artifactId = "openapi-inflector-server";
dateLibrary = "legacy"; //TODO: add joda support
apiPackage = GeneratorProperties.getProperty("swagger.codegen.inflector.apipackage", "org.openapitools.controllers");
modelPackage = GeneratorProperties.getProperty("swagger.codegen.inflector.modelpackage", "org.openapitools.model");
// clear model and api doc template as this codegen
// does not support auto-generated markdown doc at the moment
@@ -53,9 +55,13 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen {
modelDocTemplateFiles.remove("model_doc.mustache");
apiDocTemplateFiles.remove("api_doc.mustache");
apiPackage = GeneratorProperties.getProperty("swagger.codegen.inflector.apipackage", "org.openapitools.controllers");
modelPackage = GeneratorProperties.getProperty("swagger.codegen.inflector.modelpackage", "org.openapitools.model");
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
updateOption(this.DATE_LIBRARY, this.getDateLibrary());
additionalProperties.put("title", title);
// java inflector uses the jackson lib

View File

@@ -17,10 +17,7 @@
package org.openapitools.codegen.languages;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenModel;
import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import java.io.File;
@@ -43,6 +40,10 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp
sourceFolder = "src/gen/java";
useBeanValidation = true;
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
// Three API templates to support CDI injection
apiTemplateFiles.put("apiService.mustache", ".java");
apiTemplateFiles.put("apiServiceImpl.mustache", ".java");
@@ -51,8 +52,7 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp
typeMapping.put("DateTime", "java.util.Date");
// Updated template directory
embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME
+ File.separator + "cxf-cdi";
embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi";
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations",useBeanValidation));
}

View File

@@ -51,11 +51,17 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
invokerPackage = "org.openapitools.api";
artifactId = "openapi-jaxrs-server";
outputFolder = "generated-code/JavaJaxRS-Spec";
apiPackage = "org.openapitools.api";
modelPackage = "org.openapitools.model";
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
modelTemplateFiles.put("model.mustache", ".java");
apiTemplateFiles.put("api.mustache", ".java");
apiPackage = "org.openapitools.api";
modelPackage = "org.openapitools.model";
apiTestTemplateFiles.clear(); // TODO: add api test template
modelTestTemplateFiles.clear(); // TODO: add model test template
@@ -81,11 +87,8 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
}
}
CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
library.setDefault(DEFAULT_LIBRARY);
Map<String, String> supportedLibraries = new LinkedHashMap<String, String>();
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_LIBRARY);
Map<String, String> supportedLibraries = new LinkedHashMap<>();
supportedLibraries.put(DEFAULT_LIBRARY, "JAXRS");
library.setEnum(supportedLibraries);

View File

@@ -55,12 +55,10 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME;
CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_JERSEY_LIBRARY);
supportedLibraries.put(LIBRARY_JERSEY1, "Jersey core 1.x");
supportedLibraries.put(LIBRARY_JERSEY2, "Jersey core 2.x");
library.setEnum(supportedLibraries);
library.setDefault(DEFAULT_JERSEY_LIBRARY);
cliOptions.add(library);
cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1/2 library."));

View File

@@ -45,7 +45,7 @@ public class JavaMSF4JServerCodegen extends AbstractJavaJAXRSServerCodegen {
modelDocTemplateFiles.remove("model_doc.mustache");
apiDocTemplateFiles.remove("api_doc.mustache");
embeddedTemplateDir = templateDir = "MSF4J";
CliOption library = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use");
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC);
supportedLibraries.put(LIBRARY_JERSEY1, "Jersey core 1.x");
supportedLibraries.put(LIBRARY_JERSEY2, "Jersey core 2.x");
library.setEnum(supportedLibraries);

View File

@@ -52,25 +52,23 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
public JavaPKMSTServerCodegen() {
super();
this.projectFolder = "src" + File.separator + "main";
this.projectTestFolder = "src" + File.separator + "test";
this.sourceFolder = this.projectFolder + File.separator + "java";
this.testFolder = this.projectTestFolder + File.separator + "java";
groupId = "com.prokarma";
artifactId = "pkmst-microservice";
artifactVersion = "1.0.0";
embeddedTemplateDir = templateDir = "java-pkmst";
apiPackage = "com.prokarma.pkmst.controller";
modelPackage = "com.prokarma.pkmst.model";
invokerPackage = "com.prokarma.pkmst.controller";
// clioOptions default redifinition need to be updated
updateOption(CodegenConstants.GROUP_ID, this.getGroupId());
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
additionalProperties.put("jackson", "true");
serializeBigDecimalAsString = false;
withXml = false;
javaUtilPrefix = "";
serializableModel = false;
this.cliOptions.add(new CliOption("groupId", "groupId in generated pom.xml"));
this.cliOptions.add(new CliOption("artifactId", "artifactId in generated pom.xml"));
this.cliOptions.add(new CliOption("artifactVersion", "artifact version in generated pom.xml"));
this.cliOptions.add(new CliOption("basePackage", "base package for java source code"));
this.cliOptions.add(new CliOption("serviceName", "Service Name"));
this.cliOptions.add(new CliOption(TITLE, "server title name or client service name"));
@@ -79,6 +77,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
this.cliOptions.add(new CliOption("springBootAdminUri", "Spring-Boot URI"));
// Middleware config
this.cliOptions.add(new CliOption("pkmstInterceptor", "PKMST Interceptor"));
this.apiTestTemplateFiles.put("api_test.mustache", ".java");
if (".md".equals(this.modelDocTemplateFiles.get("model_doc.mustache"))) {
@@ -611,86 +610,18 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
return (this.outputFolder + "/" + this.modelDocPath).replace("/", File.separator);
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getArtifactId() {
return artifactId;
}
public void setArtifactId(String artifactId) {
this.artifactId = artifactId;
}
public String getArtifactVersion() {
return artifactVersion;
}
public void setArtifactVersion(String artifactVersion) {
this.artifactVersion = artifactVersion;
}
public String getProjectFolder() {
return projectFolder;
}
public void setProjectFolder(String projectFolder) {
this.projectFolder = projectFolder;
}
public String getEurekaUri() {
return eurekaUri;
}
public void setEurekaUri(String eurekaUri) {
this.eurekaUri = eurekaUri;
}
public String getZipkinUri() {
return zipkinUri;
}
public void setZipkinUri(String zipkinUri) {
this.zipkinUri = zipkinUri;
}
public String getSpringBootAdminUri() {
return springBootAdminUri;
}
public void setSpringBootAdminUri(String springBootAdminUri) {
this.springBootAdminUri = springBootAdminUri;
}
public String getProjectTestFolder() {
return projectTestFolder;
}
public void setProjectTestFolder(String projectTestFolder) {
this.projectTestFolder = projectTestFolder;
}
public String getSourceFolder() {
return sourceFolder;
}
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
}
public String getTestFolder() {
return testFolder;
}
public void setTestFolder(String testFolder) {
this.testFolder = testFolder;
}
public String getBasePackage() {
return basePackage;
}
@@ -715,46 +646,6 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
this.configPackage = configPackage;
}
public boolean isImplicitHeaders() {
return implicitHeaders;
}
public void setImplicitHeaders(boolean implicitHeaders) {
this.implicitHeaders = implicitHeaders;
}
public boolean isSerializeBigDecimalAsString() {
return serializeBigDecimalAsString;
}
public void setSerializeBigDecimalAsString(boolean serializeBigDecimalAsString) {
this.serializeBigDecimalAsString = serializeBigDecimalAsString;
}
public boolean isFullJavaUtil() {
return fullJavaUtil;
}
public void setFullJavaUtil(boolean fullJavaUtil) {
this.fullJavaUtil = fullJavaUtil;
}
public Boolean getSerializableModel() {
return serializableModel;
}
public void setSerializableModel(Boolean serializableModel) {
this.serializableModel = serializableModel;
}
public String getInvokerPackage() {
return invokerPackage;
}
public void setInvokerPackage(String invokerPackage) {
this.invokerPackage = invokerPackage;
}
public String getTitle() {
return title;
}
@@ -763,14 +654,6 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
this.title = title;
}
public boolean isWithXml() {
return withXml;
}
public void setWithXml(boolean withXml) {
this.withXml = withXml;
}
private interface DataTypeAssigner {
void setReturnType(String returnType);

Some files were not shown because too many files have changed in this diff Show More