Compare commits

..

4 Commits

Author SHA1 Message Date
William Cheng
b52f6aa204 better handling of const value 2023-09-18 10:09:54 +08:00
William Cheng
3b81c707b6 update samples 2023-09-15 16:52:46 +08:00
William Cheng
3ca8bb3e5a update comment 2023-09-15 15:59:30 +08:00
William Cheng
e9c767d098 add constant support 2023-09-15 15:58:05 +08:00
55 changed files with 289 additions and 320 deletions

View File

@@ -8,7 +8,7 @@
- [ ] Run the following to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples:
```
./mvnw clean package
./bin/generate-samples.sh ./bin/configs/*.yaml
./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh
```
Commit all changed files.
@@ -16,5 +16,10 @@
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming 7.1.0 minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
- [ ] In case you are adding a new generator, run the following additional script :
```
./bin/utils/ensure-up-to-date
```
Commit all changed files.
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (7.0.1 - patch release), `7.1.x` (minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.

View File

@@ -8,7 +8,6 @@ on:
- 'samples/server/petstore/java-vertx-web/**'
- 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**'
# test in circleci instead
- 'samples/server/petstore/java-undertow/**'
pull_request:
paths:
@@ -16,7 +15,7 @@ on:
- 'samples/server/petstore/java-vertx-web/**'
- 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**'
#- 'samples/server/petstore/java-undertow/**'
- 'samples/server/petstore/java-undertow/**'
jobs:
build:
name: Build Java Server
@@ -30,7 +29,7 @@ jobs:
- samples/server/petstore/java-vertx-web/
- samples/server/petstore/java-inflector/
- samples/server/petstore/java-pkmst/
#- samples/server/petstore/java-undertow/
- samples/server/petstore/java-undertow/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3

View File

@@ -15,7 +15,7 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.1.0`):
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.0.1`):
[![Build Status](https://api.travis-ci.com/OpenAPITools/openapi-generator.svg?branch=master&status=passed)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
@@ -77,7 +77,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
| **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** (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/), Scalatra) |
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** |
## Table of contents
@@ -115,13 +115,13 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.1.0 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.1.0-SNAPSHOT/) | 18.10.2023 | Minor release with breaking changes (with fallback) |
| [7.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.1) (latest stable release) | 18.09.2023 | Patch release (enhancements, bug fixes, etc) |
| 7.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.1-SNAPSHOT/) | 08.09.2023 | Patch release (enhancements, bug fixes, etc) |
| [7.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.0) (latest stable release) | 25.08.2023 | Major release with breaking changes (no 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) |
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0, 3.1 (beta support)
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
(We do not publish daily/nightly build. Please use SNAPSHOT instead)
@@ -179,16 +179,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
<!-- 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):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.1.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.1.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.1.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -423,7 +423,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 7.0.1
openapi-generator-cli version-manager set 7.0.0
```
Or install it as dev-dependency:
@@ -447,7 +447,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`)
<!-- 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.0.1/openapi-generator-cli-7.0.1.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar)
<!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@@ -928,9 +928,12 @@ OpenAPI Generator core team members are contributors who have been making signif
* [@cbornet](https://github.com/cbornet) (2016/05)
* [@jmini](https://github.com/jmini) (2018/04) [:heart:](https://www.patreon.com/jmini)
* [@etherealjoy](https://github.com/etherealjoy) (2019/06)
* [@spacether](https://github.com/spacether) (2020/05) [:heart:][spacether sponsorship]
:heart: = Link to support the contributor directly
[spacether sponsorship]: https://github.com/sponsors/spacether/
#### Template Creator
**NOTE**: Embedded templates are only supported in _Mustache_ format. Support for all other formats is experimental and subject to change at any time.
@@ -1001,7 +1004,6 @@ Here is a list of template creators:
* PowerShell (refactored in 5.0.0): @wing328
* Python: @spacether [:heart:][spacether sponsorship]
* Python-Experimental: @spacether [:heart:][spacether sponsorship]
* Python (refactored in 7.0.0): @wing328
* R: @ramnov
* Ruby (Faraday): @meganemura @dkliban
* Rust: @farcaller
@@ -1260,4 +1262,3 @@ limitations under the License.
---

View File

@@ -1,6 +1,6 @@
generatorName: java-undertow-server
outputDir: samples/server/petstore/java-undertow
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/java-undertow-server
additionalProperties:
hideGenerationTimestamp: "true"

View File

@@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|apiPackage|package for generated api classes| |org.openapitools.api|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-groovy|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|async|use async Callable controllers| |false|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-inflector-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|authorizationFilterPattern|Configure the authorization filter pattern for the client. Generally defined when generating clients from multiple specification files| |null|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|basePathSeparator|Configure the separator to use between the application name and base path when referencing the property| |-|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-micronaut|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|build|Specify for which build tool to generate files|<dl><dt>**gradle**</dt><dd>Gradle configuration is generated for the project</dd><dt>**all**</dt><dd>Both Gradle and Maven configurations are generated</dd><dt>**maven**</dt><dd>Maven configuration is generated for the project</dd></dl>|all|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |pkmst-microservice|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|basePackage|base package for java source code| |null|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-playframework|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|basePackage|base package for generated code| |org.openapitools|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-undertow-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-vertx-web-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-vertx-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|asyncNative|If true, async handlers will be used, instead of the sync version| |false|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-cxf-cdi-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-client|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-resteasy-eap-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-resteasy-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server|
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|

View File

@@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|async|use async Callable controllers| |false|
|autosetConstants|Automatically set Required Params having a Single enum value i.e. Constants in generated code| |false|
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|booleanGetterPrefix|Set booleanGetterPrefix| |get|

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -6,7 +6,7 @@
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.0.1
openApiGeneratorVersion=7.0.1-SNAPSHOT
# /RELEASE_VERSION
# BEGIN placeholders

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -1,3 +1,3 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.0.1
openApiGeneratorVersion=7.0.1-SNAPSHOT
# /RELEASE_VERSION

View File

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

View File

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

View File

@@ -19,7 +19,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<dependencies>
<dependency>

View File

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

View File

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

View File

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

View File

@@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../..</relativePath>
</parent>

View File

@@ -112,6 +112,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
* See http://json-schema.org/latest/json-schema-validation.html#anchor14
*/
public Number multipleOf;
public String constant; // for const or enum with a single item
private Integer maxProperties;
private Integer minProperties;
public boolean isNull;
@@ -164,6 +167,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
output.uniqueItems = this.uniqueItems;
output.setUniqueItemsBoolean(this.uniqueItemsBoolean);
output.multipleOf = this.multipleOf;
output.constant = this.constant;
output.jsonSchema = this.jsonSchema;
output.defaultValue = this.defaultValue;
output.enumDefaultValue = this.enumDefaultValue;
@@ -260,7 +264,20 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
@Override
public int hashCode() {
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam,
isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName,
dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType,
containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject,
isMatrix, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong,
isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid,
isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef,
_enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars,
vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated,
required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(),
getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf,
isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger,
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content,
requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties, constant);
}
@Override
@@ -365,6 +382,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
Objects.equals(getMaxItems(), that.getMaxItems()) &&
Objects.equals(getMinItems(), that.getMinItems()) &&
Objects.equals(contentType, that.contentType) &&
Objects.equals(constant, that.constant) &&
Objects.equals(multipleOf, that.multipleOf);
}
@@ -465,6 +483,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
sb.append(", uniqueItemsBoolean=").append(uniqueItemsBoolean);
sb.append(", contentType=").append(contentType);
sb.append(", multipleOf=").append(multipleOf);
sb.append(", constant=").append(constant);
sb.append(", isNull=").append(isNull);
sb.append(", isVoid=").append(isVoid);
sb.append(", getAdditionalPropertiesIsAnyType=").append(additionalPropertiesIsAnyType);

View File

@@ -211,6 +211,9 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
private LinkedHashMap<String, List<String>> dependentRequired;
private CodegenProperty contains;
// JSON Schema keywords
private String constant; // for `const`
@Override
public CodegenProperty getContains() {
return contains;
@@ -1036,6 +1039,14 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
return isEnum || isEnumRef;
}
public void setConstant(String constant) {
this.constant = constant;
}
public String getConstant() {
return constant;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenProperty{");
@@ -1150,6 +1161,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
sb.append(", format=").append(format);
sb.append(", dependentRequired=").append(dependentRequired);
sb.append(", contains=").append(contains);
sb.append(", constant=").append(constant);
sb.append('}');
return sb.toString();
}
@@ -1266,7 +1278,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
Objects.equals(xmlPrefix, that.xmlPrefix) &&
Objects.equals(xmlName, that.xmlName) &&
Objects.equals(xmlNamespace, that.xmlNamespace) &&
Objects.equals(multipleOf, that.multipleOf);
Objects.equals(multipleOf, that.multipleOf) &&
Objects.equals(constant, that.getConstant());
}
@Override
@@ -1288,6 +1301,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
xmlNamespace, isXmlWrapped, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired,
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, requiredVarsMap,
ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties, isBooleanSchemaTrue, isBooleanSchemaFalse,
format, dependentRequired, contains);
format, dependentRequired, contains, constant);
}
}

