mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-21 15:00:53 +00:00
Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0b0d534d0d | ||
|
bfb69388aa | ||
|
31089c0e49 | ||
|
20ed1ee3cc | ||
|
90001d4fac | ||
|
b7fb3b2107 | ||
|
7ca3fc3115 | ||
|
f632ab7977 | ||
|
0f305a5958 | ||
|
4372659a0b | ||
|
d82ca75cc3 | ||
|
faf6924f63 | ||
|
ad53684e11 | ||
|
63c56f00b7 | ||
|
c4a7c14c8f | ||
|
ee77b7f4f0 | ||
|
7f2ee8520e | ||
|
8862b960f8 | ||
|
64ab13a790 | ||
|
f9098d5a89 | ||
|
ca8c6d2f5d | ||
|
0995e5935c | ||
|
473343ff94 | ||
|
d63459c051 | ||
|
7a6be5a3e6 | ||
|
65cb95bef0 | ||
|
78691cb11c | ||
|
81e135e038 | ||
|
c6b51ff6fc | ||
|
117be2ca4c | ||
|
1b352c2d00 | ||
|
991883636f | ||
|
3ef45f1b4d | ||
|
7e439fd0bd | ||
|
63df7ca574 | ||
|
98b315c137 | ||
|
a809c187b4 | ||
|
d966f1234d | ||
|
6fdb632fb9 | ||
|
c7542dea3e | ||
|
66dfad2b09 | ||
|
9e5e4b1fd4 | ||
|
2af194b014 | ||
|
65773a9024 | ||
|
311233d804 | ||
|
b444de2b5c | ||
|
d0327b2683 | ||
|
af6ab0ed0e | ||
|
050dcae3ab | ||
|
e948355127 | ||
|
7c57c55194 | ||
|
a5f638fefd | ||
|
0e67c3a5ad | ||
|
43fa1b736a | ||
|
304b3cbcaa | ||
|
d7a74849f2 | ||
|
c0dc9c63d0 | ||
|
03effd7d05 | ||
|
d11d008e71 | ||
|
b6b71cd4da | ||
|
6b5fd6e622 | ||
|
c010c89915 | ||
|
b05604dab7 | ||
|
cfe476f32d | ||
|
d911a71be9 | ||
|
046be5dba1 |
30
.github/workflows/samples-cpp-oatpp-server.yaml
vendored
Normal file
30
.github/workflows/samples-cpp-oatpp-server.yaml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: Samples cpp oat++ server
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "samples/server/petstore/cpp-oatpp/**"
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "samples/server/petstore/cpp-oatpp/**"
|
||||||
|
|
||||||
|
env:
|
||||||
|
GRADLE_VERSION: 6.9
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build cpp qt client
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
sample:
|
||||||
|
- samples/server/petstore/cpp-oatpp
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macOS-latest
|
||||||
|
- windows-latest
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build
|
||||||
|
working-directory: ${{ matrix.sample }}
|
||||||
|
run: cmake -B build && cmake --build build --verbose
|
@ -71,6 +71,7 @@ jobs:
|
|||||||
- samples/client/petstore/java/microprofile-rest-client-mutiny
|
- samples/client/petstore/java/microprofile-rest-client-mutiny
|
||||||
- samples/client/petstore/java/microprofile-rest-client-3.0
|
- samples/client/petstore/java/microprofile-rest-client-3.0
|
||||||
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson
|
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson
|
||||||
|
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny
|
||||||
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
|
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
|
||||||
- samples/client/petstore/java/microprofile-rest-client-3.0-mutiny
|
- samples/client/petstore/java/microprofile-rest-client-3.0-mutiny
|
||||||
- samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter
|
- samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter
|
||||||
|
42
.github/workflows/samples-rust.yaml
vendored
42
.github/workflows/samples-rust.yaml
vendored
@ -26,12 +26,54 @@ jobs:
|
|||||||
- samples/client/others/rust/
|
- samples/client/others/rust/
|
||||||
- samples/client/petstore/rust/
|
- samples/client/petstore/rust/
|
||||||
- samples/server/petstore/rust-server/
|
- samples/server/petstore/rust-server/
|
||||||
|
- samples/server/petstore/rust-server-deprecated/
|
||||||
- samples/server/petstore/rust-axum/
|
- samples/server/petstore/rust-axum/
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
cache-targets: false # Don't cache workspace target directories as they don't exist
|
||||||
|
cache-directories:
|
||||||
|
${{ matrix.sample }}/target
|
||||||
|
workspaces: |
|
||||||
|
${{ matrix.sample }}/output/*
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{ matrix.sample }}
|
working-directory: ${{ matrix.sample }}
|
||||||
run: cargo build --all-targets --all-features
|
run: cargo build --all-targets --all-features
|
||||||
|
- name: Tests
|
||||||
|
working-directory: ${{ matrix.sample }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
# Skip samples/client/petstore/rust/ as it's tests are failing.
|
||||||
|
if [[ "${{ matrix.sample }}" == "samples/client/petstore/rust/" ]]; then
|
||||||
|
echo "Skipping tests for samples/client/petstore/rust/"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Iterate through each example and test various features
|
||||||
|
for package in $(find . -maxdepth 1 -mindepth 1 -type d)
|
||||||
|
do
|
||||||
|
# Not all versions have a client example
|
||||||
|
if test -f examples/client/main.rs; then
|
||||||
|
cargo build --example client --features="client"
|
||||||
|
fi
|
||||||
|
# Not all versions have a server example
|
||||||
|
if test -f examples/server/main.rs; then
|
||||||
|
cargo build --example server --features="server"
|
||||||
|
fi
|
||||||
|
# Test the CLI works if present
|
||||||
|
if test -f bin/cli.rs; then
|
||||||
|
cargo build --bin ${package##*/} --features cli
|
||||||
|
target/debug/${package##*/} --help
|
||||||
|
fi
|
||||||
|
cargo fmt
|
||||||
|
cargo test
|
||||||
|
cargo clippy
|
||||||
|
cargo doc
|
||||||
|
done
|
||||||
|
3
.github/workflows/samples-spring-jdk17.yaml
vendored
3
.github/workflows/samples-spring-jdk17.yaml
vendored
@ -10,6 +10,7 @@ on:
|
|||||||
- samples/server/petstore/springboot-lombok-tostring
|
- samples/server/petstore/springboot-lombok-tostring
|
||||||
- samples/server/petstore/springboot-file-delegate-optional
|
- samples/server/petstore/springboot-file-delegate-optional
|
||||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||||
|
- samples/server/petstore/spring-boot-oneof-sealed
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
|
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
|
||||||
@ -19,6 +20,7 @@ on:
|
|||||||
- samples/server/petstore/springboot-lombok-tostring
|
- samples/server/petstore/springboot-lombok-tostring
|
||||||
- samples/server/petstore/springboot-file-delegate-optional
|
- samples/server/petstore/springboot-file-delegate-optional
|
||||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||||
|
- samples/server/petstore/spring-boot-oneof-sealed
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build Java Spring (JDK17)
|
name: Build Java Spring (JDK17)
|
||||||
@ -36,6 +38,7 @@ jobs:
|
|||||||
- samples/server/petstore/springboot-lombok-tostring
|
- samples/server/petstore/springboot-lombok-tostring
|
||||||
- samples/server/petstore/springboot-file-delegate-optional
|
- samples/server/petstore/springboot-file-delegate-optional
|
||||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||||
|
- samples/server/petstore/spring-boot-oneof-sealed
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v4
|
||||||
|
22
README.md
22
README.md
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.14.0`):
|
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.15.0`):
|
||||||
[](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
|
[](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
|
||||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
|
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
|
||||||
@ -76,6 +76,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
|||||||
[<img src="https://openapi-generator.tech/img/companies/clickit.jpg" width="128" height="128">](https://www.clickittech.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
[<img src="https://openapi-generator.tech/img/companies/clickit.jpg" width="128" height="128">](https://www.clickittech.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||||
[<img src="https://openapi-generator.tech/img/companies/unified_to.jpg" width="128" height="128">](https://unified.to/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
[<img src="https://openapi-generator.tech/img/companies/unified_to.jpg" width="128" height="128">](https://unified.to/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||||
[<img src="https://openapi-generator.tech/img/companies/savetwt.jpg" width="128" height="128">](https://savetwt.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
[<img src="https://openapi-generator.tech/img/companies/savetwt.jpg" width="128" height="128">](https://savetwt.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||||
|
[<img src="https://openapi-generator.tech/img/companies/serpapi.png" width="128" height="128">](https://serpapi.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||||
|
|
||||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity
|
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
|||||||
| | Languages/Frameworks |
|
| | Languages/Frameworks |
|
||||||
| -------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| -------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 19.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
|
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 19.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
|
||||||
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
|
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Oat++, Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
|
||||||
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
|
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
|
||||||
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
||||||
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
|
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
|
||||||
@ -149,8 +150,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
|||||||
|
|
||||||
| OpenAPI Generator Version | Release Date | Notes |
|
| OpenAPI Generator Version | Release Date | Notes |
|
||||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||||
| 7.14.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.14.0-SNAPSHOT/) | 29.05.2025 | Minor release with breaking changes (with fallback) |
|
| 7.15.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.15.0-SNAPSHOT/) | 29.07.2025 | Minor release with breaking changes (with fallback) |
|
||||||
| [7.13.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.13.0) (latest stable release) | 27.04.2025 | Minor release with breaking changes (with fallback) |
|
| [7.14.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.14.0) (latest stable release) | 25.06.2025 | Minor release with breaking changes (with fallback) |
|
||||||
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
|
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
|
||||||
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
|
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
|
||||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||||
@ -213,16 +214,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
|
|||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
||||||
|
|
||||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.13.0/openapi-generator-cli-7.13.0.jar`
|
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar`
|
||||||
|
|
||||||
For **Mac/Linux** users:
|
For **Mac/Linux** users:
|
||||||
```sh
|
```sh
|
||||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.13.0/openapi-generator-cli-7.13.0.jar -O openapi-generator-cli.jar
|
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar -O openapi-generator-cli.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||||
```
|
```
|
||||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.13.0/openapi-generator-cli-7.13.0.jar
|
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||||
@ -457,7 +458,7 @@ openapi-generator-cli version
|
|||||||
To use a specific version of "openapi-generator-cli"
|
To use a specific version of "openapi-generator-cli"
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
openapi-generator-cli version-manager set 7.13.0
|
openapi-generator-cli version-manager set 7.14.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Or install it as dev-dependency:
|
Or install it as dev-dependency:
|
||||||
@ -481,7 +482,7 @@ pip install openapi-generator-cli
|
|||||||
|
|
||||||
To install a specific version
|
To install a specific version
|
||||||
```
|
```
|
||||||
pip install openapi-generator-cli==7.13.0
|
pip install openapi-generator-cli==7.14.0
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
|
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
|
||||||
@ -507,7 +508,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/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||||
|
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.13.0/openapi-generator-cli-7.13.0.jar)
|
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar)
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
|
|
||||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||||
@ -1127,6 +1128,7 @@ Here is a list of template creators:
|
|||||||
* C# Azure functions: @Abrhm7786
|
* C# Azure functions: @Abrhm7786
|
||||||
* C# NancyFX: @mstefaniuk
|
* C# NancyFX: @mstefaniuk
|
||||||
* C++ (Qt5 QHttpEngine): @etherealjoy
|
* C++ (Qt5 QHttpEngine): @etherealjoy
|
||||||
|
* C++ Oat++: @Kraust
|
||||||
* C++ Pistache: @sebymiano
|
* C++ Pistache: @sebymiano
|
||||||
* C++ Restbed: @stkrwork
|
* C++ Restbed: @stkrwork
|
||||||
* Erlang Server: @galaxie @nelsonvides
|
* Erlang Server: @galaxie @nelsonvides
|
||||||
|
6
bin/configs/cpp-oatpp-server-cpp-oatpp.yaml
Normal file
6
bin/configs/cpp-oatpp-server-cpp-oatpp.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
generatorName: cpp-oatpp-server
|
||||||
|
outputDir: samples/server/petstore/cpp-oatpp
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-oatpp-server/petstore.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/cpp-oatpp-server
|
||||||
|
additionalProperties:
|
||||||
|
addExternalLibs: "true"
|
8
bin/configs/dart-dio-binary-response.yaml
Normal file
8
bin/configs/dart-dio-binary-response.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: dart-dio
|
||||||
|
outputDir: samples/openapi3/client/petstore/dart-dio/binary_response
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_20682.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
enumUnknownDefaultCase: "true"
|
||||||
|
serializationLibrary: "json_serializable"
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: dart-dio
|
generatorName: dart-dio
|
||||||
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable
|
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
||||||
typeMappings:
|
typeMappings:
|
||||||
Client: "ModelClient"
|
Client: "ModelClient"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: dart-dio
|
generatorName: dart-dio
|
||||||
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
|
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
||||||
typeMappings:
|
typeMappings:
|
||||||
Client: "ModelClient"
|
Client: "ModelClient"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: dart
|
generatorName: dart
|
||||||
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake
|
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/dart2
|
templateDir: modules/openapi-generator/src/main/resources/dart2
|
||||||
typeMappings:
|
typeMappings:
|
||||||
Client: "ModelClient"
|
Client: "ModelClient"
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
generatorName: java
|
||||||
|
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny
|
||||||
|
library: microprofile
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||||
|
additionalProperties:
|
||||||
|
serializationLibrary: jackson
|
||||||
|
artifactId: microprofile-rest-client-3-jackson-mutiny
|
||||||
|
configKey: petstore
|
||||||
|
microprofileRestClientVersion: "3.0"
|
||||||
|
microprofileMutiny: true
|
||||||
|
hideGenerationTimestamp: true
|
8
bin/configs/rust-server-deprecated-multipart-v3.yaml
Normal file
8
bin/configs/rust-server-deprecated-multipart-v3.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/multipart-v3
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: multipart-v3
|
8
bin/configs/rust-server-deprecated-no-example-v3.yaml
Normal file
8
bin/configs/rust-server-deprecated-no-example-v3.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/no-example-v3
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/no-example-v3.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: no-example-v3
|
8
bin/configs/rust-server-deprecated-openapi-v3.yaml
Normal file
8
bin/configs/rust-server-deprecated-openapi-v3.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/openapi-v3
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: openapi-v3
|
8
bin/configs/rust-server-deprecated-ops-v3.yaml
Normal file
8
bin/configs/rust-server-deprecated-ops-v3.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/ops-v3
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: ops-v3
|
@ -0,0 +1,9 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/petstore-with-fake-endpoints-models-for-testing
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: petstore-with-fake-endpoints-models-for-testing
|
||||||
|
publishRustRegistry: crates-io
|
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/ping-bearer-auth
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: ping-bearer-auth
|
8
bin/configs/rust-server-deprecated-test.yaml
Normal file
8
bin/configs/rust-server-deprecated-test.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server-deprecated
|
||||||
|
outputDir: samples/server/petstore/rust-server-deprecated/output/rust-server-test
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server-deprecated
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: rust-server-test
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: scala-http4s-server
|
generatorName: scala-http4s-server
|
||||||
outputDir: samples/server/petstore/scala-http4s-server
|
outputDir: samples/server/petstore/scala-http4s-server
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/scala-http4s-server/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/scala-http4s-server
|
templateDir: modules/openapi-generator/src/main/resources/scala-http4s-server
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
artifactId: openapi-scala-http4s-server
|
artifactId: openapi-scala-http4s-server
|
13
bin/configs/spring-boot-oneof-sealed.yaml
Normal file
13
bin/configs/spring-boot-oneof-sealed.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
generatorName: spring
|
||||||
|
outputDir: samples/openapi3/server/petstore/spring-boot-oneof-sealed
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||||
|
additionalProperties:
|
||||||
|
groupId: org.openapitools.openapi3
|
||||||
|
documentationProvider: springdoc
|
||||||
|
artifactId: springboot-oneof-sealed
|
||||||
|
snapshotVersion: "true"
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
generateBuilders: true
|
||||||
|
useOneOfInterfaces: true
|
||||||
|
useSealed: true
|
8
bin/configs/typescript-angular-v20.yaml
Normal file
8
bin/configs/typescript-angular-v20.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: typescript-angular
|
||||||
|
outputDir: samples/client/petstore/typescript-angular-v20/builds/default
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
|
||||||
|
additionalProperties:
|
||||||
|
ngVersion: 20.0.0
|
||||||
|
npmName: sample-angular-20-0-0
|
||||||
|
supportsES6: true
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: typescript
|
generatorName: typescript
|
||||||
outputDir: samples/client/echo_api/typescript/build
|
outputDir: samples/client/echo_api/typescript/build
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript/echo_api.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/typescript
|
templateDir: modules/openapi-generator/src/main/resources/typescript
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
artifactId: echo-api-typescript
|
artifactId: echo-api-typescript
|
||||||
|
@ -48,4 +48,4 @@ workflows:
|
|||||||
|
|
||||||
meta:
|
meta:
|
||||||
bitrise.io:
|
bitrise.io:
|
||||||
stack: osx-xcode-16.0.x
|
stack: osx-xcode-16.3.x
|
||||||
|
@ -87,6 +87,7 @@ The following generators are available:
|
|||||||
* [ada-server](generators/ada-server.md)
|
* [ada-server](generators/ada-server.md)
|
||||||
* [aspnet-fastendpoints](generators/aspnet-fastendpoints.md)
|
* [aspnet-fastendpoints](generators/aspnet-fastendpoints.md)
|
||||||
* [aspnetcore](generators/aspnetcore.md)
|
* [aspnetcore](generators/aspnetcore.md)
|
||||||
|
* [cpp-oatpp-server](generators/cpp-oatpp-server.md)
|
||||||
* [cpp-pistache-server](generators/cpp-pistache-server.md)
|
* [cpp-pistache-server](generators/cpp-pistache-server.md)
|
||||||
* [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md)
|
* [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md)
|
||||||
* [cpp-restbed-server](generators/cpp-restbed-server.md)
|
* [cpp-restbed-server](generators/cpp-restbed-server.md)
|
||||||
@ -142,6 +143,7 @@ The following generators are available:
|
|||||||
* [ruby-sinatra](generators/ruby-sinatra.md)
|
* [ruby-sinatra](generators/ruby-sinatra.md)
|
||||||
* [rust-axum (beta)](generators/rust-axum.md)
|
* [rust-axum (beta)](generators/rust-axum.md)
|
||||||
* [rust-server](generators/rust-server.md)
|
* [rust-server](generators/rust-server.md)
|
||||||
|
* [rust-server-deprecated](generators/rust-server-deprecated.md)
|
||||||
* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md)
|
* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md)
|
||||||
* [scala-cask](generators/scala-cask.md)
|
* [scala-cask](generators/scala-cask.md)
|
||||||
* [scala-finch](generators/scala-finch.md)
|
* [scala-finch](generators/scala-finch.md)
|
||||||
|
@ -65,6 +65,7 @@ The following generators are available:
|
|||||||
## SERVER generators
|
## SERVER generators
|
||||||
* [ada-server](ada-server.md)
|
* [ada-server](ada-server.md)
|
||||||
* [aspnetcore](aspnetcore.md)
|
* [aspnetcore](aspnetcore.md)
|
||||||
|
* [cpp-oatpp-server](cpp-oatpp-server.md)
|
||||||
* [cpp-pistache-server](cpp-pistache-server.md)
|
* [cpp-pistache-server](cpp-pistache-server.md)
|
||||||
* [cpp-qt5-qhttpengine-server](cpp-qt5-qhttpengine-server.md)
|
* [cpp-qt5-qhttpengine-server](cpp-qt5-qhttpengine-server.md)
|
||||||
* [cpp-restbed-server](cpp-restbed-server.md)
|
* [cpp-restbed-server](cpp-restbed-server.md)
|
||||||
|
262
docs/generators/cpp-oatpp-server.md
Normal file
262
docs/generators/cpp-oatpp-server.md
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
---
|
||||||
|
title: Documentation for the cpp-oatpp-server Generator
|
||||||
|
---
|
||||||
|
|
||||||
|
## METADATA
|
||||||
|
|
||||||
|
| Property | Value | Notes |
|
||||||
|
| -------- | ----- | ----- |
|
||||||
|
| generator name | cpp-oatpp-server | pass this to the generate command after -g |
|
||||||
|
| generator stability | STABLE | |
|
||||||
|
| generator type | SERVER | |
|
||||||
|
| generator language | C++ | |
|
||||||
|
| generator default templating engine | mustache | |
|
||||||
|
| helpTxt | Generates a C++ API server (based on Oat++) | |
|
||||||
|
|
||||||
|
## CONFIG OPTIONS
|
||||||
|
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|addExternalLibs|Add the Possibility to fetch and compile external Libraries needed by this Framework.| |true|
|
||||||
|
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
|
||||||
|
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
|
||||||
|
|
||||||
|
## IMPORT MAPPING
|
||||||
|
|
||||||
|
| Type/Alias | Imports |
|
||||||
|
| ---------- | ------- |
|
||||||
|
|
||||||
|
|
||||||
|
## INSTANTIATION TYPES
|
||||||
|
|
||||||
|
| Type/Alias | Instantiated By |
|
||||||
|
| ---------- | --------------- |
|
||||||
|
|
||||||
|
|
||||||
|
## LANGUAGE PRIMITIVES
|
||||||
|
|
||||||
|
<ul class="column-ul">
|
||||||
|
<li>oatpp::Any</li>
|
||||||
|
<li>oatpp::Boolean</li>
|
||||||
|
<li>oatpp::Fields</li>
|
||||||
|
<li>oatpp::Float64</li>
|
||||||
|
<li>oatpp::Int32</li>
|
||||||
|
<li>oatpp::Int64</li>
|
||||||
|
<li>oatpp::Object</li>
|
||||||
|
<li>oatpp::String</li>
|
||||||
|
<li>oatpp::UnorderedSet</li>
|
||||||
|
<li>oatpp::Vector</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
## RESERVED WORDS
|
||||||
|
|
||||||
|
<ul class="column-ul">
|
||||||
|
<li>NULL</li>
|
||||||
|
<li>alignas</li>
|
||||||
|
<li>alignof</li>
|
||||||
|
<li>and</li>
|
||||||
|
<li>and_eq</li>
|
||||||
|
<li>asm</li>
|
||||||
|
<li>auto</li>
|
||||||
|
<li>bitand</li>
|
||||||
|
<li>bitor</li>
|
||||||
|
<li>bool</li>
|
||||||
|
<li>break</li>
|
||||||
|
<li>case</li>
|
||||||
|
<li>catch</li>
|
||||||
|
<li>char</li>
|
||||||
|
<li>char16_t</li>
|
||||||
|
<li>char32_t</li>
|
||||||
|
<li>class</li>
|
||||||
|
<li>compl</li>
|
||||||
|
<li>concept</li>
|
||||||
|
<li>const</li>
|
||||||
|
<li>const_cast</li>
|
||||||
|
<li>constexpr</li>
|
||||||
|
<li>continue</li>
|
||||||
|
<li>decltype</li>
|
||||||
|
<li>default</li>
|
||||||
|
<li>delete</li>
|
||||||
|
<li>do</li>
|
||||||
|
<li>double</li>
|
||||||
|
<li>dynamic_cast</li>
|
||||||
|
<li>else</li>
|
||||||
|
<li>enum</li>
|
||||||
|
<li>explicit</li>
|
||||||
|
<li>export</li>
|
||||||
|
<li>extern</li>
|
||||||
|
<li>false</li>
|
||||||
|
<li>float</li>
|
||||||
|
<li>for</li>
|
||||||
|
<li>friend</li>
|
||||||
|
<li>goto</li>
|
||||||
|
<li>if</li>
|
||||||
|
<li>inline</li>
|
||||||
|
<li>int</li>
|
||||||
|
<li>linux</li>
|
||||||
|
<li>long</li>
|
||||||
|
<li>mutable</li>
|
||||||
|
<li>namespace</li>
|
||||||
|
<li>new</li>
|
||||||
|
<li>noexcept</li>
|
||||||
|
<li>not</li>
|
||||||
|
<li>not_eq</li>
|
||||||
|
<li>nullptr</li>
|
||||||
|
<li>operator</li>
|
||||||
|
<li>or</li>
|
||||||
|
<li>or_eq</li>
|
||||||
|
<li>private</li>
|
||||||
|
<li>protected</li>
|
||||||
|
<li>public</li>
|
||||||
|
<li>register</li>
|
||||||
|
<li>reinterpret_cast</li>
|
||||||
|
<li>requires</li>
|
||||||
|
<li>return</li>
|
||||||
|
<li>short</li>
|
||||||
|
<li>signed</li>
|
||||||
|
<li>sizeof</li>
|
||||||
|
<li>static</li>
|
||||||
|
<li>static_assert</li>
|
||||||
|
<li>static_cast</li>
|
||||||
|
<li>struct</li>
|
||||||
|
<li>switch</li>
|
||||||
|
<li>template</li>
|
||||||
|
<li>this</li>
|
||||||
|
<li>thread_local</li>
|
||||||
|
<li>throw</li>
|
||||||
|
<li>true</li>
|
||||||
|
<li>try</li>
|
||||||
|
<li>typedef</li>
|
||||||
|
<li>typeid</li>
|
||||||
|
<li>typename</li>
|
||||||
|
<li>union</li>
|
||||||
|
<li>unsigned</li>
|
||||||
|
<li>using</li>
|
||||||
|
<li>virtual</li>
|
||||||
|
<li>void</li>
|
||||||
|
<li>volatile</li>
|
||||||
|
<li>wchar_t</li>
|
||||||
|
<li>while</li>
|
||||||
|
<li>xor</li>
|
||||||
|
<li>xor_eq</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
## FEATURE SET
|
||||||
|
|
||||||
|
|
||||||
|
### Client Modification Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|BasePath|✗|ToolingExtension
|
||||||
|
|Authorizations|✗|ToolingExtension
|
||||||
|
|UserAgent|✗|ToolingExtension
|
||||||
|
|MockServer|✗|ToolingExtension
|
||||||
|
|
||||||
|
### Data Type Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Custom|✗|OAS2,OAS3
|
||||||
|
|Int32|✓|OAS2,OAS3
|
||||||
|
|Int64|✓|OAS2,OAS3
|
||||||
|
|Float|✓|OAS2,OAS3
|
||||||
|
|Double|✓|OAS2,OAS3
|
||||||
|
|Decimal|✓|ToolingExtension
|
||||||
|
|String|✓|OAS2,OAS3
|
||||||
|
|Byte|✓|OAS2,OAS3
|
||||||
|
|Binary|✓|OAS2,OAS3
|
||||||
|
|Boolean|✓|OAS2,OAS3
|
||||||
|
|Date|✓|OAS2,OAS3
|
||||||
|
|DateTime|✓|OAS2,OAS3
|
||||||
|
|Password|✓|OAS2,OAS3
|
||||||
|
|File|✓|OAS2
|
||||||
|
|Uuid|✗|
|
||||||
|
|Array|✓|OAS2,OAS3
|
||||||
|
|Null|✗|OAS3
|
||||||
|
|AnyType|✗|OAS2,OAS3
|
||||||
|
|Object|✓|OAS2,OAS3
|
||||||
|
|Maps|✓|ToolingExtension
|
||||||
|
|CollectionFormat|✓|OAS2
|
||||||
|
|CollectionFormatMulti|✓|OAS2
|
||||||
|
|Enum|✓|OAS2,OAS3
|
||||||
|
|ArrayOfEnum|✓|ToolingExtension
|
||||||
|
|ArrayOfModel|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||||
|
|MapOfEnum|✓|ToolingExtension
|
||||||
|
|MapOfModel|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||||
|
|
||||||
|
### Documentation Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Readme|✓|ToolingExtension
|
||||||
|
|Model|✓|ToolingExtension
|
||||||
|
|Api|✓|ToolingExtension
|
||||||
|
|
||||||
|
### Global Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Host|✓|OAS2,OAS3
|
||||||
|
|BasePath|✓|OAS2,OAS3
|
||||||
|
|Info|✓|OAS2,OAS3
|
||||||
|
|Schemes|✗|OAS2,OAS3
|
||||||
|
|PartialSchemes|✓|OAS2,OAS3
|
||||||
|
|Consumes|✓|OAS2
|
||||||
|
|Produces|✓|OAS2
|
||||||
|
|ExternalDocumentation|✓|OAS2,OAS3
|
||||||
|
|Examples|✓|OAS2,OAS3
|
||||||
|
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||||
|
|MultiServer|✗|OAS3
|
||||||
|
|ParameterizedServer|✗|OAS3
|
||||||
|
|ParameterStyling|✗|OAS3
|
||||||
|
|Callbacks|✗|OAS3
|
||||||
|
|LinkObjects|✗|OAS3
|
||||||
|
|
||||||
|
### Parameter Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Path|✓|OAS2,OAS3
|
||||||
|
|Query|✓|OAS2,OAS3
|
||||||
|
|Header|✓|OAS2,OAS3
|
||||||
|
|Body|✓|OAS2
|
||||||
|
|FormUnencoded|✓|OAS2
|
||||||
|
|FormMultipart|✓|OAS2
|
||||||
|
|Cookie|✗|OAS3
|
||||||
|
|
||||||
|
### Schema Support Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Simple|✓|OAS2,OAS3
|
||||||
|
|Composite|✓|OAS2,OAS3
|
||||||
|
|Polymorphism|✗|OAS2,OAS3
|
||||||
|
|Union|✗|OAS3
|
||||||
|
|allOf|✗|OAS2,OAS3
|
||||||
|
|anyOf|✗|OAS3
|
||||||
|
|oneOf|✗|OAS3
|
||||||
|
|not|✗|OAS3
|
||||||
|
|
||||||
|
### Security Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|BasicAuth|✗|OAS2,OAS3
|
||||||
|
|ApiKey|✗|OAS2,OAS3
|
||||||
|
|OpenIDConnect|✗|OAS3
|
||||||
|
|BearerToken|✗|OAS3
|
||||||
|
|OAuth2_Implicit|✗|OAS2,OAS3
|
||||||
|
|OAuth2_Password|✗|OAS2,OAS3
|
||||||
|
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||||
|
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||||
|
|SignatureAuth|✗|OAS3
|
||||||
|
|AWSV4Signature|✗|ToolingExtension
|
||||||
|
|
||||||
|
### Wire Format Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|JSON|✓|OAS2,OAS3
|
||||||
|
|XML|✓|OAS2,OAS3
|
||||||
|
|PROTOBUF|✗|ToolingExtension
|
||||||
|
|Custom|✗|OAS2,OAS3
|
@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||||
|generateBuilders|Whether to generate builders for models| |false|
|
|generateBuilders|Whether to generate builders for models| |false|
|
||||||
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|
||||||
|
|generateGenericResponseEntity|Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. If enabled, method are generated with return type ResponseEntity<?>| |false|
|
||||||
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|
||||||
|groupId|groupId in generated pom.xml| |org.openapitools|
|
|groupId|groupId in generated pom.xml| |org.openapitools|
|
||||||
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
|
||||||
|
@ -66,7 +66,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|licenseName|The name of the license| |Unlicense|
|
|licenseName|The name of the license| |Unlicense|
|
||||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||||
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
||||||
|
|microprofileGlobalExceptionMapper|Should ApiExceptionMapper be annotated with @Provider making it a global exception mapper| |true|
|
||||||
|microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null|
|
|microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null|
|
||||||
|
|microprofileRegisterExceptionMapper|Should generated API Clients be annotated with @RegisterProvider(ApiExceptionMapper.class).| |true|
|
||||||
|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null|
|
|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null|
|
||||||
|modelPackage|package for generated models| |org.openapitools.client.model|
|
|modelPackage|package for generated models| |org.openapitools.client.model|
|
||||||
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
|
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
|
||||||
|
@ -66,7 +66,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|licenseName|The name of the license| |Unlicense|
|
|licenseName|The name of the license| |Unlicense|
|
||||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||||
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
||||||
|
|microprofileGlobalExceptionMapper|Should ApiExceptionMapper be annotated with @Provider making it a global exception mapper| |true|
|
||||||
|microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null|
|
|microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null|
|
||||||
|
|microprofileRegisterExceptionMapper|Should generated API Clients be annotated with @RegisterProvider(ApiExceptionMapper.class).| |true|
|
||||||
|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null|
|
|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null|
|
||||||
|modelPackage|package for generated models| |org.openapitools.client.model|
|
|modelPackage|package for generated models| |org.openapitools.client.model|
|
||||||
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
|
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
|
||||||
|
232
docs/generators/rust-server-deprecated.md
Normal file
232
docs/generators/rust-server-deprecated.md
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
---
|
||||||
|
title: Documentation for the rust-server-deprecated Generator
|
||||||
|
---
|
||||||
|
|
||||||
|
## METADATA
|
||||||
|
|
||||||
|
| Property | Value | Notes |
|
||||||
|
| -------- | ----- | ----- |
|
||||||
|
| generator name | rust-server-deprecated | pass this to the generate command after -g |
|
||||||
|
| generator stability | STABLE | |
|
||||||
|
| generator type | SERVER | |
|
||||||
|
| generator language | Rust | |
|
||||||
|
| generator default templating engine | mustache | |
|
||||||
|
| helpTxt | Generates a Rust Hyper/Tower server library based on hyper 0.14. Also generates a matching Hyper client library within the same crate that implements the same trait. | |
|
||||||
|
|
||||||
|
## CONFIG OPTIONS
|
||||||
|
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|packageName|Rust crate name (convention: snake_case).| |openapi_client|
|
||||||
|
|packageVersion|Rust crate version.| |null|
|
||||||
|
|
||||||
|
## IMPORT MAPPING
|
||||||
|
|
||||||
|
| Type/Alias | Imports |
|
||||||
|
| ---------- | ------- |
|
||||||
|
|
||||||
|
|
||||||
|
## INSTANTIATION TYPES
|
||||||
|
|
||||||
|
| Type/Alias | Instantiated By |
|
||||||
|
| ---------- | --------------- |
|
||||||
|
|array|Vec|
|
||||||
|
|map|std::collections::HashMap|
|
||||||
|
|
||||||
|
|
||||||
|
## LANGUAGE PRIMITIVES
|
||||||
|
|
||||||
|
<ul class="column-ul">
|
||||||
|
<li>String</li>
|
||||||
|
<li>bool</li>
|
||||||
|
<li>char</li>
|
||||||
|
<li>f32</li>
|
||||||
|
<li>f64</li>
|
||||||
|
<li>i16</li>
|
||||||
|
<li>i32</li>
|
||||||
|
<li>i64</li>
|
||||||
|
<li>i8</li>
|
||||||
|
<li>isize</li>
|
||||||
|
<li>str</li>
|
||||||
|
<li>u16</li>
|
||||||
|
<li>u32</li>
|
||||||
|
<li>u64</li>
|
||||||
|
<li>u8</li>
|
||||||
|
<li>usize</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
## RESERVED WORDS
|
||||||
|
|
||||||
|
<ul class="column-ul">
|
||||||
|
<li>Self</li>
|
||||||
|
<li>abstract</li>
|
||||||
|
<li>as</li>
|
||||||
|
<li>async</li>
|
||||||
|
<li>await</li>
|
||||||
|
<li>become</li>
|
||||||
|
<li>box</li>
|
||||||
|
<li>break</li>
|
||||||
|
<li>const</li>
|
||||||
|
<li>continue</li>
|
||||||
|
<li>crate</li>
|
||||||
|
<li>do</li>
|
||||||
|
<li>dyn</li>
|
||||||
|
<li>else</li>
|
||||||
|
<li>enum</li>
|
||||||
|
<li>extern</li>
|
||||||
|
<li>false</li>
|
||||||
|
<li>final</li>
|
||||||
|
<li>fn</li>
|
||||||
|
<li>for</li>
|
||||||
|
<li>if</li>
|
||||||
|
<li>impl</li>
|
||||||
|
<li>in</li>
|
||||||
|
<li>let</li>
|
||||||
|
<li>loop</li>
|
||||||
|
<li>macro</li>
|
||||||
|
<li>match</li>
|
||||||
|
<li>mod</li>
|
||||||
|
<li>move</li>
|
||||||
|
<li>mut</li>
|
||||||
|
<li>override</li>
|
||||||
|
<li>priv</li>
|
||||||
|
<li>pub</li>
|
||||||
|
<li>ref</li>
|
||||||
|
<li>return</li>
|
||||||
|
<li>self</li>
|
||||||
|
<li>static</li>
|
||||||
|
<li>struct</li>
|
||||||
|
<li>super</li>
|
||||||
|
<li>trait</li>
|
||||||
|
<li>true</li>
|
||||||
|
<li>try</li>
|
||||||
|
<li>type</li>
|
||||||
|
<li>typeof</li>
|
||||||
|
<li>unsafe</li>
|
||||||
|
<li>unsized</li>
|
||||||
|
<li>use</li>
|
||||||
|
<li>virtual</li>
|
||||||
|
<li>where</li>
|
||||||
|
<li>while</li>
|
||||||
|
<li>yield</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
## FEATURE SET
|
||||||
|
|
||||||
|
|
||||||
|
### Client Modification Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|BasePath|✓|ToolingExtension
|
||||||
|
|Authorizations|✗|ToolingExtension
|
||||||
|
|UserAgent|✗|ToolingExtension
|
||||||
|
|MockServer|✗|ToolingExtension
|
||||||
|
|
||||||
|
### Data Type Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Custom|✗|OAS2,OAS3
|
||||||
|
|Int32|✓|OAS2,OAS3
|
||||||
|
|Int64|✓|OAS2,OAS3
|
||||||
|
|Float|✓|OAS2,OAS3
|
||||||
|
|Double|✓|OAS2,OAS3
|
||||||
|
|Decimal|✓|ToolingExtension
|
||||||
|
|String|✓|OAS2,OAS3
|
||||||
|
|Byte|✓|OAS2,OAS3
|
||||||
|
|Binary|✓|OAS2,OAS3
|
||||||
|
|Boolean|✓|OAS2,OAS3
|
||||||
|
|Date|✓|OAS2,OAS3
|
||||||
|
|DateTime|✓|OAS2,OAS3
|
||||||
|
|Password|✓|OAS2,OAS3
|
||||||
|
|File|✓|OAS2
|
||||||
|
|Uuid|✗|
|
||||||
|
|Array|✓|OAS2,OAS3
|
||||||
|
|Null|✗|OAS3
|
||||||
|
|AnyType|✗|OAS2,OAS3
|
||||||
|
|Object|✓|OAS2,OAS3
|
||||||
|
|Maps|✓|ToolingExtension
|
||||||
|
|CollectionFormat|✓|OAS2
|
||||||
|
|CollectionFormatMulti|✓|OAS2
|
||||||
|
|Enum|✓|OAS2,OAS3
|
||||||
|
|ArrayOfEnum|✓|ToolingExtension
|
||||||
|
|ArrayOfModel|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||||
|
|MapOfEnum|✓|ToolingExtension
|
||||||
|
|MapOfModel|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||||
|
|
||||||
|
### Documentation Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Readme|✓|ToolingExtension
|
||||||
|
|Model|✓|ToolingExtension
|
||||||
|
|Api|✓|ToolingExtension
|
||||||
|
|
||||||
|
### Global Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Host|✓|OAS2,OAS3
|
||||||
|
|BasePath|✓|OAS2,OAS3
|
||||||
|
|Info|✓|OAS2,OAS3
|
||||||
|
|Schemes|✗|OAS2,OAS3
|
||||||
|
|PartialSchemes|✓|OAS2,OAS3
|
||||||
|
|Consumes|✓|OAS2
|
||||||
|
|Produces|✓|OAS2
|
||||||
|
|ExternalDocumentation|✓|OAS2,OAS3
|
||||||
|
|Examples|✓|OAS2,OAS3
|
||||||
|
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||||
|
|MultiServer|✗|OAS3
|
||||||
|
|ParameterizedServer|✗|OAS3
|
||||||
|
|ParameterStyling|✗|OAS3
|
||||||
|
|Callbacks|✓|OAS3
|
||||||
|
|LinkObjects|✗|OAS3
|
||||||
|
|
||||||
|
### Parameter Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Path|✓|OAS2,OAS3
|
||||||
|
|Query|✓|OAS2,OAS3
|
||||||
|
|Header|✓|OAS2,OAS3
|
||||||
|
|Body|✓|OAS2
|
||||||
|
|FormUnencoded|✓|OAS2
|
||||||
|
|FormMultipart|✓|OAS2
|
||||||
|
|Cookie|✗|OAS3
|
||||||
|
|
||||||
|
### Schema Support Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Simple|✓|OAS2,OAS3
|
||||||
|
|Composite|✓|OAS2,OAS3
|
||||||
|
|Polymorphism|✗|OAS2,OAS3
|
||||||
|
|Union|✗|OAS3
|
||||||
|
|allOf|✗|OAS2,OAS3
|
||||||
|
|anyOf|✗|OAS3
|
||||||
|
|oneOf|✗|OAS3
|
||||||
|
|not|✗|OAS3
|
||||||
|
|
||||||
|
### Security Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|BasicAuth|✓|OAS2,OAS3
|
||||||
|
|ApiKey|✓|OAS2,OAS3
|
||||||
|
|OpenIDConnect|✗|OAS3
|
||||||
|
|BearerToken|✓|OAS3
|
||||||
|
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||||
|
|OAuth2_Password|✗|OAS2,OAS3
|
||||||
|
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||||
|
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||||
|
|SignatureAuth|✗|OAS3
|
||||||
|
|AWSV4Signature|✗|ToolingExtension
|
||||||
|
|
||||||
|
### Wire Format Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|JSON|✓|OAS2,OAS3
|
||||||
|
|XML|✓|OAS2,OAS3
|
||||||
|
|PROTOBUF|✗|ToolingExtension
|
||||||
|
|Custom|✓|OAS2,OAS3
|
@ -51,6 +51,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||||
|generateBuilders|Whether to generate builders for models| |false|
|
|generateBuilders|Whether to generate builders for models| |false|
|
||||||
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|
||||||
|
|generateGenericResponseEntity|Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. If enabled, method are generated with return type ResponseEntity<?>| |false|
|
||||||
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|
||||||
|groupId|groupId in generated pom.xml| |org.openapitools|
|
|groupId|groupId in generated pom.xml| |org.openapitools|
|
||||||
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
|
||||||
|
@ -11,7 +11,7 @@ title: Documentation for the typescript-angular Generator
|
|||||||
| generator type | CLIENT | |
|
| generator type | CLIENT | |
|
||||||
| generator language | Typescript | |
|
| generator language | Typescript | |
|
||||||
| generator default templating engine | mustache | |
|
| generator default templating engine | mustache | |
|
||||||
| helpTxt | Generates a TypeScript Angular (9.x - 19.x) client library. | |
|
| helpTxt | Generates a TypeScript Angular (9.x - 20.x) client library. | |
|
||||||
|
|
||||||
## CONFIG OPTIONS
|
## CONFIG OPTIONS
|
||||||
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||||
@ -34,7 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
|
||||||
|modelSuffix|The suffix of the generated model.| |null|
|
|modelSuffix|The suffix of the generated model.| |null|
|
||||||
|ngPackagrVersion|The version of ng-packagr compatible with Angular (see ngVersion option).| |null|
|
|ngPackagrVersion|The version of ng-packagr compatible with Angular (see ngVersion option).| |null|
|
||||||
|ngVersion|The version of Angular. (At least 9.0.0)| |19.0.0|
|
|ngVersion|The version of Angular. (At least 9.0.0)| |20.0.0|
|
||||||
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
|
|npmName|The name under which you want to publish generated npm package. Required to generate a full 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 your private npmRepo in the package.json| |null|
|
||||||
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|
||||||
@ -75,20 +75,42 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Blob</li>
|
<li>Blob</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -55,19 +55,41 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -66,19 +66,41 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -66,19 +66,41 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -60,20 +60,42 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Blob</li>
|
<li>Blob</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -57,19 +57,41 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -66,20 +66,42 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Blob</li>
|
<li>Blob</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -56,23 +56,45 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
<li>Buffer</li>
|
<li>Buffer</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
<li>ReadStream</li>
|
<li>ReadStream</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
<li>RequestDetailedFile</li>
|
<li>RequestDetailedFile</li>
|
||||||
<li>RequestFile</li>
|
<li>RequestFile</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -58,19 +58,41 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -57,20 +57,42 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Blob</li>
|
<li>Blob</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||||
|
|useErasableSyntax|Use erasable syntax for the generated code. This is a temporary feature and will be removed in the future.| |false|
|
||||||
|useInversify|Enable this to generate decorators and service identifiers for the InversifyJS inversion of control container. If you set 'deno' as 'platform', the generator will process this value as 'disable'.| |false|
|
|useInversify|Enable this to generate decorators and service identifiers for the InversifyJS inversion of control container. If you set 'deno' as 'platform', the generator will process this value as 'disable'.| |false|
|
||||||
|useObjectParameters|Use aggregate parameter objects as function arguments for api operations instead of passing each parameter as a separate function argument.| |false|
|
|useObjectParameters|Use aggregate parameter objects as function arguments for api operations instead of passing each parameter as a separate function argument.| |false|
|
||||||
|useRxJS|Enable this to internally use rxjs observables. If disabled, a stub is used instead. This is required for the 'angular' framework.| |false|
|
|useRxJS|Enable this to internally use rxjs observables. If disabled, a stub is used instead. This is required for the 'angular' framework.| |false|
|
||||||
@ -63,19 +64,41 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|
|
||||||
<ul class="column-ul">
|
<ul class="column-ul">
|
||||||
<li>Array</li>
|
<li>Array</li>
|
||||||
|
<li>Awaited</li>
|
||||||
<li>Boolean</li>
|
<li>Boolean</li>
|
||||||
|
<li>Capitalize</li>
|
||||||
|
<li>ConstructorParameters</li>
|
||||||
<li>Date</li>
|
<li>Date</li>
|
||||||
<li>Double</li>
|
<li>Double</li>
|
||||||
<li>Error</li>
|
<li>Error</li>
|
||||||
|
<li>Exclude</li>
|
||||||
|
<li>Extract</li>
|
||||||
<li>File</li>
|
<li>File</li>
|
||||||
<li>Float</li>
|
<li>Float</li>
|
||||||
|
<li>InstanceType</li>
|
||||||
<li>Integer</li>
|
<li>Integer</li>
|
||||||
<li>Long</li>
|
<li>Long</li>
|
||||||
|
<li>Lowercase</li>
|
||||||
<li>Map</li>
|
<li>Map</li>
|
||||||
|
<li>NoInfer</li>
|
||||||
|
<li>NonNullable</li>
|
||||||
<li>Object</li>
|
<li>Object</li>
|
||||||
|
<li>Omit</li>
|
||||||
|
<li>OmitThisParameter</li>
|
||||||
|
<li>Parameters</li>
|
||||||
|
<li>Partial</li>
|
||||||
|
<li>Pick</li>
|
||||||
|
<li>Readonly</li>
|
||||||
<li>ReadonlyArray</li>
|
<li>ReadonlyArray</li>
|
||||||
|
<li>Record</li>
|
||||||
|
<li>Required</li>
|
||||||
|
<li>ReturnType</li>
|
||||||
<li>Set</li>
|
<li>Set</li>
|
||||||
<li>String</li>
|
<li>String</li>
|
||||||
|
<li>ThisParameterType</li>
|
||||||
|
<li>ThisType</li>
|
||||||
|
<li>Uncapitalize</li>
|
||||||
|
<li>Uppercase</li>
|
||||||
<li>any</li>
|
<li>any</li>
|
||||||
<li>boolean</li>
|
<li>boolean</li>
|
||||||
<li>number</li>
|
<li>number</li>
|
||||||
|
@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
|
|||||||
To install a specific version of the tool, pass the version during installation:
|
To install a specific version of the tool, pass the version during installation:
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
```bash
|
```bash
|
||||||
openapi-generator-cli version-manager set 7.12.0
|
openapi-generator-cli version-manager set 7.14.0
|
||||||
```
|
```
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
To install the tool as a dev dependency in your current project:
|
To install the tool as a dev dependency in your current project:
|
||||||
@ -119,18 +119,18 @@ docker run --rm \
|
|||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
||||||
|
|
||||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar`
|
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar`
|
||||||
|
|
||||||
For **Mac/Linux** users:
|
For **Mac/Linux** users:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar -O openapi-generator-cli.jar
|
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar -O openapi-generator-cli.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar
|
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar
|
||||||
```
|
```
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<version>7.12.0</version>
|
<version>7.14.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -162,7 +162,7 @@ public class Generate extends OpenApiGeneratorCommand {
|
|||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = {"--openapi-generator-ignore-list"},
|
name = {"--openapi-generator-ignore-list"},
|
||||||
title = ".openapi-generaotr-ignore list",
|
title = ".openapi-generator-ignore list",
|
||||||
description = "specifies entries in the .openapi-generator-ignore file relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml"
|
description = "specifies entries in the .openapi-generator-ignore file relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml"
|
||||||
+ " You can also have multiple occurrences of this option.")
|
+ " You can also have multiple occurrences of this option.")
|
||||||
private List<String> openapiGeneratorIgnoreList = new ArrayList<>();
|
private List<String> openapiGeneratorIgnoreList = new ArrayList<>();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
|
|||||||
[source,group]
|
[source,group]
|
||||||
----
|
----
|
||||||
plugins {
|
plugins {
|
||||||
id "org.openapi.generator" version "7.12.0"
|
id "org.openapi.generator" version "7.14.0"
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ buildscript {
|
|||||||
// url "https://plugins.gradle.org/m2/"
|
// url "https://plugins.gradle.org/m2/"
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.openapitools:openapi-generator-gradle-plugin:7.10.0"
|
classpath "org.openapitools:openapi-generator-gradle-plugin:7.14.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||||
classpath('org.openapitools:openapi-generator-gradle-plugin:7.10.0') {
|
classpath('org.openapitools:openapi-generator-gradle-plugin:7.14.0') {
|
||||||
exclude group: 'com.google.guava'
|
exclude group: 'com.google.guava'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=7.14.0
|
openApiGeneratorVersion=7.15.0-SNAPSHOT
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
|
||||||
# BEGIN placeholders
|
# BEGIN placeholders
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -19,5 +19,5 @@ gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
|
|||||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gradle -PopenApiGeneratorVersion=7.12.0 openApiValidate
|
gradle -PopenApiGeneratorVersion=7.14.0 openApiValidate
|
||||||
```
|
```
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# RELEASE_VERSION
|
# RELEASE_VERSION
|
||||||
openApiGeneratorVersion=7.14.0
|
openApiGeneratorVersion=7.15.0-SNAPSHOT
|
||||||
# /RELEASE_VERSION
|
# /RELEASE_VERSION
|
||||||
|
@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.12.0</version>
|
<version>7.14.0</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
<artifactId>openapi-generator-project</artifactId>
|
<artifactId>openapi-generator-project</artifactId>
|
||||||
<!-- RELEASE_VERSION -->
|
<!-- RELEASE_VERSION -->
|
||||||
<version>7.14.0</version>
|
<version>7.15.0-SNAPSHOT</version>
|
||||||
<!-- /RELEASE_VERSION -->
|
<!-- /RELEASE_VERSION -->
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -31,7 +31,8 @@ import java.util.*;
|
|||||||
public class CodegenParameter implements IJsonSchemaValidationProperties {
|
public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||||
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
|
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
|
||||||
isCookieParam, isBodyParam, isContainer,
|
isCookieParam, isBodyParam, isContainer,
|
||||||
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue;
|
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue,
|
||||||
|
isFormStyle, isSpaceDelimited, isPipeDelimited;
|
||||||
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType,
|
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType,
|
||||||
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style;
|
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style;
|
||||||
|
|
||||||
@ -268,6 +269,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
output.isExplode = this.isExplode;
|
output.isExplode = this.isExplode;
|
||||||
output.style = this.style;
|
output.style = this.style;
|
||||||
output.isDeepObject = this.isDeepObject;
|
output.isDeepObject = this.isDeepObject;
|
||||||
|
output.isFormStyle = this.isFormStyle;
|
||||||
|
output.isSpaceDelimited = this.isSpaceDelimited;
|
||||||
|
output.isPipeDelimited = this.isPipeDelimited;
|
||||||
output.isMatrix = this.isMatrix;
|
output.isMatrix = this.isMatrix;
|
||||||
output.isAllowEmptyValue = this.isAllowEmptyValue;
|
output.isAllowEmptyValue = this.isAllowEmptyValue;
|
||||||
output.contentType = this.contentType;
|
output.contentType = this.contentType;
|
||||||
@ -282,6 +286,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description,
|
paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description,
|
||||||
unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue,
|
unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue,
|
||||||
enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples,
|
enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples,
|
||||||
|
isFormStyle, isSpaceDelimited, isPipeDelimited,
|
||||||
jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal,
|
jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal,
|
||||||
isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword,
|
isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword,
|
||||||
isFreeFormObject, isAnyType, isArray, isMap, isOptional, isFile, isEnum, isEnumRef, _enum, allowableValues,
|
isFreeFormObject, isAnyType, isArray, isMap, isOptional, isFile, isEnum, isEnumRef, _enum, allowableValues,
|
||||||
@ -375,6 +380,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
Objects.equals(enumName, that.enumName) &&
|
Objects.equals(enumName, that.enumName) &&
|
||||||
Objects.equals(style, that.style) &&
|
Objects.equals(style, that.style) &&
|
||||||
Objects.equals(isDeepObject, that.isDeepObject) &&
|
Objects.equals(isDeepObject, that.isDeepObject) &&
|
||||||
|
Objects.equals(isFormStyle, that.isFormStyle) &&
|
||||||
|
Objects.equals(isSpaceDelimited, that.isSpaceDelimited) &&
|
||||||
|
Objects.equals(isPipeDelimited, that.isPipeDelimited) &&
|
||||||
Objects.equals(isMatrix, that.isMatrix) &&
|
Objects.equals(isMatrix, that.isMatrix) &&
|
||||||
Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) &&
|
Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) &&
|
||||||
Objects.equals(example, that.example) &&
|
Objects.equals(example, that.example) &&
|
||||||
@ -440,6 +448,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
sb.append(", enumName='").append(enumName).append('\'');
|
sb.append(", enumName='").append(enumName).append('\'');
|
||||||
sb.append(", style='").append(style).append('\'');
|
sb.append(", style='").append(style).append('\'');
|
||||||
sb.append(", deepObject='").append(isDeepObject).append('\'');
|
sb.append(", deepObject='").append(isDeepObject).append('\'');
|
||||||
|
sb.append(", isFormStyle='").append(isFormStyle).append('\'');
|
||||||
|
sb.append(", isSpaceDelimited='").append(isSpaceDelimited).append('\'');
|
||||||
|
sb.append(", isPipeDelimited='").append(isPipeDelimited).append('\'');
|
||||||
sb.append(", isMatrix='").append(isMatrix).append('\'');
|
sb.append(", isMatrix='").append(isMatrix).append('\'');
|
||||||
sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\'');
|
sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\'');
|
||||||
sb.append(", example='").append(example).append('\'');
|
sb.append(", example='").append(example).append('\'');
|
||||||
|
@ -54,6 +54,7 @@ import org.openapitools.codegen.examples.ExampleGenerator;
|
|||||||
import org.openapitools.codegen.languages.PhpNextgenClientCodegen;
|
import org.openapitools.codegen.languages.PhpNextgenClientCodegen;
|
||||||
import org.openapitools.codegen.languages.RustAxumServerCodegen;
|
import org.openapitools.codegen.languages.RustAxumServerCodegen;
|
||||||
import org.openapitools.codegen.languages.RustServerCodegen;
|
import org.openapitools.codegen.languages.RustServerCodegen;
|
||||||
|
import org.openapitools.codegen.languages.RustServerCodegenDeprecated;
|
||||||
import org.openapitools.codegen.meta.FeatureSet;
|
import org.openapitools.codegen.meta.FeatureSet;
|
||||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||||
import org.openapitools.codegen.meta.Stability;
|
import org.openapitools.codegen.meta.Stability;
|
||||||
@ -2134,6 +2135,9 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
codegenParameter.style = style.toString();
|
codegenParameter.style = style.toString();
|
||||||
|
codegenParameter.isFormStyle = Encoding.StyleEnum.FORM == style;
|
||||||
|
codegenParameter.isSpaceDelimited = Encoding.StyleEnum.SPACE_DELIMITED == style;
|
||||||
|
codegenParameter.isPipeDelimited = Encoding.StyleEnum.PIPE_DELIMITED == style;
|
||||||
codegenParameter.isDeepObject = Encoding.StyleEnum.DEEP_OBJECT == style;
|
codegenParameter.isDeepObject = Encoding.StyleEnum.DEEP_OBJECT == style;
|
||||||
|
|
||||||
if (codegenParameter.isContainer) {
|
if (codegenParameter.isContainer) {
|
||||||
@ -3681,7 +3685,8 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
if (ModelUtils.isComposedSchema(schema) && !this.getLegacyDiscriminatorBehavior()) {
|
if (ModelUtils.isComposedSchema(schema) && !this.getLegacyDiscriminatorBehavior()) {
|
||||||
List<MappedModel> otherDescendants = getOneOfAnyOfDescendants(schemaName, discriminatorPropertyName, schema);
|
List<MappedModel> otherDescendants = getOneOfAnyOfDescendants(schemaName, discriminatorPropertyName, schema);
|
||||||
for (MappedModel otherDescendant : otherDescendants) {
|
for (MappedModel otherDescendant : otherDescendants) {
|
||||||
if (!uniqueDescendants.contains(otherDescendant)) {
|
// add only if the model names are not the same
|
||||||
|
if (uniqueDescendants.stream().map(MappedModel::getModelName).noneMatch(it -> it.equals(otherDescendant.getModelName()))) {
|
||||||
uniqueDescendants.add(otherDescendant);
|
uniqueDescendants.add(otherDescendant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5328,7 +5333,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
parameterSchema = unaliasSchema(parameter.getSchema());
|
parameterSchema = unaliasSchema(parameter.getSchema());
|
||||||
parameterModelName = getParameterDataType(parameter, parameterSchema);
|
parameterModelName = getParameterDataType(parameter, parameterSchema);
|
||||||
CodegenProperty prop;
|
CodegenProperty prop;
|
||||||
if (this instanceof RustServerCodegen) {
|
if (this instanceof RustServerCodegen || this instanceof RustServerCodegenDeprecated) {
|
||||||
// for rust server, we need to do something special as it uses
|
// for rust server, we need to do something special as it uses
|
||||||
// $ref (e.g. #components/schemas/Pet) to determine whether it's a model
|
// $ref (e.g. #components/schemas/Pet) to determine whether it's a model
|
||||||
prop = fromProperty(parameter.getName(), parameterSchema, false);
|
prop = fromProperty(parameter.getName(), parameterSchema, false);
|
||||||
@ -5396,6 +5401,9 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
if (parameter.getStyle() != null) {
|
if (parameter.getStyle() != null) {
|
||||||
codegenParameter.style = parameter.getStyle().toString();
|
codegenParameter.style = parameter.getStyle().toString();
|
||||||
codegenParameter.isDeepObject = Parameter.StyleEnum.DEEPOBJECT == parameter.getStyle();
|
codegenParameter.isDeepObject = Parameter.StyleEnum.DEEPOBJECT == parameter.getStyle();
|
||||||
|
codegenParameter.isFormStyle = Parameter.StyleEnum.FORM == parameter.getStyle();
|
||||||
|
codegenParameter.isSpaceDelimited = Parameter.StyleEnum.SPACEDELIMITED == parameter.getStyle();
|
||||||
|
codegenParameter.isPipeDelimited = Parameter.StyleEnum.PIPEDELIMITED == parameter.getStyle();
|
||||||
codegenParameter.isMatrix = Parameter.StyleEnum.MATRIX == parameter.getStyle();
|
codegenParameter.isMatrix = Parameter.StyleEnum.MATRIX == parameter.getStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,6 +626,22 @@ public class DefaultGenerator implements Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this method splits the specified property by commas, trims any results for spaces and
|
||||||
|
* newlines, and returns them as a Set of Strings. the method will return an empty
|
||||||
|
* set if the specified property has not been set or is an empty string.
|
||||||
|
*/
|
||||||
|
private Set<String> getPropertyAsSet(String propertyName) {
|
||||||
|
String propertyRaw = GlobalSettings.getProperty(propertyName);
|
||||||
|
if (propertyRaw == null || propertyRaw.isEmpty()) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Arrays.stream(propertyRaw.split(","))
|
||||||
|
.map(String::trim)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
}
|
||||||
|
|
||||||
private Set<String> modelKeys() {
|
private Set<String> modelKeys() {
|
||||||
final Map<String, Schema> schemas = ModelUtils.getSchemas(this.openAPI);
|
final Map<String, Schema> schemas = ModelUtils.getSchemas(this.openAPI);
|
||||||
if (schemas == null) {
|
if (schemas == null) {
|
||||||
@ -633,12 +649,7 @@ public class DefaultGenerator implements Generator {
|
|||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
String modelNames = GlobalSettings.getProperty("models");
|
Set<String> modelsToGenerate = getPropertyAsSet(CodegenConstants.MODELS);
|
||||||
Set<String> modelsToGenerate = null;
|
|
||||||
if (modelNames != null && !modelNames.isEmpty()) {
|
|
||||||
modelsToGenerate = new HashSet<>(Arrays.asList(modelNames.split(",")));
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<String> modelKeys = schemas.keySet();
|
Set<String> modelKeys = schemas.keySet();
|
||||||
if (modelsToGenerate != null && !modelsToGenerate.isEmpty()) {
|
if (modelsToGenerate != null && !modelsToGenerate.isEmpty()) {
|
||||||
Set<String> updatedKeys = new HashSet<>();
|
Set<String> updatedKeys = new HashSet<>();
|
||||||
@ -661,11 +672,7 @@ public class DefaultGenerator implements Generator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, List<CodegenOperation>> paths = processPaths(this.openAPI.getPaths());
|
Map<String, List<CodegenOperation>> paths = processPaths(this.openAPI.getPaths());
|
||||||
Set<String> apisToGenerate = null;
|
Set<String> apisToGenerate = getPropertyAsSet(CodegenConstants.APIS);
|
||||||
String apiNames = GlobalSettings.getProperty(CodegenConstants.APIS);
|
|
||||||
if (apiNames != null && !apiNames.isEmpty()) {
|
|
||||||
apisToGenerate = new HashSet<>(Arrays.asList(apiNames.split(",")));
|
|
||||||
}
|
|
||||||
if (apisToGenerate != null && !apisToGenerate.isEmpty()) {
|
if (apisToGenerate != null && !apisToGenerate.isEmpty()) {
|
||||||
Map<String, List<CodegenOperation>> updatedPaths = new TreeMap<>();
|
Map<String, List<CodegenOperation>> updatedPaths = new TreeMap<>();
|
||||||
for (String m : paths.keySet()) {
|
for (String m : paths.keySet()) {
|
||||||
@ -827,11 +834,7 @@ public class DefaultGenerator implements Generator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, List<CodegenOperation>> webhooks = processWebhooks(this.openAPI.getWebhooks());
|
Map<String, List<CodegenOperation>> webhooks = processWebhooks(this.openAPI.getWebhooks());
|
||||||
Set<String> webhooksToGenerate = null;
|
Set<String> webhooksToGenerate = getPropertyAsSet(CodegenConstants.WEBHOOKS);
|
||||||
String webhookNames = GlobalSettings.getProperty(CodegenConstants.WEBHOOKS);
|
|
||||||
if (webhookNames != null && !webhookNames.isEmpty()) {
|
|
||||||
webhooksToGenerate = new HashSet<>(Arrays.asList(webhookNames.split(",")));
|
|
||||||
}
|
|
||||||
if (webhooksToGenerate != null && !webhooksToGenerate.isEmpty()) {
|
if (webhooksToGenerate != null && !webhooksToGenerate.isEmpty()) {
|
||||||
Map<String, List<CodegenOperation>> Webhooks = new TreeMap<>();
|
Map<String, List<CodegenOperation>> Webhooks = new TreeMap<>();
|
||||||
for (String m : webhooks.keySet()) {
|
for (String m : webhooks.keySet()) {
|
||||||
@ -1064,12 +1067,7 @@ public class DefaultGenerator implements Generator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> supportingFilesToGenerate = null;
|
Set<String> supportingFilesToGenerate = getPropertyAsSet(CodegenConstants.SUPPORTING_FILES);
|
||||||
String supportingFiles = GlobalSettings.getProperty(CodegenConstants.SUPPORTING_FILES);
|
|
||||||
if (supportingFiles != null && !supportingFiles.isEmpty()) {
|
|
||||||
supportingFilesToGenerate = new HashSet<>(Arrays.asList(supportingFiles.split(",")));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (SupportingFile support : config.supportingFiles()) {
|
for (SupportingFile support : config.supportingFiles()) {
|
||||||
try {
|
try {
|
||||||
String outputFolder = config.outputFolder();
|
String outputFolder = config.outputFolder();
|
||||||
|
@ -683,6 +683,7 @@ public class CodegenConfigurator {
|
|||||||
final List<AuthorizationValue> authorizationValues = AuthParser.parse(this.auth);
|
final List<AuthorizationValue> authorizationValues = AuthParser.parse(this.auth);
|
||||||
ParseOptions options = new ParseOptions();
|
ParseOptions options = new ParseOptions();
|
||||||
options.setResolve(true);
|
options.setResolve(true);
|
||||||
|
options.setResolveResponses(true);
|
||||||
SwaggerParseResult result = new OpenAPIParser().readLocation(inputSpec, authorizationValues, options);
|
SwaggerParseResult result = new OpenAPIParser().readLocation(inputSpec, authorizationValues, options);
|
||||||
|
|
||||||
// TODO: Move custom validations to a separate type as part of a "Workflow"
|
// TODO: Move custom validations to a separate type as part of a "Workflow"
|
||||||
|
@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
@ -50,6 +51,7 @@ import org.openapitools.codegen.model.ModelMap;
|
|||||||
import org.openapitools.codegen.model.ModelsMap;
|
import org.openapitools.codegen.model.ModelsMap;
|
||||||
import org.openapitools.codegen.model.OperationMap;
|
import org.openapitools.codegen.model.OperationMap;
|
||||||
import org.openapitools.codegen.model.OperationsMap;
|
import org.openapitools.codegen.model.OperationsMap;
|
||||||
|
import org.openapitools.codegen.templating.mustache.ReplaceAllLambda;
|
||||||
import org.openapitools.codegen.utils.CamelizeOption;
|
import org.openapitools.codegen.utils.CamelizeOption;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -572,7 +572,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
if (value.isEmpty()) {
|
if (value.isEmpty()) {
|
||||||
modified = "EMPTY";
|
modified = "EMPTY";
|
||||||
} else {
|
} else {
|
||||||
modified = value;
|
modified = value.replaceAll("-", "_");
|
||||||
modified = sanitizeKotlinSpecificNames(modified);
|
modified = sanitizeKotlinSpecificNames(modified);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,8 +183,8 @@ public abstract class AbstractRustCodegen extends DefaultCodegen implements Code
|
|||||||
throw new IllegalArgumentException("Unknown CasingType");
|
throw new IllegalArgumentException("Unknown CasingType");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace hyphens with underscores
|
// Replace hyphens and periods with underscores
|
||||||
name = name.replaceAll("-", "_");
|
name = name.replaceAll("[\\.\\-]", "_");
|
||||||
|
|
||||||
// Apply special character escapes, e.g. "@type" => "At_type"
|
// Apply special character escapes, e.g. "@type" => "At_type"
|
||||||
// Remove the trailing underscore if necessary
|
// Remove the trailing underscore if necessary
|
||||||
|
@ -304,6 +304,14 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
// Typescript reserved words
|
// Typescript reserved words
|
||||||
"abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));
|
"abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));
|
||||||
|
|
||||||
|
Set<String> utilityTypes = new HashSet<>(Arrays.asList(
|
||||||
|
"Awaited","Partial","Required","Readonly","Record","Pick","Omit","Exclude","Extract","NonNullable",
|
||||||
|
"Parameters","ConstructorParameters","ReturnType","InstanceType","NoInfer","ThisParameterType",
|
||||||
|
"OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize")
|
||||||
|
);
|
||||||
|
defaultIncludes = new HashSet<>();
|
||||||
|
defaultIncludes.addAll(utilityTypes);
|
||||||
|
|
||||||
languageSpecificPrimitives = new HashSet<>(Arrays.asList(
|
languageSpecificPrimitives = new HashSet<>(Arrays.asList(
|
||||||
"string",
|
"string",
|
||||||
"String",
|
"String",
|
||||||
@ -325,6 +333,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
"object",
|
"object",
|
||||||
"Set"
|
"Set"
|
||||||
));
|
));
|
||||||
|
languageSpecificPrimitives.addAll(utilityTypes);
|
||||||
|
|
||||||
languageGenericTypes = new HashSet<>(Collections.singletonList(
|
languageGenericTypes = new HashSet<>(Collections.singletonList(
|
||||||
"Array"
|
"Array"
|
||||||
@ -805,7 +814,8 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
return openAPIType;
|
return openAPIType;
|
||||||
} else if (typeMapping.containsKey(openAPIType)) {
|
} else if (typeMapping.containsKey(openAPIType)) {
|
||||||
type = typeMapping.get(openAPIType);
|
type = typeMapping.get(openAPIType);
|
||||||
if (languageSpecificPrimitives.contains(type)) {
|
String typeWithoutGeneric = typeWithoutGeneric(type);
|
||||||
|
if (languageSpecificPrimitives.contains(typeWithoutGeneric)) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1157,6 +1167,16 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
}).distinct().collect(Collectors.toList());
|
}).distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean needToImport(String type) {
|
||||||
|
return super.needToImport(typeWithoutGeneric(type));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String typeWithoutGeneric(String type) {
|
||||||
|
int genericIndex = type.indexOf("<");
|
||||||
|
return genericIndex == -1 ? type : type.substring(0, genericIndex);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneratorLanguage generatorLanguage() {
|
public GeneratorLanguage generatorLanguage() {
|
||||||
return GeneratorLanguage.TYPESCRIPT;
|
return GeneratorLanguage.TYPESCRIPT;
|
||||||
|
@ -0,0 +1,502 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.Operation;
|
||||||
|
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||||
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||||
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.openapitools.codegen.*;
|
||||||
|
import org.openapitools.codegen.meta.features.*;
|
||||||
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
|
import org.openapitools.codegen.model.OperationMap;
|
||||||
|
import org.openapitools.codegen.model.OperationsMap;
|
||||||
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||||
|
|
||||||
|
public class CppOatppServerCodegen extends AbstractCppCodegen {
|
||||||
|
private final Logger LOGGER = LoggerFactory.getLogger(CppOatppServerCodegen.class);
|
||||||
|
|
||||||
|
protected String implFolder = "impl";
|
||||||
|
protected boolean isAddExternalLibs = true;
|
||||||
|
public static final String OPTIONAL_EXTERNAL_LIB = "addExternalLibs";
|
||||||
|
public static final String OPTIONAL_EXTERNAL_LIB_DESC = "Add the Possibility to fetch and compile external Libraries needed by this Framework.";
|
||||||
|
protected final String PREFIX = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodegenType getTag() {
|
||||||
|
return CodegenType.SERVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "cpp-oatpp-server";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getHelp() {
|
||||||
|
return "Generates a C++ API server (based on Oat++)";
|
||||||
|
}
|
||||||
|
|
||||||
|
public CppOatppServerCodegen() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
// TODO: cpp-oatpp-server maintainer review
|
||||||
|
modifyFeatureSet(features -> features
|
||||||
|
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||||
|
.securityFeatures(EnumSet.noneOf(SecurityFeature.class))
|
||||||
|
.excludeGlobalFeatures(
|
||||||
|
GlobalFeature.XMLStructureDefinitions,
|
||||||
|
GlobalFeature.Callbacks,
|
||||||
|
GlobalFeature.LinkObjects,
|
||||||
|
GlobalFeature.ParameterStyling,
|
||||||
|
GlobalFeature.MultiServer)
|
||||||
|
.excludeSchemaSupportFeatures(
|
||||||
|
SchemaSupportFeature.Polymorphism)
|
||||||
|
.excludeParameterFeatures(
|
||||||
|
ParameterFeature.Cookie));
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(modelNamePrefix)) {
|
||||||
|
modelNamePrefix = PREFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
apiPackage = "org.openapitools.server.api";
|
||||||
|
modelPackage = "org.openapitools.server.model";
|
||||||
|
|
||||||
|
apiTemplateFiles.put("api-header.mustache", ".hpp");
|
||||||
|
apiTemplateFiles.put("api-impl-header.mustache", ".hpp");
|
||||||
|
apiTemplateFiles.put("api-impl-source.mustache", ".cpp");
|
||||||
|
|
||||||
|
modelTemplateFiles.put("model-header.mustache", ".hpp");
|
||||||
|
|
||||||
|
embeddedTemplateDir = templateDir = "cpp-oatpp-server";
|
||||||
|
|
||||||
|
cliOptions.clear();
|
||||||
|
addSwitch(OPTIONAL_EXTERNAL_LIB, OPTIONAL_EXTERNAL_LIB_DESC, this.isAddExternalLibs);
|
||||||
|
addOption(RESERVED_WORD_PREFIX_OPTION, RESERVED_WORD_PREFIX_DESC, this.reservedWordPrefix);
|
||||||
|
addOption(VARIABLE_NAME_FIRST_CHARACTER_UPPERCASE_OPTION,
|
||||||
|
VARIABLE_NAME_FIRST_CHARACTER_UPPERCASE_DESC,
|
||||||
|
Boolean.toString(this.variableNameFirstCharacterUppercase));
|
||||||
|
|
||||||
|
setupSupportingFiles();
|
||||||
|
|
||||||
|
languageSpecificPrimitives = new HashSet<>(
|
||||||
|
Arrays.asList(
|
||||||
|
"oatpp::String",
|
||||||
|
"oatpp::Boolean",
|
||||||
|
"oatpp::Int32",
|
||||||
|
"oatpp::Int64",
|
||||||
|
"oatpp::Vector",
|
||||||
|
"oatpp::Fields",
|
||||||
|
"oatpp::UnorderedSet",
|
||||||
|
"oatpp::Object",
|
||||||
|
"oatpp::Float64",
|
||||||
|
"oatpp::Any"
|
||||||
|
));
|
||||||
|
|
||||||
|
typeMapping = new HashMap<>();
|
||||||
|
typeMapping.put("date", "oatpp::String");
|
||||||
|
typeMapping.put("DateTime", "oatpp::String");
|
||||||
|
typeMapping.put("string", "oatpp::String");
|
||||||
|
typeMapping.put("integer", "oatpp::Int32");
|
||||||
|
typeMapping.put("long", "oatpp::Int64");
|
||||||
|
typeMapping.put("boolean", "oatpp::Boolean");
|
||||||
|
typeMapping.put("array", "oatpp::Vector");
|
||||||
|
typeMapping.put("map", "oatpp::Fields");
|
||||||
|
typeMapping.put("set", "oatpp::UnorderedSet");
|
||||||
|
typeMapping.put("file", "oatpp::String");
|
||||||
|
typeMapping.put("object", "oatpp::Object");
|
||||||
|
typeMapping.put("binary", "oatpp::String");
|
||||||
|
typeMapping.put("number", "oatpp::Float64");
|
||||||
|
typeMapping.put("UUID", "oatpp::String");
|
||||||
|
typeMapping.put("URI", "oatpp::String");
|
||||||
|
typeMapping.put("ByteArray", "oatpp::String");
|
||||||
|
typeMapping.put("AnyType", "oatpp::Any");
|
||||||
|
|
||||||
|
super.importMapping = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupSupportingFiles() {
|
||||||
|
supportingFiles.clear();
|
||||||
|
supportingFiles
|
||||||
|
.add(new SupportingFile("main-api-server.mustache", "", modelNamePrefix + "main-api-server.cpp"));
|
||||||
|
supportingFiles.add(new SupportingFile("cmake.mustache", "", "CMakeLists.txt"));
|
||||||
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processOpts() {
|
||||||
|
super.processOpts();
|
||||||
|
if (additionalProperties.containsKey("modelNamePrefix")) {
|
||||||
|
additionalProperties().put("prefix", modelNamePrefix);
|
||||||
|
setupSupportingFiles();
|
||||||
|
}
|
||||||
|
if (additionalProperties.containsKey(RESERVED_WORD_PREFIX_OPTION)) {
|
||||||
|
reservedWordPrefix = (String) additionalProperties.get(RESERVED_WORD_PREFIX_OPTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
additionalProperties.put("modelNamespaceDeclarations", modelPackage.split("\\."));
|
||||||
|
additionalProperties.put("modelNamespace", modelPackage.replaceAll("\\.", "::"));
|
||||||
|
additionalProperties.put("apiNamespaceDeclarations", apiPackage.split("\\."));
|
||||||
|
additionalProperties.put("apiNamespace", apiPackage.replaceAll("\\.", "::"));
|
||||||
|
additionalProperties.put(RESERVED_WORD_PREFIX_OPTION, reservedWordPrefix);
|
||||||
|
|
||||||
|
if (additionalProperties.containsKey(OPTIONAL_EXTERNAL_LIB)) {
|
||||||
|
setAddExternalLibs(convertPropertyToBooleanAndWriteBack(OPTIONAL_EXTERNAL_LIB));
|
||||||
|
} else {
|
||||||
|
additionalProperties.put(OPTIONAL_EXTERNAL_LIB, isAddExternalLibs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelImport(String name) {
|
||||||
|
if (importMapping.containsKey(name)) {
|
||||||
|
return importMapping.get(name);
|
||||||
|
} else {
|
||||||
|
return "#include \"" + name + ".hpp\"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodegenModel fromModel(String name, Schema model) {
|
||||||
|
CodegenModel codegenModel = super.fromModel(name, model);
|
||||||
|
|
||||||
|
Set<String> oldImports = codegenModel.imports;
|
||||||
|
codegenModel.imports = new HashSet<>();
|
||||||
|
for (String imp : oldImports) {
|
||||||
|
String newImp = toModelImport(imp);
|
||||||
|
if (!newImp.isEmpty()) {
|
||||||
|
codegenModel.imports.add(newImp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!codegenModel.isEnum
|
||||||
|
&& codegenModel.anyOf.size() > 1
|
||||||
|
&& codegenModel.anyOf.contains("std::string")
|
||||||
|
&& !codegenModel.anyOf.contains("AnyType")
|
||||||
|
&& codegenModel.interfaces.size() == 1) {
|
||||||
|
codegenModel.vendorExtensions.put("x-is-string-enum-container", true);
|
||||||
|
}
|
||||||
|
return codegenModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List<Server> servers) {
|
||||||
|
CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers);
|
||||||
|
|
||||||
|
if (operation.getResponses() != null && !operation.getResponses().isEmpty()) {
|
||||||
|
ApiResponse apiResponse = findMethodResponse(operation.getResponses());
|
||||||
|
|
||||||
|
if (apiResponse != null) {
|
||||||
|
Schema response = ModelUtils.getSchemaFromResponse(openAPI, apiResponse);
|
||||||
|
if (response != null) {
|
||||||
|
CodegenProperty cm = fromProperty("response", response, false);
|
||||||
|
op.vendorExtensions.put("x-codegen-response", cm);
|
||||||
|
if ("HttpContent".equals(cm.dataType)) {
|
||||||
|
op.vendorExtensions.put("x-codegen-response-ishttpcontent", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String pathForOatpp = path.replaceAll("\\{(.*?)}", "{$1}");
|
||||||
|
op.vendorExtensions.put("x-codegen-oatpp-path", pathForOatpp);
|
||||||
|
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) {
|
||||||
|
OperationMap operations = objs.getOperations();
|
||||||
|
String classname = operations.getClassname();
|
||||||
|
operations.put("classnameSnakeUpperCase", underscore(classname).toUpperCase(Locale.ROOT));
|
||||||
|
operations.put("classnameSnakeLowerCase", underscore(classname).toLowerCase(Locale.ROOT));
|
||||||
|
List<CodegenOperation> operationList = operations.getOperation();
|
||||||
|
for (CodegenOperation op : operationList) {
|
||||||
|
postProcessSingleOperation(operations, op);
|
||||||
|
}
|
||||||
|
|
||||||
|
return objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void postProcessSingleOperation(OperationMap operations, CodegenOperation op) {
|
||||||
|
if (op.vendorExtensions == null) {
|
||||||
|
op.vendorExtensions = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (op.bodyParam != null) {
|
||||||
|
if (op.bodyParam.vendorExtensions == null) {
|
||||||
|
op.bodyParam.vendorExtensions = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isStringOrDate = op.bodyParam.isString || op.bodyParam.isDate;
|
||||||
|
op.bodyParam.vendorExtensions.put("x-codegen-oatpp-is-string-or-date", isStringOrDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean consumeJson = false;
|
||||||
|
if (op.consumes != null) {
|
||||||
|
Predicate<Map<String, String>> isMediaTypeJson = consume -> (consume.get("mediaType") != null
|
||||||
|
&& consume.get("mediaType").equals("application/json"));
|
||||||
|
consumeJson = op.consumes.stream().anyMatch(isMediaTypeJson);
|
||||||
|
}
|
||||||
|
op.vendorExtensions.put("x-codegen-oatpp-consumes-json", consumeJson);
|
||||||
|
|
||||||
|
// Check if any one of the operations needs a model, then at API file level, at
|
||||||
|
// least one model has to be included.
|
||||||
|
Predicate<String> importNotInImportMapping = hdr -> !importMapping.containsKey(hdr);
|
||||||
|
if (op.imports.stream().anyMatch(importNotInImportMapping)) {
|
||||||
|
operations.put("hasModelImport", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* postProcessSingleParam - Modifies a single parameter, adjusting generated
|
||||||
|
* data types for Header and Query parameters.
|
||||||
|
*
|
||||||
|
* @param param CodegenParameter to be modified.
|
||||||
|
*/
|
||||||
|
private static void postProcessSingleParam(CodegenParameter param) {
|
||||||
|
if (param.isQueryParam) {
|
||||||
|
param.dataType = "std::optional<" + param.dataType + ">";
|
||||||
|
if (!param.isPrimitiveType) {
|
||||||
|
param.baseType = "std::optional<" + param.baseType + ">";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelFilename(String name) {
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiFilename(String templateName, String tag) {
|
||||||
|
String result = super.apiFilename(templateName, tag);
|
||||||
|
|
||||||
|
if (templateName.endsWith("impl-header.mustache")) {
|
||||||
|
result = implFilenameFromApiFilename(result, ".hpp");
|
||||||
|
} else if (templateName.endsWith("impl-source.mustache")) {
|
||||||
|
result = implFilenameFromApiFilename(result, ".cpp");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* implFilenameFromApiFilename - Inserts the string "Controller" in front of the
|
||||||
|
* suffix and replace "api" with "impl" directory prefix.
|
||||||
|
*
|
||||||
|
* @param filename Filename of the api-file to be modified
|
||||||
|
* @param suffix Suffix of the file (usually ".cpp" or ".hpp")
|
||||||
|
* @return a filename string of impl file.
|
||||||
|
*/
|
||||||
|
private String implFilenameFromApiFilename(String filename, String suffix) {
|
||||||
|
String result = filename.substring(0, filename.length() - suffix.length()) + "Controller" + suffix;
|
||||||
|
result = result.replace(apiFileFolder(), implFileFolder());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toApiFilename(String name) {
|
||||||
|
return toApiName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional - type declaration. This is a String which is used by the
|
||||||
|
* templates to instantiate your types. There is typically special handling
|
||||||
|
* for different property types
|
||||||
|
*
|
||||||
|
* @return a string value used as the `dataType` field for model templates,
|
||||||
|
* `returnType` for api templates
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getTypeDeclaration(Schema p) {
|
||||||
|
String openAPIType = getSchemaType(p);
|
||||||
|
|
||||||
|
if (ModelUtils.isArraySchema(p)) {
|
||||||
|
ArraySchema ap = (ArraySchema) p;
|
||||||
|
Schema inner = ap.getItems();
|
||||||
|
if (languageSpecificPrimitives.contains(getSchemaType(inner))) {
|
||||||
|
return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">";
|
||||||
|
}
|
||||||
|
return getSchemaType(p) + "<oatpp::Object<" + getTypeDeclaration(inner) + ">>";
|
||||||
|
}
|
||||||
|
if (ModelUtils.isMapSchema(p)) {
|
||||||
|
Schema inner = ModelUtils.getAdditionalProperties(p);
|
||||||
|
return getSchemaType(p) + "<std::string, " + getTypeDeclaration(inner) + ">";
|
||||||
|
} else if (ModelUtils.isByteArraySchema(p)) {
|
||||||
|
return "std::string";
|
||||||
|
}
|
||||||
|
if (ModelUtils.isStringSchema(p)
|
||||||
|
|| ModelUtils.isDateSchema(p)
|
||||||
|
|| ModelUtils.isDateTimeSchema(p) || ModelUtils.isFileSchema(p)
|
||||||
|
|| languageSpecificPrimitives.contains(openAPIType)) {
|
||||||
|
return toModelName(openAPIType);
|
||||||
|
}
|
||||||
|
|
||||||
|
String namespace = (String) additionalProperties.get("modelNamespace");
|
||||||
|
return namespace + "::" + openAPIType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toDefaultValue(Schema p) {
|
||||||
|
if (ModelUtils.isStringSchema(p)) {
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return "\"" + p.getDefault().toString() + "\"";
|
||||||
|
} else {
|
||||||
|
return "\"\"";
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isBooleanSchema(p)) {
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return p.getDefault().toString();
|
||||||
|
} else {
|
||||||
|
return "false";
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isDateSchema(p)) {
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return "\"" + p.getDefault().toString() + "\"";
|
||||||
|
} else {
|
||||||
|
return "\"\"";
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isDateTimeSchema(p)) {
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return "\"" + p.getDefault().toString() + "\"";
|
||||||
|
} else {
|
||||||
|
return "\"\"";
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isNumberSchema(p)) {
|
||||||
|
if (ModelUtils.isFloatSchema(p)) { // float
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
// We have to ensure that our default value has a decimal point,
|
||||||
|
// because in C++ the 'f' suffix is not valid on integer literals
|
||||||
|
// i.e. 374.0f is a valid float but 374 isn't.
|
||||||
|
String defaultStr = p.getDefault().toString();
|
||||||
|
if (defaultStr.indexOf('.') < 0) {
|
||||||
|
return defaultStr + ".0f";
|
||||||
|
} else {
|
||||||
|
return defaultStr + "f";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return "0.0f";
|
||||||
|
}
|
||||||
|
} else { // double
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return p.getDefault().toString();
|
||||||
|
} else {
|
||||||
|
return "0.0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isIntegerSchema(p)) {
|
||||||
|
if (ModelUtils.isLongSchema(p)) { // long
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return p.getDefault().toString() + "L";
|
||||||
|
} else {
|
||||||
|
return "0L";
|
||||||
|
}
|
||||||
|
} else { // integer
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return p.getDefault().toString();
|
||||||
|
} else {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isByteArraySchema(p)) {
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return "\"" + p.getDefault().toString() + "\"";
|
||||||
|
} else {
|
||||||
|
return "\"\"";
|
||||||
|
}
|
||||||
|
} else if (ModelUtils.isMapSchema(p)) {
|
||||||
|
String inner = getSchemaType(ModelUtils.getAdditionalProperties(p));
|
||||||
|
return "std::map<std::string, " + inner + ">()";
|
||||||
|
} else if (ModelUtils.isArraySchema(p)) {
|
||||||
|
ArraySchema ap = (ArraySchema) p;
|
||||||
|
String inner = getSchemaType(ap.getItems());
|
||||||
|
if (!languageSpecificPrimitives.contains(inner)) {
|
||||||
|
inner = "std::shared_ptr<" + inner + ">";
|
||||||
|
}
|
||||||
|
return "std::vector<" + inner + ">()";
|
||||||
|
} else if (!StringUtils.isEmpty(p.get$ref())) {
|
||||||
|
return "std::make_shared<" + toModelName(ModelUtils.getSimpleRef(p.get$ref())) + ">()";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "nullptr";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Location to write model files. You can use the modelPackage() as defined
|
||||||
|
* when the class is instantiated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String modelFileFolder() {
|
||||||
|
return (outputFolder + "/model").replace("/", File.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Location to write api files. You can use the apiPackage() as defined when
|
||||||
|
* the class is instantiated
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String apiFileFolder() {
|
||||||
|
return (outputFolder + "/api").replace("/", File.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String implFileFolder() {
|
||||||
|
return (outputFolder + "/" + implFolder).replace("/", File.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional - OpenAPI type conversion. This is used to map OpenAPI types in
|
||||||
|
* a `Schema` into either language specific types via `typeMapping` or
|
||||||
|
* into complex models if there is not a mapping.
|
||||||
|
*
|
||||||
|
* @return a string value of the type or complex model for this property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getSchemaType(Schema p) {
|
||||||
|
String openAPIType = super.getSchemaType(p);
|
||||||
|
String type = null;
|
||||||
|
if (typeMapping.containsKey(openAPIType)) {
|
||||||
|
type = typeMapping.get(openAPIType);
|
||||||
|
} else {
|
||||||
|
type = openAPIType;
|
||||||
|
}
|
||||||
|
return toModelName(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTypeDeclaration(String str) {
|
||||||
|
return toModelName(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify whether external libraries will be added during the generation
|
||||||
|
*
|
||||||
|
* @param value the value to be set
|
||||||
|
*/
|
||||||
|
public void setAddExternalLibs(boolean value) {
|
||||||
|
isAddExternalLibs = value;
|
||||||
|
}
|
||||||
|
}
|
@ -670,6 +670,17 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
op.imports.remove("Uint8List");
|
op.imports.remove("Uint8List");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SERIALIZATION_LIBRARY_JSON_SERIALIZABLE.equals(library)) {
|
||||||
|
// built_value serialization uses Uint8List for all MultipartFile types
|
||||||
|
// in json_serialization, MultipartFile is used as the file parameter type, but
|
||||||
|
// MultipartFile isn't readable, instead we convert this to a Uin8List
|
||||||
|
if (op.isResponseFile) {
|
||||||
|
op.imports.add("Uint8List");
|
||||||
|
op.returnType = "Uint8List";
|
||||||
|
op.returnBaseType = "Uint8List";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resultImports.addAll(rewriteImports(op.imports, false));
|
resultImports.addAll(rewriteImports(op.imports, false));
|
||||||
|
|
||||||
if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) {
|
if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) {
|
||||||
|
@ -70,6 +70,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
public static final String CASE_INSENSITIVE_RESPONSE_HEADERS = "caseInsensitiveResponseHeaders";
|
public static final String CASE_INSENSITIVE_RESPONSE_HEADERS = "caseInsensitiveResponseHeaders";
|
||||||
public static final String MICROPROFILE_FRAMEWORK = "microprofileFramework";
|
public static final String MICROPROFILE_FRAMEWORK = "microprofileFramework";
|
||||||
public static final String MICROPROFILE_MUTINY = "microprofileMutiny";
|
public static final String MICROPROFILE_MUTINY = "microprofileMutiny";
|
||||||
|
public static final String MICROPROFILE_GLOBAL_EXCEPTION_MAPPER = "microprofileGlobalExceptionMapper";
|
||||||
|
public static final String MICROPROFILE_REGISTER_EXCEPTION_MAPPER = "microprofileRegisterExceptionMapper";
|
||||||
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
|
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
|
||||||
public static final String DYNAMIC_OPERATIONS = "dynamicOperations";
|
public static final String DYNAMIC_OPERATIONS = "dynamicOperations";
|
||||||
public static final String SUPPORT_STREAMING = "supportStreaming";
|
public static final String SUPPORT_STREAMING = "supportStreaming";
|
||||||
@ -120,6 +122,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
@Setter protected String microprofileFramework = MICROPROFILE_DEFAULT;
|
@Setter protected String microprofileFramework = MICROPROFILE_DEFAULT;
|
||||||
@Setter protected String microprofileRestClientVersion = MICROPROFILE_REST_CLIENT_DEFAULT_VERSION;
|
@Setter protected String microprofileRestClientVersion = MICROPROFILE_REST_CLIENT_DEFAULT_VERSION;
|
||||||
@Setter protected boolean microprofileMutiny = false;
|
@Setter protected boolean microprofileMutiny = false;
|
||||||
|
@Setter protected boolean microProfileGlobalExceptionMapper = true;
|
||||||
|
@Setter protected boolean microProfileRegisterExceptionMapper = true;
|
||||||
@Setter protected String configKey = null;
|
@Setter protected String configKey = null;
|
||||||
@Setter(AccessLevel.PRIVATE) protected boolean configKeyFromClassName = false;
|
@Setter(AccessLevel.PRIVATE) protected boolean configKeyFromClassName = false;
|
||||||
|
|
||||||
@ -229,6 +233,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
cliOptions.add(CliOption.newBoolean(CASE_INSENSITIVE_RESPONSE_HEADERS, "Make API response's headers case-insensitive. Available on " + OKHTTP_GSON + ", " + JERSEY2 + " libraries"));
|
cliOptions.add(CliOption.newBoolean(CASE_INSENSITIVE_RESPONSE_HEADERS, "Make API response's headers case-insensitive. Available on " + OKHTTP_GSON + ", " + JERSEY2 + " libraries"));
|
||||||
cliOptions.add(CliOption.newString(MICROPROFILE_FRAMEWORK, "Framework for microprofile. Possible values \"kumuluzee\""));
|
cliOptions.add(CliOption.newString(MICROPROFILE_FRAMEWORK, "Framework for microprofile. Possible values \"kumuluzee\""));
|
||||||
cliOptions.add(CliOption.newString(MICROPROFILE_MUTINY, "Whether to use async types for microprofile (currently only Smallrye Mutiny is supported)."));
|
cliOptions.add(CliOption.newString(MICROPROFILE_MUTINY, "Whether to use async types for microprofile (currently only Smallrye Mutiny is supported)."));
|
||||||
|
cliOptions.add(CliOption.newString(MICROPROFILE_REGISTER_EXCEPTION_MAPPER, "Should generated API Clients be annotated with @RegisterProvider(ApiExceptionMapper.class).").defaultValue("true"));
|
||||||
|
cliOptions.add(CliOption.newString(MICROPROFILE_GLOBAL_EXCEPTION_MAPPER, "Should ApiExceptionMapper be annotated with @Provider making it a global exception mapper").defaultValue("true"));
|
||||||
cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries"));
|
cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries"));
|
||||||
cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations));
|
cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations));
|
||||||
cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint (beta)", this.supportStreaming));
|
cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint (beta)", this.supportStreaming));
|
||||||
@ -380,6 +386,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
}
|
}
|
||||||
convertPropertyToStringAndWriteBack(MICROPROFILE_FRAMEWORK, this::setMicroprofileFramework);
|
convertPropertyToStringAndWriteBack(MICROPROFILE_FRAMEWORK, this::setMicroprofileFramework);
|
||||||
|
|
||||||
|
convertPropertyToBooleanAndWriteBack(MICROPROFILE_GLOBAL_EXCEPTION_MAPPER, this::setMicroProfileGlobalExceptionMapper);
|
||||||
|
convertPropertyToBooleanAndWriteBack(MICROPROFILE_REGISTER_EXCEPTION_MAPPER, this::setMicroProfileRegisterExceptionMapper);
|
||||||
|
|
||||||
|
additionalProperties.put(MICROPROFILE_REGISTER_EXCEPTION_MAPPER, microProfileRegisterExceptionMapper);
|
||||||
|
additionalProperties.put(MICROPROFILE_GLOBAL_EXCEPTION_MAPPER, microProfileGlobalExceptionMapper);
|
||||||
|
|
||||||
convertPropertyToBooleanAndWriteBack(MICROPROFILE_MUTINY, this::setMicroprofileMutiny);
|
convertPropertyToBooleanAndWriteBack(MICROPROFILE_MUTINY, this::setMicroprofileMutiny);
|
||||||
|
|
||||||
convertPropertyToStringAndWriteBack(MICROPROFILE_REST_CLIENT_VERSION, value -> microprofileRestClientVersion = value);
|
convertPropertyToStringAndWriteBack(MICROPROFILE_REST_CLIENT_VERSION, value -> microprofileRestClientVersion = value);
|
||||||
@ -615,6 +627,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
||||||
supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", modelsFolder, "AbstractOpenApiSchema.java"));
|
supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", modelsFolder, "AbstractOpenApiSchema.java"));
|
||||||
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
||||||
|
|
||||||
|
// Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema.
|
||||||
|
// In principle, this should be enabled by default for all code generators. However due to limitations
|
||||||
|
// in other code generators, support needs to be enabled on a case-by-case basis.
|
||||||
|
// The flag below should be set for all Java libraries, but the templates need to be ported
|
||||||
|
// one by one for each library.
|
||||||
|
supportsAdditionalPropertiesWithComposedSchema = true;
|
||||||
} else if (libRestEasy) {
|
} else if (libRestEasy) {
|
||||||
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
||||||
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
||||||
@ -702,6 +721,15 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
additionalProperties.put("jsonbPolymorphism", true);
|
additionalProperties.put("jsonbPolymorphism", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getSerializationLibrary().equals(SERIALIZATION_LIBRARY_JACKSON)) {
|
||||||
|
// Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema.
|
||||||
|
// In principle, this should be enabled by default for all code generators. However due to limitations
|
||||||
|
// in other code generators, support needs to be enabled on a case-by-case basis.
|
||||||
|
// The flag below should be set for all Java libraries, but the templates need to be ported
|
||||||
|
// one by one for each library.
|
||||||
|
supportsAdditionalPropertiesWithComposedSchema = true;
|
||||||
|
}
|
||||||
} else if (libApache) {
|
} else if (libApache) {
|
||||||
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
||||||
} else {
|
} else {
|
||||||
@ -1230,11 +1258,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addImportsToOneOfInterface(List<Map<String, String>> imports) {
|
public void addImportsToOneOfInterface(List<Map<String, String>> imports) {
|
||||||
for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) {
|
if(additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) {
|
||||||
Map<String, String> oneImport = new HashMap<>();
|
for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) {
|
||||||
oneImport.put("import", importMapping.get(i));
|
Map<String, String> oneImport = new HashMap<>();
|
||||||
if (!imports.contains(oneImport)) {
|
oneImport.put("import", importMapping.get(i));
|
||||||
imports.add(oneImport);
|
if (!imports.contains(oneImport)) {
|
||||||
|
imports.add(oneImport);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,11 +479,13 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addImportsToOneOfInterface(List<Map<String, String>> imports) {
|
public void addImportsToOneOfInterface(List<Map<String, String>> imports) {
|
||||||
for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) {
|
if(additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) {
|
||||||
Map<String, String> oneImport = new HashMap<>();
|
for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) {
|
||||||
oneImport.put("import", importMapping.get(i));
|
Map<String, String> oneImport = new HashMap<>();
|
||||||
if (!imports.contains(oneImport)) {
|
oneImport.put("import", importMapping.get(i));
|
||||||
imports.add(oneImport);
|
if (!imports.contains(oneImport)) {
|
||||||
|
imports.add(oneImport);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableMap;
|
|||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Mustache.Lambda;
|
import com.samskivert.mustache.Mustache.Lambda;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
|
import io.swagger.v3.oas.models.Components;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -33,6 +34,7 @@ import org.openapitools.codegen.model.ModelMap;
|
|||||||
import org.openapitools.codegen.model.ModelsMap;
|
import org.openapitools.codegen.model.ModelsMap;
|
||||||
import org.openapitools.codegen.model.OperationMap;
|
import org.openapitools.codegen.model.OperationMap;
|
||||||
import org.openapitools.codegen.model.OperationsMap;
|
import org.openapitools.codegen.model.OperationsMap;
|
||||||
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
import org.openapitools.codegen.utils.URLPathUtils;
|
import org.openapitools.codegen.utils.URLPathUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -768,6 +770,11 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
|||||||
public void preprocessOpenAPI(OpenAPI openAPI) {
|
public void preprocessOpenAPI(OpenAPI openAPI) {
|
||||||
super.preprocessOpenAPI(openAPI);
|
super.preprocessOpenAPI(openAPI);
|
||||||
|
|
||||||
|
if (SPRING_BOOT.equals(library) && ModelUtils.containsEnums(this.openAPI)) {
|
||||||
|
supportingFiles.add(new SupportingFile("converter.mustache",
|
||||||
|
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "EnumConverterConfiguration.kt"));
|
||||||
|
}
|
||||||
|
|
||||||
if (!additionalProperties.containsKey(TITLE)) {
|
if (!additionalProperties.containsKey(TITLE)) {
|
||||||
// The purpose of the title is for:
|
// The purpose of the title is for:
|
||||||
// - README documentation
|
// - README documentation
|
||||||
|
@ -1105,13 +1105,16 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf
|
|||||||
addtionalPropertiesName = schema.getTitle();
|
addtionalPropertiesName = schema.getTitle();
|
||||||
} else {
|
} else {
|
||||||
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
||||||
if (additionalProperties.getTitle() != null) {
|
if(additionalProperties == null) {
|
||||||
|
return;
|
||||||
|
} else if (additionalProperties.getTitle() != null) {
|
||||||
addtionalPropertiesName = additionalProperties.getTitle();
|
addtionalPropertiesName = additionalProperties.getTitle();
|
||||||
} else if (additionalProperties.get$ref() != null) {
|
} else if (additionalProperties.get$ref() != null) {
|
||||||
String ref = ModelUtils.getSimpleRef(additionalProperties.get$ref());
|
String ref = ModelUtils.getSimpleRef(additionalProperties.get$ref());
|
||||||
addtionalPropertiesName = toVarName(toModelName(ref));
|
addtionalPropertiesName = toVarName(toModelName(ref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
properties.put(addtionalPropertiesName, schema);
|
properties.put(addtionalPropertiesName, schema);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ import java.net.URL;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||||
@ -222,7 +223,7 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
|||||||
*/
|
*/
|
||||||
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
||||||
supportingFiles.add(new SupportingFile("Cargo.mustache", "", "Cargo.toml"));
|
supportingFiles.add(new SupportingFile("Cargo.mustache", "", "Cargo.toml"));
|
||||||
supportingFiles.add(new SupportingFile("cargo-config", ".cargo", "config"));
|
supportingFiles.add(new SupportingFile("cargo-config", ".cargo", "config.toml"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
||||||
supportingFiles.add(new SupportingFile("lib.mustache", "src", "lib.rs"));
|
supportingFiles.add(new SupportingFile("lib.mustache", "src", "lib.rs"));
|
||||||
supportingFiles.add(new SupportingFile("context.mustache", "src", "context.rs"));
|
supportingFiles.add(new SupportingFile("context.mustache", "src", "context.rs"));
|
||||||
@ -1531,7 +1532,16 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
|||||||
}
|
}
|
||||||
} else if (param.isArray) {
|
} else if (param.isArray) {
|
||||||
param.vendorExtensions.put("x-format-string", "{:?}");
|
param.vendorExtensions.put("x-format-string", "{:?}");
|
||||||
example = (param.example != null) ? param.example : "&Vec::new()";
|
if (param.items.isString) {
|
||||||
|
// We iterate through the list of string and ensure they end up in the format vec!["example".to_string()]
|
||||||
|
example = (param.example != null)
|
||||||
|
? "&vec![" + Arrays.stream(param.example.replace("[", "").replace("]", "").split(","))
|
||||||
|
.map(item -> item + ".to_string()")
|
||||||
|
.collect(Collectors.joining(", ")) + "]"
|
||||||
|
: "&Vec::new()";
|
||||||
|
} else {
|
||||||
|
example = (param.example != null) ? param.example : "&Vec::new()";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
param.vendorExtensions.put("x-format-string", "{:?}");
|
param.vendorExtensions.put("x-format-string", "{:?}");
|
||||||
if (param.example != null) {
|
if (param.example != null) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -16,10 +16,14 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.samskivert.mustache.Escapers;
|
||||||
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.*;
|
import org.openapitools.codegen.model.*;
|
||||||
|
import org.openapitools.codegen.templating.mustache.EscapeKeywordLambda;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -140,7 +144,7 @@ public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenC
|
|||||||
additionalProperties.put("infoEmail", "team@openapitools.org");
|
additionalProperties.put("infoEmail", "team@openapitools.org");
|
||||||
additionalProperties.put("licenseInfo", "Apache 2.0");
|
additionalProperties.put("licenseInfo", "Apache 2.0");
|
||||||
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
|
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
|
||||||
|
additionalProperties.put("fnEscapeBacktick", new EscapeBacktickLambda());
|
||||||
|
|
||||||
languageSpecificPrimitives = new HashSet<>(
|
languageSpecificPrimitives = new HashSet<>(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
@ -557,7 +561,12 @@ public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenC
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeReservedWord(String name) {
|
public String escapeReservedWord(String name) {
|
||||||
return "_" + name;
|
if (this.reservedWordsMappings().containsKey(name)) {
|
||||||
|
return this.reservedWordsMappings().get(name);
|
||||||
|
}
|
||||||
|
// Reserved words will be further escaped at the mustache compiler level.
|
||||||
|
// Scala escaping done here (via `, without compiler escaping) would otherwise be HTML encoded.
|
||||||
|
return "`" + name + "`";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -807,12 +816,12 @@ public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenC
|
|||||||
|
|
||||||
if (_vendorExtensions.size() == 1) { // only `x-type`
|
if (_vendorExtensions.size() == 1) { // only `x-type`
|
||||||
if ("String".equals(cp.getDataType())) {
|
if ("String".equals(cp.getDataType())) {
|
||||||
return cp.baseName;
|
return escapeReservedWordUnapply(cp.baseName);
|
||||||
} else {
|
} else {
|
||||||
return cp.dataType + "Varr(" + cp.baseName + ")";
|
return cp.dataType + "Varr(" + escapeReservedWordUnapply(cp.baseName) + ")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return cp.baseName + "Varr(" + cp.baseName + ")";
|
return cp.baseName + "Varr(" + escapeReservedWordUnapply(cp.baseName) + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,11 +853,34 @@ public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenC
|
|||||||
}
|
}
|
||||||
|
|
||||||
vendorExtensions.putAll(refineProp(cp, imports));
|
vendorExtensions.putAll(refineProp(cp, imports));
|
||||||
return cp.baseName + "QueryParam(" + cp.baseName + ")";
|
return cp.baseName + "QueryParam(" + escapeReservedWordUnapply(cp.baseName) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneratorLanguage generatorLanguage() {
|
public GeneratorLanguage generatorLanguage() {
|
||||||
return GeneratorLanguage.SCALA;
|
return GeneratorLanguage.SCALA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() {
|
||||||
|
return super.addMustacheLambdas()
|
||||||
|
.put("escapeReservedWordUnapply", new EscapeKeywordLambda(this::escapeReservedWordUnapply));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String escapeReservedWordUnapply(String value) {
|
||||||
|
// The unapply method doesn’t allow you to work with reserved variables via backticks;
|
||||||
|
// in such cases you should use the variable via a placeholder instead.
|
||||||
|
return isReservedWord(value) ? "_" + value : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class EscapeBacktickLambda extends AbstractScalaCodegen.CustomLambda {
|
||||||
|
@Override
|
||||||
|
public String formatFragment(String fragment) {
|
||||||
|
if (fragment.startsWith("`") && fragment.endsWith("`")) {
|
||||||
|
String unescaped = fragment.substring(1, fragment.length() - 1);
|
||||||
|
return "`" + Escapers.HTML.escape(unescaped) + "`";
|
||||||
|
}
|
||||||
|
return Escapers.HTML.escape(fragment);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.Components;
|
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.PathItem;
|
import io.swagger.v3.oas.models.PathItem;
|
||||||
@ -40,6 +39,7 @@ import org.openapitools.codegen.model.OperationsMap;
|
|||||||
import org.openapitools.codegen.templating.mustache.SplitStringLambda;
|
import org.openapitools.codegen.templating.mustache.SplitStringLambda;
|
||||||
import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda;
|
import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda;
|
||||||
import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda;
|
import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda;
|
||||||
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
import org.openapitools.codegen.utils.ProcessUtils;
|
import org.openapitools.codegen.utils.ProcessUtils;
|
||||||
import org.openapitools.codegen.utils.URLPathUtils;
|
import org.openapitools.codegen.utils.URLPathUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -90,6 +90,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
|||||||
public static final String RETURN_SUCCESS_CODE = "returnSuccessCode";
|
public static final String RETURN_SUCCESS_CODE = "returnSuccessCode";
|
||||||
public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException";
|
public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException";
|
||||||
public static final String USE_RESPONSE_ENTITY = "useResponseEntity";
|
public static final String USE_RESPONSE_ENTITY = "useResponseEntity";
|
||||||
|
public static final String GENERATE_GENERIC_RESPONSE_ENTITY = "generateGenericResponseEntity";
|
||||||
public static final String USE_ENUM_CASE_INSENSITIVE = "useEnumCaseInsensitive";
|
public static final String USE_ENUM_CASE_INSENSITIVE = "useEnumCaseInsensitive";
|
||||||
public static final String USE_SPRING_BOOT3 = "useSpringBoot3";
|
public static final String USE_SPRING_BOOT3 = "useSpringBoot3";
|
||||||
public static final String REQUEST_MAPPING_OPTION = "requestMappingMode";
|
public static final String REQUEST_MAPPING_OPTION = "requestMappingMode";
|
||||||
@ -147,6 +148,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
|||||||
@Setter protected boolean useSpringController = false;
|
@Setter protected boolean useSpringController = false;
|
||||||
protected boolean useSwaggerUI = true;
|
protected boolean useSwaggerUI = true;
|
||||||
@Setter protected boolean useResponseEntity = true;
|
@Setter protected boolean useResponseEntity = true;
|
||||||
|
@Setter protected boolean generateGenericResponseEntity = false;
|
||||||
@Setter protected boolean useEnumCaseInsensitive = false;
|
@Setter protected boolean useEnumCaseInsensitive = false;
|
||||||
@Getter @Setter
|
@Getter @Setter
|
||||||
protected boolean useSpringBoot3 = false;
|
protected boolean useSpringBoot3 = false;
|
||||||
@ -256,6 +258,10 @@ public class SpringCodegen extends AbstractJavaCodegen
|
|||||||
"Use the `ResponseEntity` type to wrap return values of generated API methods. "
|
"Use the `ResponseEntity` type to wrap return values of generated API methods. "
|
||||||
+ "If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition",
|
+ "If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition",
|
||||||
useResponseEntity));
|
useResponseEntity));
|
||||||
|
cliOptions.add(CliOption.newBoolean(GENERATE_GENERIC_RESPONSE_ENTITY,
|
||||||
|
"Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. "
|
||||||
|
+ "If enabled, method are generated with return type ResponseEntity<?>",
|
||||||
|
generateGenericResponseEntity));
|
||||||
cliOptions.add(CliOption.newBoolean(USE_ENUM_CASE_INSENSITIVE,
|
cliOptions.add(CliOption.newBoolean(USE_ENUM_CASE_INSENSITIVE,
|
||||||
"Use `equalsIgnoreCase` when String for enum comparison",
|
"Use `equalsIgnoreCase` when String for enum comparison",
|
||||||
useEnumCaseInsensitive));
|
useEnumCaseInsensitive));
|
||||||
@ -433,6 +439,11 @@ public class SpringCodegen extends AbstractJavaCodegen
|
|||||||
|
|
||||||
convertPropertyToBooleanAndWriteBack(UNHANDLED_EXCEPTION_HANDLING, this::setUnhandledException);
|
convertPropertyToBooleanAndWriteBack(UNHANDLED_EXCEPTION_HANDLING, this::setUnhandledException);
|
||||||
convertPropertyToBooleanAndWriteBack(USE_RESPONSE_ENTITY, this::setUseResponseEntity);
|
convertPropertyToBooleanAndWriteBack(USE_RESPONSE_ENTITY, this::setUseResponseEntity);
|
||||||
|
convertPropertyToBooleanAndWriteBack(GENERATE_GENERIC_RESPONSE_ENTITY, this::setGenerateGenericResponseEntity);
|
||||||
|
if (!useResponseEntity) {
|
||||||
|
this.setGenerateGenericResponseEntity(false);
|
||||||
|
this.additionalProperties.put(GENERATE_GENERIC_RESPONSE_ENTITY, false);
|
||||||
|
}
|
||||||
convertPropertyToBooleanAndWriteBack(OPTIONAL_ACCEPT_NULLABLE, this::setOptionalAcceptNullable);
|
convertPropertyToBooleanAndWriteBack(OPTIONAL_ACCEPT_NULLABLE, this::setOptionalAcceptNullable);
|
||||||
convertPropertyToBooleanAndWriteBack(USE_SPRING_BUILT_IN_VALIDATION, this::setUseSpringBuiltInValidation);
|
convertPropertyToBooleanAndWriteBack(USE_SPRING_BUILT_IN_VALIDATION, this::setUseSpringBuiltInValidation);
|
||||||
|
|
||||||
@ -637,20 +648,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
|||||||
supportsAdditionalPropertiesWithComposedSchema = true;
|
supportsAdditionalPropertiesWithComposedSchema = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean containsEnums() {
|
|
||||||
if (openAPI == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Components components = this.openAPI.getComponents();
|
|
||||||
if (components == null || components.getSchemas() == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return components.getSchemas().values().stream()
|
|
||||||
.anyMatch(it -> it.getEnum() != null && !it.getEnum().isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean supportLibraryUseTags() {
|
private boolean supportLibraryUseTags() {
|
||||||
return SPRING_BOOT.equals(library) || SPRING_CLOUD_LIBRARY.equals(library);
|
return SPRING_BOOT.equals(library) || SPRING_CLOUD_LIBRARY.equals(library);
|
||||||
}
|
}
|
||||||
@ -685,7 +682,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
|||||||
public void preprocessOpenAPI(OpenAPI openAPI) {
|
public void preprocessOpenAPI(OpenAPI openAPI) {
|
||||||
super.preprocessOpenAPI(openAPI);
|
super.preprocessOpenAPI(openAPI);
|
||||||
|
|
||||||
if (SPRING_BOOT.equals(library) && containsEnums()) {
|
if (SPRING_BOOT.equals(library) && ModelUtils.containsEnums(this.openAPI)) {
|
||||||
supportingFiles.add(new SupportingFile("converter.mustache",
|
supportingFiles.add(new SupportingFile("converter.mustache",
|
||||||
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "EnumConverterConfiguration.java"));
|
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "EnumConverterConfiguration.java"));
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
|||||||
public static final String NGPACKAGR_VERSION = "ngPackagrVersion";
|
public static final String NGPACKAGR_VERSION = "ngPackagrVersion";
|
||||||
public static final String ZONEJS_VERSION = "zonejsVersion";
|
public static final String ZONEJS_VERSION = "zonejsVersion";
|
||||||
|
|
||||||
protected String ngVersion = "19.0.0";
|
protected String ngVersion = "20.0.0";
|
||||||
@Getter @Setter
|
@Getter @Setter
|
||||||
protected String npmRepository = null;
|
protected String npmRepository = null;
|
||||||
@Setter(AccessLevel.PRIVATE) private boolean useSingleRequestParameter = false;
|
@Setter(AccessLevel.PRIVATE) private boolean useSingleRequestParameter = false;
|
||||||
@ -170,7 +170,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a TypeScript Angular (9.x - 19.x) client library.";
|
return "Generates a TypeScript Angular (9.x - 20.x) client library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,6 +78,9 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
|
|||||||
private static final String USE_OBJECT_PARAMS_SWITCH = "useObjectParameters";
|
private static final String USE_OBJECT_PARAMS_SWITCH = "useObjectParameters";
|
||||||
private static final String USE_OBJECT_PARAMS_DESC = "Use aggregate parameter objects as function arguments for api operations instead of passing each parameter as a separate function argument.";
|
private static final String USE_OBJECT_PARAMS_DESC = "Use aggregate parameter objects as function arguments for api operations instead of passing each parameter as a separate function argument.";
|
||||||
|
|
||||||
|
public static final String USE_ERASABLE_SYNTAX = "useErasableSyntax";
|
||||||
|
public static final String USE_ERASABLE_SYNTAX_DESC = "Use erasable syntax for the generated code. This is a temporary feature and will be removed in the future.";
|
||||||
|
|
||||||
private final Map<String, String> frameworkToHttpLibMap;
|
private final Map<String, String> frameworkToHttpLibMap;
|
||||||
|
|
||||||
// NPM Options
|
// NPM Options
|
||||||
@ -122,6 +125,7 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
|
|||||||
cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_OBJECT_PARAMS_SWITCH, TypeScriptClientCodegen.USE_OBJECT_PARAMS_DESC).defaultValue("false"));
|
cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_OBJECT_PARAMS_SWITCH, TypeScriptClientCodegen.USE_OBJECT_PARAMS_DESC).defaultValue("false"));
|
||||||
cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_INVERSIFY_SWITCH, TypeScriptClientCodegen.USE_INVERSIFY_SWITCH_DESC).defaultValue("false"));
|
cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_INVERSIFY_SWITCH, TypeScriptClientCodegen.USE_INVERSIFY_SWITCH_DESC).defaultValue("false"));
|
||||||
cliOptions.add(new CliOption(TypeScriptClientCodegen.IMPORT_FILE_EXTENSION_SWITCH, TypeScriptClientCodegen.IMPORT_FILE_EXTENSION_SWITCH_DESC));
|
cliOptions.add(new CliOption(TypeScriptClientCodegen.IMPORT_FILE_EXTENSION_SWITCH, TypeScriptClientCodegen.IMPORT_FILE_EXTENSION_SWITCH_DESC));
|
||||||
|
cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_ERASABLE_SYNTAX, TypeScriptClientCodegen.USE_ERASABLE_SYNTAX_DESC).defaultValue("false"));
|
||||||
|
|
||||||
CliOption frameworkOption = new CliOption(TypeScriptClientCodegen.FRAMEWORK_SWITCH, TypeScriptClientCodegen.FRAMEWORK_SWITCH_DESC);
|
CliOption frameworkOption = new CliOption(TypeScriptClientCodegen.FRAMEWORK_SWITCH, TypeScriptClientCodegen.FRAMEWORK_SWITCH_DESC);
|
||||||
for (String option : TypeScriptClientCodegen.FRAMEWORKS) {
|
for (String option : TypeScriptClientCodegen.FRAMEWORKS) {
|
||||||
|
@ -2435,6 +2435,19 @@ public class ModelUtils {
|
|||||||
schema.getContentSchema() != null);
|
schema.getContentSchema() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the OpenAPI specification contains any schemas which are enums.
|
||||||
|
* @param openAPI OpenAPI specification
|
||||||
|
* @return true if the OpenAPI specification contains any schemas which are enums.
|
||||||
|
*/
|
||||||
|
public static boolean containsEnums(OpenAPI openAPI) {
|
||||||
|
Map<String, Schema> schemaMap = getSchemas(openAPI);
|
||||||
|
if (schemaMap.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return schemaMap.values().stream().anyMatch(ModelUtils::isEnumSchema);
|
||||||
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
private interface OpenAPISchemaVisitor {
|
private interface OpenAPISchemaVisitor {
|
||||||
|
@ -64,6 +64,7 @@ import {{invokerPackage}}.auth.OAuth;
|
|||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
||||||
|
@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class Configuration {
|
public class Configuration {
|
||||||
public static final String VERSION = "{{{artifactVersion}}}";
|
public static final String VERSION = "{{{artifactVersion}}}";
|
||||||
|
|
||||||
|
@ -10,44 +10,49 @@ import java.time.format.DateTimeParseException;
|
|||||||
* It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
|
* It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
|
||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class JavaTimeFormatter {
|
public class JavaTimeFormatter {
|
||||||
|
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||||
|
|
||||||
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
/**
|
||||||
|
* Get the date format used to parse/format {@code OffsetDateTime} parameters.
|
||||||
|
*
|
||||||
|
* @return DateTimeFormatter
|
||||||
|
*/
|
||||||
|
public DateTimeFormatter getOffsetDateTimeFormatter() {
|
||||||
|
return offsetDateTimeFormatter;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the date format used to parse/format {@code OffsetDateTime} parameters.
|
* Set the date format used to parse/format {@code OffsetDateTime} parameters.
|
||||||
* @return DateTimeFormatter
|
*
|
||||||
*/
|
* @param offsetDateTimeFormatter {@code DateTimeFormatter}
|
||||||
public DateTimeFormatter getOffsetDateTimeFormatter() {
|
*/
|
||||||
return offsetDateTimeFormatter;
|
public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) {
|
||||||
}
|
this.offsetDateTimeFormatter = offsetDateTimeFormatter;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the date format used to parse/format {@code OffsetDateTime} parameters.
|
* Parse the given string into {@code OffsetDateTime} object.
|
||||||
* @param offsetDateTimeFormatter {@code DateTimeFormatter}
|
*
|
||||||
*/
|
* @param str String
|
||||||
public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) {
|
* @return {@code OffsetDateTime}
|
||||||
this.offsetDateTimeFormatter = offsetDateTimeFormatter;
|
*/
|
||||||
|
public OffsetDateTime parseOffsetDateTime(String str) {
|
||||||
|
try {
|
||||||
|
return OffsetDateTime.parse(str, offsetDateTimeFormatter);
|
||||||
|
} catch (DateTimeParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the given string into {@code OffsetDateTime} object.
|
* Format the given {@code OffsetDateTime} object into string.
|
||||||
* @param str String
|
*
|
||||||
* @return {@code OffsetDateTime}
|
* @param offsetDateTime {@code OffsetDateTime}
|
||||||
*/
|
* @return {@code OffsetDateTime} in string format
|
||||||
public OffsetDateTime parseOffsetDateTime(String str) {
|
*/
|
||||||
try {
|
public String formatOffsetDateTime(OffsetDateTime offsetDateTime) {
|
||||||
return OffsetDateTime.parse(str, offsetDateTimeFormatter);
|
return offsetDateTimeFormatter.format(offsetDateTime);
|
||||||
} catch (DateTimeParseException e) {
|
}
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Format the given {@code OffsetDateTime} object into string.
|
|
||||||
* @param offsetDateTime {@code OffsetDateTime}
|
|
||||||
* @return {@code OffsetDateTime} in string format
|
|
||||||
*/
|
|
||||||
public String formatOffsetDateTime(OffsetDateTime offsetDateTime) {
|
|
||||||
return offsetDateTimeFormatter.format(offsetDateTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -3,44 +3,25 @@
|
|||||||
package {{invokerPackage}};
|
package {{invokerPackage}};
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class Pair {
|
public class Pair {
|
||||||
private String name = "";
|
private final String name;
|
||||||
private String value = "";
|
private final String value;
|
||||||
|
|
||||||
public Pair (String name, String value) {
|
public Pair(String name, String value) {
|
||||||
setName(name);
|
this.name = isValidString(name) ? name : "";
|
||||||
setValue(value);
|
this.value = isValidString(value) ? value : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setName(String name) {
|
public String getName() {
|
||||||
if (!isValidString(name)) {
|
return this.name;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.name = name;
|
public String getValue() {
|
||||||
}
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
private void setValue(String value) {
|
private static boolean isValidString(String arg) {
|
||||||
if (!isValidString(value)) {
|
return arg != null;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isValidString(String arg) {
|
|
||||||
if (arg == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import java.util.GregorianCalendar;
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class RFC3339DateFormat extends DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
@ -18,6 +18,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature;
|
|||||||
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class RFC3339InstantDeserializer<T extends Temporal> extends InstantDeserializer<T> {
|
public class RFC3339InstantDeserializer<T extends Temporal> extends InstantDeserializer<T> {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault();
|
private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault();
|
||||||
|
@ -8,6 +8,7 @@ import java.time.ZonedDateTime;
|
|||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class RFC3339JavaTimeModule extends SimpleModule {
|
public class RFC3339JavaTimeModule extends SimpleModule {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||||||
* Representing a Server configuration.
|
* Representing a Server configuration.
|
||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class ServerConfiguration {
|
public class ServerConfiguration {
|
||||||
public String URL;
|
public String URL;
|
||||||
public String description;
|
public String description;
|
||||||
|
@ -8,6 +8,7 @@ import java.util.HashSet;
|
|||||||
* Representing a Server Variable for server URL template substitution.
|
* Representing a Server Variable for server URL template substitution.
|
||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class ServerVariable {
|
public class ServerVariable {
|
||||||
public String description;
|
public String description;
|
||||||
public String defaultValue;
|
public String defaultValue;
|
||||||
|
@ -6,6 +6,7 @@ import java.util.Collection;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
/**
|
/**
|
||||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
@ -19,6 +19,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
public class {{classname}} {
|
public class {{classname}} {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
@ -6,6 +6,7 @@ import java.util.Map;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{
|
public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class ApiKeyAuth implements Authentication {
|
public class ApiKeyAuth implements Authentication {
|
||||||
private final String location;
|
private final String location;
|
||||||
private final String paramName;
|
private final String paramName;
|
||||||
|
@ -8,13 +8,14 @@ import java.util.Map;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public interface Authentication {
|
public interface Authentication {
|
||||||
/**
|
/**
|
||||||
* Apply authentication settings to header and query params.
|
* Apply authentication settings to header and query params.
|
||||||
*
|
*
|
||||||
* @param queryParams List of query parameters
|
* @param queryParams List of query parameters
|
||||||
* @param headerParams Map of header parameters
|
* @param headerParams Map of header parameters
|
||||||
* @param cookieParams Map of cookie parameters
|
* @param cookieParams Map of cookie parameters
|
||||||
*/
|
*/
|
||||||
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams);
|
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import java.util.Map;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class HttpBasicAuth implements Authentication {
|
public class HttpBasicAuth implements Authentication {
|
||||||
private String username;
|
private String username;
|
||||||
private String password;
|
private String password;
|
||||||
|
@ -6,16 +6,16 @@ import {{invokerPackage}}.Pair;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class HttpBearerAuth implements Authentication {
|
public class HttpBearerAuth implements Authentication {
|
||||||
private final String scheme;
|
private final String scheme;
|
||||||
private Supplier<String> tokenSupplier;
|
private Supplier<String> tokenSupplier;
|
||||||
|
|
||||||
public HttpBearerAuth(String scheme) {
|
public HttpBearerAuth(String scheme) {
|
||||||
this.scheme = scheme;
|
this.scheme = upperCaseBearer(scheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,15 +47,14 @@ public class HttpBearerAuth implements Authentication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
|
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
|
||||||
String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
|
String bearerToken = tokenSupplier != null ? tokenSupplier.get() : null;
|
||||||
if (bearerToken == null) {
|
if (bearerToken == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
headerParams.put("Authorization", (scheme != null ? scheme + " " : "") + bearerToken);
|
||||||
headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String upperCaseBearer(String scheme) {
|
private static String upperCaseBearer(String scheme) {
|
||||||
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
|
return "bearer".equalsIgnoreCase(scheme) ? "Bearer" : scheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
|
|
||||||
public class OAuth implements Authentication {
|
public class OAuth implements Authentication {
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user