View File

@@ -4593,6 +4593,7 @@ public class DefaultCodegen implements CodegenConfig {
List<CodegenParameter> optionalParams = new ArrayList<>();
List<CodegenParameter> requiredAndNotNullableParams = new ArrayList<>();
List<CodegenParameter> notNullableParams = new ArrayList<>();
List<CodegenParameter> constantParams = new ArrayList<>();
CodegenParameter bodyParam = null;
RequestBody requestBody = operation.getRequestBody();
@@ -4656,20 +4657,22 @@ public class DefaultCodegen implements CodegenConfig {
}
}
allParams.add(p);
if (param instanceof QueryParameter || "query".equalsIgnoreCase(param.getIn())) {
queryParams.add(p.copy());
} else if (param instanceof PathParameter || "path".equalsIgnoreCase(param.getIn())) {
pathParams.add(p.copy());
} else if (param instanceof HeaderParameter || "header".equalsIgnoreCase(param.getIn())) {
headerParams.add(p.copy());
} else if (param instanceof CookieParameter || "cookie".equalsIgnoreCase(param.getIn())) {
cookieParams.add(p.copy());
} else {
LOGGER.warn("Unknown parameter type {} for {}", p.baseType, p.baseName);
if (p.constant != null) { // for constant
constantParams.add(p.copy());
} else { // a typical parameter
allParams.add(p);
if (param instanceof QueryParameter || "query".equalsIgnoreCase(param.getIn())) {
queryParams.add(p.copy());
} else if (param instanceof PathParameter || "path".equalsIgnoreCase(param.getIn())) {
pathParams.add(p.copy());
} else if (param instanceof HeaderParameter || "header".equalsIgnoreCase(param.getIn())) {
headerParams.add(p.copy());
} else if (param instanceof CookieParameter || "cookie".equalsIgnoreCase(param.getIn())) {
cookieParams.add(p.copy());
} else {
LOGGER.warn("Unknown parameter type {} for {}", p.baseType, p.baseName);
}
}
}
}
@@ -5355,6 +5358,26 @@ public class DefaultCodegen implements CodegenConfig {
// set default value
codegenParameter.defaultValue = toDefaultParameterValue(codegenProperty, parameterSchema);
// set constant
if (codegenParameter.getIsEnumOrRef()) { // enum with only 1 item
Schema enumSchema = ModelUtils.getReferencedSchema(openAPI, unaliasSchema(parameterSchema));
if (enumSchema.getEnum() != null && enumSchema.getEnum().size() == 1) { // only 1 element
codegenParameter.constant = toDefaultParameterValue(codegenProperty, enumSchema);
}
} else if (parameterSchema.getConst() != null) { // JSON Sschema keyword `const`
Schema temp = null;
Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?");
String constantValue = String.valueOf(parameterSchema.getConst());
if (pattern.matcher(constantValue).matches()) { // numeric constant value
temp = new NumberSchema();
temp.setDefault(constantValue);
} else { // constant value is a string
temp = new StringSchema();
temp.setDefault(constantValue);
}
codegenParameter.constant = toDefaultParameterValue(temp);
}
finishUpdatingParameter(codegenParameter, parameter);
return codegenParameter;
}

View File

@@ -279,6 +279,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable));
cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders));
cliOptions.add(CliOption.newString(IMPLICIT_HEADERS_REGEX, "Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true"));
cliOptions.add(CliOption.newBoolean(AUTOSET_CONSTANTS, "Automatically set Required Params having a Single enum value i.e. Constants in generated code", autosetConstants));
cliOptions.add(CliOption.newBoolean(CAMEL_CASE_DOLLAR_SIGN, "Fix camelCase when starting with $ sign. when true : $Value when false : $value"));
cliOptions.add(CliOption.newBoolean(USE_JAKARTA_EE, "whether to use Jakarta EE namespace instead of javax"));
cliOptions.add(CliOption.newBoolean(CONTAINER_DEFAULT_TO_NULL, "Set containers (array, set, map) default to null"));

View File

@@ -2,31 +2,30 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}
go 1.19
require github.com/gin-gonic/gin v1.9.1
require github.com/gin-gonic/gin v1.9.0
require (
github.com/bytedance/sonic v1.9.1 // indirect
github.com/bytedance/sonic v1.8.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
github.com/ugorji/go/codec v1.2.9 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@@ -3,12 +3,6 @@ package {{packageName}}
import (
"encoding/json"
{{#isBodyParam}}
{{^required}}
"errors"
"io"
{{/required}}
{{/isBodyParam}}
"net/http"
"strings"
@@ -409,7 +403,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re
{{^isAdditionalPropertiesTrue}}
d.DisallowUnknownFields()
{{/isAdditionalPropertiesTrue}}
if err := d.Decode(&{{paramName}}Param); err != nil {{^required}}&& !errors.Is(err, io.EOF) {{/required}}{
if err := d.Decode(&{{paramName}}Param); err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}

View File

@@ -29,7 +29,7 @@
<version.logback>1.2.0</version.logback>
<version.junit>4.13.2</version.junit>
<version.mockito>2.1.0-beta.124</version.mockito>
<version.undertow>2.3.5.Final</version.undertow>
<version.undertow>2.2.24.Final</version.undertow>
<version.jsonpath>2.2.0</version.jsonpath>
<version.httpclient>4.5.13</version.httpclient>
<version.httpasyncclient>4.1.2</version.httpasyncclient>

View File

@@ -56,7 +56,7 @@ public class GoGinServerCodegenTest {
TestUtils.assertFileContains(Paths.get(output + "/go.mod"),
"module github.com/my-user/my-repo");
TestUtils.assertFileContains(Paths.get(output + "/go.mod"),
"require github.com/gin-gonic/gin v1.9.1");
"require github.com/gin-gonic/gin v1.9.0");
}
}

View File

@@ -13,7 +13,7 @@
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<!-- RELEASE_VERSION -->
<version>7.0.1</version>
<version>7.0.1-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<url>https://github.com/openapitools/openapi-generator</url>
<scm>
@@ -1290,8 +1290,6 @@
<module>samples/client/petstore/java/resteasy</module>
<module>samples/client/petstore/java-micronaut-client</module>
<module>samples/client/petstore/java/apache-httpclient</module>
<!-- server -->
<module>samples/server/petstore/java-undertow</module>
</modules>
</profile>
<!-- test with Haskell -->

View File

@@ -2,31 +2,30 @@ module github.com/GIT_USER_ID/GIT_REPO_ID
go 1.19
require github.com/gin-gonic/gin v1.9.1
require github.com/gin-gonic/gin v1.9.0
require (
github.com/bytedance/sonic v1.9.1 // indirect
github.com/bytedance/sonic v1.8.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
github.com/ugorji/go/codec v1.2.9 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@@ -135,7 +135,7 @@
<version.framework>0.1.1</version.framework>
<version.jackson>2.14.1</version.jackson>
<version.httpasyncclient>4.1.2</version.httpasyncclient>
<version.undertow>2.3.5.Final</version.undertow>
<version.undertow>2.2.24.Final</version.undertow>
<version.slf4j>1.7.21</version.slf4j>
<version.jackson.databind>2.14.1</version.jackson.databind>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@@ -29,7 +29,7 @@
<version.logback>1.2.0</version.logback>
<version.junit>4.13.2</version.junit>
<version.mockito>2.1.0-beta.124</version.mockito>
<version.undertow>2.3.5.Final</version.undertow>
<version.undertow>2.2.24.Final</version.undertow>
<version.jsonpath>2.2.0</version.jsonpath>
<version.httpclient>4.5.13</version.httpclient>
<version.httpasyncclient>4.1.2</version.httpasyncclient>

View File

@@ -21,8 +21,6 @@ public interface PathHandlerInterface {
/**
* <p>Add a new pet to the store</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet" (<i>privileged: true</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -32,12 +30,9 @@ public interface PathHandlerInterface {
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p>
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
*
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link Pet}</p>
*
* <p><b>Responses</b>:</p>
* <ul>
* <li><b>200 (success)</b>: successful operation</li>
* <li><b>405 (client error)</b>: Invalid input</li>
* </ul>
*/
@@ -47,8 +42,6 @@ public interface PathHandlerInterface {
/**
* <p>Deletes a pet</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -182,8 +175,6 @@ public interface PathHandlerInterface {
/**
* <p>Update an existing pet</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/pet" (<i>privileged: true</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -193,12 +184,9 @@ public interface PathHandlerInterface {
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]</p>
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
*
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link Pet}</p>
*
* <p><b>Responses</b>:</p>
* <ul>
* <li><b>200 (success)</b>: successful operation</li>
* <li><b>400 (client error)</b>: Invalid ID supplied</li>
* <li><b>404 (client error)</b>: Pet not found</li>
* <li><b>405 (client error)</b>: Validation exception</li>
@@ -210,8 +198,6 @@ public interface PathHandlerInterface {
/**
* <p>Updates a pet in the store with form data</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -259,8 +245,6 @@ public interface PathHandlerInterface {
/**
* <p>uploads an image</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (<i>privileged: true</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -391,17 +375,12 @@ public interface PathHandlerInterface {
/**
* <p>Place an order for a pet</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/store/order" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
* <ul>
* </ul>
*
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link Order} (<i>required: true</i>)</p>
*
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link Order}</p>
*
@@ -419,15 +398,12 @@ public interface PathHandlerInterface {
*
* <p>This can only be done by the logged in user.</p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: true</i>)</p>
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
* <ul>
* </ul>
*
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link User} (<i>required: true</i>)</p>
*
*
* <p><b>Responses</b>:</p>
* <ul>
@@ -440,17 +416,12 @@ public interface PathHandlerInterface {
/**
* <p>Creates list of users with given input array</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: true</i>)</p>
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
* <ul>
* </ul>
*
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link java.util.List List} of {@link User} (<i>required: true</i>)</p>
*
*
* <p><b>Responses</b>:</p>
* <ul>
@@ -463,17 +434,12 @@ public interface PathHandlerInterface {
/**
* <p>Creates list of users with given input array</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: true</i>)</p>
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
* <ul>
* </ul>
*
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link java.util.List List} of {@link User} (<i>required: true</i>)</p>
*
*
* <p><b>Responses</b>:</p>
* <ul>
@@ -488,7 +454,7 @@ public interface PathHandlerInterface {
*
* <p>This can only be done by the logged in user.</p>
*
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: true</i>)</p>
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
* <ul>
@@ -516,8 +482,6 @@ public interface PathHandlerInterface {
/**
* <p>Get user by user name</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/{username}" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -549,8 +513,6 @@ public interface PathHandlerInterface {
/**
* <p>Logs user into the system</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/login" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
@@ -574,16 +536,13 @@ public interface PathHandlerInterface {
* </p>
* </li>
* </ul>
* <p><b>Response headers</b>: [CodegenProperty{openApiType='string', baseName='Set-Cookie', complexType='null', getter='getSetCookie', setter='setSetCookie', description='Cookie authentication key for use with the `api_key` apiKey authentication.', dataType='String', datatypeWithEnum='String', dataFormat='null', name='setCookie', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.Set-Cookie;', baseType='String', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='Cookie authentication key for use with the `api_key` apiKey authentication.', maxLength=null, minLength=null, pattern='null', example='AUTH_KEY=abcde12345; Path=/; HttpOnly', jsonSchema='{
"type" : "string",
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly"
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
* <p><b>Response headers</b>: [CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
"type" : "integer",
"format" : "int32"
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null, constant=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
"type" : "string",
"format" : "date-time"
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]</p>
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null, constant=null}]</p>
*
* <p><b>Produces</b>: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]</p>
* <p><b>Returns</b>: {@link String}</p>
@@ -600,9 +559,7 @@ public interface PathHandlerInterface {
/**
* <p>Logs out current logged in user session</p>
*
* <p></p>
*
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: true</i>)</p>
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: false</i>)</p>
*
*
* <p><b>Responses</b>:</p>
@@ -618,7 +575,7 @@ public interface PathHandlerInterface {
*
* <p>This can only be done by the logged in user.</p>
*
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: true</i>)</p>
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: false</i>)</p>
*
* <p><b>Request parameters</b>:</p>
* <ul>
@@ -633,9 +590,6 @@ public interface PathHandlerInterface {
* </li>
* </ul>
*
* <p><b>Consumes</b>: [{isJson=true, mediaType=application/json}]</p>
* <p><b>Payload</b>: {@link User} (<i>required: true</i>)</p>
*
*
* <p><b>Responses</b>:</p>
* <ul>

View File

@@ -1,5 +1,5 @@
{
"openapi" : "3.0.0",
"openapi" : "3.0.1",
"info" : {
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
"license" : {
@@ -9,10 +9,6 @@
"title" : "OpenAPI Petstore",
"version" : "1.0.0"
},
"externalDocs" : {
"description" : "Find out more about Swagger",
"url" : "http://swagger.io"
},
"servers" : [ {
"url" : "http://petstore.swagger.io/v2"
} ],
@@ -29,28 +25,26 @@
"paths" : {
"/pet" : {
"post" : {
"description" : "",
"operationId" : "addPet",
"requestBody" : {
"$ref" : "#/components/requestBodies/Pet"
},
"responses" : {
"200" : {
"content" : {
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"description" : "successful operation"
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "Pet object that needs to be added to the store",
"required" : true
},
"responses" : {
"405" : {
"content" : { },
"description" : "Invalid input"
}
},
@@ -59,42 +53,39 @@
} ],
"summary" : "Add a new pet to the store",
"tags" : [ "pet" ],
"x-codegen-request-body-name" : "body",
"x-content-type" : "application/json",
"x-accepts" : "application/json"
},
"put" : {
"description" : "",
"externalDocs" : {
"description" : "API documentation for the updatePet operation",
"url" : "http://petstore.swagger.io/v2/doc/updatePet"
},
"operationId" : "updatePet",
"requestBody" : {
"$ref" : "#/components/requestBodies/Pet"
},
"responses" : {
"200" : {
"content" : {
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"description" : "successful operation"
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "Pet object that needs to be added to the store",
"required" : true
},
"responses" : {
"400" : {
"content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
"content" : { },
"description" : "Pet not found"
},
"405" : {
"content" : { },
"description" : "Validation exception"
}
},
@@ -103,6 +94,7 @@
} ],
"summary" : "Update an existing pet",
"tags" : [ "pet" ],
"x-codegen-request-body-name" : "body",
"x-content-type" : "application/json",
"x-accepts" : "application/json"
}
@@ -112,7 +104,6 @@
"description" : "Multiple status values can be provided with comma separated strings",
"operationId" : "findPetsByStatus",
"parameters" : [ {
"deprecated" : true,
"description" : "Status values that need to be considered for filter",
"explode" : false,
"in" : "query",
@@ -151,11 +142,12 @@
"description" : "successful operation"
},
"400" : {
"content" : { },
"description" : "Invalid status value"
}
},
"security" : [ {
"petstore_auth" : [ "read:pets" ]
"petstore_auth" : [ "write:pets", "read:pets" ]
} ],
"summary" : "Finds Pets by status",
"tags" : [ "pet" ],
@@ -204,11 +196,12 @@
"description" : "successful operation"
},
"400" : {
"content" : { },
"description" : "Invalid tag value"
}
},
"security" : [ {
"petstore_auth" : [ "read:pets" ]
"petstore_auth" : [ "write:pets", "read:pets" ]
} ],
"summary" : "Finds Pets by tags",
"tags" : [ "pet" ],
@@ -217,31 +210,26 @@
},
"/pet/{petId}" : {
"delete" : {
"description" : "",
"operationId" : "deletePet",
"parameters" : [ {
"explode" : false,
"in" : "header",
"name" : "api_key",
"required" : false,
"schema" : {
"type" : "string"
},
"style" : "simple"
}
}, {
"description" : "Pet id to delete",
"explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
},
"style" : "simple"
}
} ],
"responses" : {
"400" : {
"content" : { },
"description" : "Invalid pet value"
}
},
@@ -257,15 +245,13 @@
"operationId" : "getPetById",
"parameters" : [ {
"description" : "ID of pet to return",
"explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
},
"style" : "simple"
}
} ],
"responses" : {
"200" : {
@@ -284,9 +270,11 @@
"description" : "successful operation"
},
"400" : {
"content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
"content" : { },
"description" : "Pet not found"
}
},
@@ -298,19 +286,16 @@
"x-accepts" : "application/json"
},
"post" : {
"description" : "",
"operationId" : "updatePetWithForm",
"parameters" : [ {
"description" : "ID of pet that needs to be updated",
"explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
},
"style" : "simple"
}
} ],
"requestBody" : {
"content" : {
@@ -323,6 +308,7 @@
},
"responses" : {
"405" : {
"content" : { },
"description" : "Invalid input"
}
},
@@ -337,19 +323,16 @@
},
"/pet/{petId}/uploadImage" : {
"post" : {
"description" : "",
"operationId" : "uploadFile",
"parameters" : [ {
"description" : "ID of pet to update",
"explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
},
"style" : "simple"
}
} ],
"requestBody" : {
"content" : {
@@ -411,11 +394,10 @@
},
"/store/order" : {
"post" : {
"description" : "",
"operationId" : "placeOrder",
"requestBody" : {
"content" : {
"application/json" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/Order"
}
@@ -441,12 +423,14 @@
"description" : "successful operation"
},
"400" : {
"content" : { },
"description" : "Invalid Order"
}
},
"summary" : "Place an order for a pet",
"tags" : [ "store" ],
"x-content-type" : "application/json",
"x-codegen-request-body-name" : "body",
"x-content-type" : "*/*",
"x-accepts" : "application/json"
}
},
@@ -456,20 +440,20 @@
"operationId" : "deleteOrder",
"parameters" : [ {
"description" : "ID of the order that needs to be deleted",
"explode" : false,
"in" : "path",
"name" : "orderId",
"required" : true,
"schema" : {
"type" : "string"
},
"style" : "simple"
}
} ],
"responses" : {
"400" : {
"content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
"content" : { },
"description" : "Order not found"
}
},
@@ -482,7 +466,6 @@
"operationId" : "getOrderById",
"parameters" : [ {
"description" : "ID of pet that needs to be fetched",
"explode" : false,
"in" : "path",
"name" : "orderId",
"required" : true,
@@ -491,8 +474,7 @@
"maximum" : 5,
"minimum" : 1,
"type" : "integer"
},
"style" : "simple"
}
} ],
"responses" : {
"200" : {
@@ -511,9 +493,11 @@
"description" : "successful operation"
},
"400" : {
"content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
"content" : { },
"description" : "Order not found"
}
},
@@ -528,7 +512,7 @@
"operationId" : "createUser",
"requestBody" : {
"content" : {
"application/json" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/User"
}
@@ -539,85 +523,96 @@
},
"responses" : {
"default" : {
"content" : { },
"description" : "successful operation"
}
},
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Create user",
"tags" : [ "user" ],
"x-content-type" : "application/json",
"x-codegen-request-body-name" : "body",
"x-content-type" : "*/*",
"x-accepts" : "application/json"
}
},
"/user/createWithArray" : {
"post" : {
"description" : "",
"operationId" : "createUsersWithArrayInput",
"requestBody" : {
"$ref" : "#/components/requestBodies/UserArray"
"content" : {
"*/*" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/User"
},
"type" : "array"
}
}
},
"description" : "List of user object",
"required" : true
},
"responses" : {
"default" : {
"content" : { },
"description" : "successful operation"
}
},
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Creates list of users with given input array",
"tags" : [ "user" ],
"x-content-type" : "application/json",
"x-codegen-request-body-name" : "body",
"x-content-type" : "*/*",
"x-accepts" : "application/json"
}
},
"/user/createWithList" : {
"post" : {
"description" : "",
"operationId" : "createUsersWithListInput",
"requestBody" : {
"$ref" : "#/components/requestBodies/UserArray"
"content" : {
"*/*" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/User"
},
"type" : "array"
}
}
},
"description" : "List of user object",
"required" : true
},
"responses" : {
"default" : {
"content" : { },
"description" : "successful operation"
}
},
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Creates list of users with given input array",
"tags" : [ "user" ],
"x-content-type" : "application/json",
"x-codegen-request-body-name" : "body",
"x-content-type" : "*/*",
"x-accepts" : "application/json"
}
},
"/user/login" : {
"get" : {
"description" : "",
"operationId" : "loginUser",
"parameters" : [ {
"description" : "The user name for login",
"explode" : true,
"in" : "query",
"name" : "username",
"required" : true,
"schema" : {
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
"type" : "string"
},
"style" : "form"
}
}, {
"description" : "The password for login in clear text",
"explode" : true,
"in" : "query",
"name" : "password",
"required" : true,
"schema" : {
"type" : "string"
},
"style" : "form"
}
} ],
"responses" : {
"200" : {
@@ -635,36 +630,24 @@
},
"description" : "successful operation",
"headers" : {
"Set-Cookie" : {
"description" : "Cookie authentication key for use with the `api_key` apiKey authentication.",
"explode" : false,
"schema" : {
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly",
"type" : "string"
},
"style" : "simple"
},
"X-Rate-Limit" : {
"description" : "calls per hour allowed by the user",
"explode" : false,
"schema" : {
"format" : "int32",
"type" : "integer"
},
"style" : "simple"
}
},
"X-Expires-After" : {
"description" : "date in UTC when token expires",
"explode" : false,
"schema" : {
"format" : "date-time",
"type" : "string"
},
"style" : "simple"
}
}
}
},
"400" : {
"content" : { },
"description" : "Invalid username/password supplied"
}
},
@@ -675,16 +658,13 @@
},
"/user/logout" : {
"get" : {
"description" : "",
"operationId" : "logoutUser",
"responses" : {
"default" : {
"content" : { },
"description" : "successful operation"
}
},
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Logs out current logged in user session",
"tags" : [ "user" ],
"x-accepts" : "application/json"
@@ -696,43 +676,37 @@
"operationId" : "deleteUser",
"parameters" : [ {
"description" : "The name that needs to be deleted",
"explode" : false,
"in" : "path",
"name" : "username",
"required" : true,
"schema" : {
"type" : "string"
},
"style" : "simple"
}
} ],
"responses" : {
"400" : {
"content" : { },
"description" : "Invalid username supplied"
},
"404" : {
"content" : { },
"description" : "User not found"
}
},
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Delete user",
"tags" : [ "user" ],
"x-accepts" : "application/json"
},
"get" : {
"description" : "",
"operationId" : "getUserByName",
"parameters" : [ {
"description" : "The name that needs to be fetched. Use user1 for testing.",
"explode" : false,
"in" : "path",
"name" : "username",
"required" : true,
"schema" : {
"type" : "string"
},
"style" : "simple"
}
} ],
"responses" : {
"200" : {
@@ -751,9 +725,11 @@
"description" : "successful operation"
},
"400" : {
"content" : { },
"description" : "Invalid username supplied"
},
"404" : {
"content" : { },
"description" : "User not found"
}
},
@@ -766,18 +742,16 @@
"operationId" : "updateUser",
"parameters" : [ {
"description" : "name that need to be deleted",
"explode" : false,
"in" : "path",
"name" : "username",
"required" : true,
"schema" : {
"type" : "string"
},
"style" : "simple"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/User"
}
@@ -788,55 +762,23 @@
},
"responses" : {
"400" : {
"content" : { },
"description" : "Invalid user supplied"
},
"404" : {
"content" : { },
"description" : "User not found"
}
},
"security" : [ {
"api_key" : [ ]
} ],
"summary" : "Updated user",
"tags" : [ "user" ],
"x-content-type" : "application/json",
"x-codegen-request-body-name" : "body",
"x-content-type" : "*/*",
"x-accepts" : "application/json"
}
}
},
"components" : {
"requestBodies" : {
"UserArray" : {
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/User"
},
"type" : "array"
}
}
},
"description" : "List of user object",
"required" : true
},
"Pet" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
},
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/Pet"
}
}
},
"description" : "Pet object that needs to be added to the store",
"required" : true
}
},
"schemas" : {
"Order" : {
"description" : "An order for a pets from the pet store",
@@ -893,7 +835,6 @@
"type" : "integer"
},
"name" : {
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
"type" : "string"
}
},
@@ -1023,7 +964,6 @@
}
},
"status" : {
"deprecated" : true,
"description" : "pet status in the store",
"enum" : [ "available", "pending", "sold" ],
"type" : "string"
@@ -1105,5 +1045,6 @@
"type" : "apiKey"
}
}
}
},
"x-original-swagger-version" : "2.0"
}