mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 07:06:09 +00:00
Compare commits
162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7fcb39a2d | ||
|
|
21d7330aea | ||
|
|
90e25f6f4c | ||
|
|
4c3820f66f | ||
|
|
c33b5a66e7 | ||
|
|
e6cee8eb71 | ||
|
|
19eaf73205 | ||
|
|
b7ee885805 | ||
|
|
a5ac2ee1a3 | ||
|
|
d869544ce1 | ||
|
|
d7bdd7f490 | ||
|
|
6fa586635b | ||
|
|
45fc02350b | ||
|
|
b78d4fce6a | ||
|
|
1b440e191c | ||
|
|
769b0e0e38 | ||
|
|
f01ee4a8d2 | ||
|
|
1baec57de8 | ||
|
|
26f21bb6a0 | ||
|
|
19f21acd85 | ||
|
|
c12f6041f7 | ||
|
|
6dee98784a | ||
|
|
d36ce1225d | ||
|
|
370d0e82f8 | ||
|
|
b4154be8d0 | ||
|
|
4ea4ceb0ff | ||
|
|
c15a4375e2 | ||
|
|
328cadb070 | ||
|
|
5135967c91 | ||
|
|
a4312412fc | ||
|
|
1f8ceb9a1e | ||
|
|
de40772939 | ||
|
|
f0b9e21b6b | ||
|
|
57126a1900 | ||
|
|
a968fb1e33 | ||
|
|
061552f5d4 | ||
|
|
64f5dc8077 | ||
|
|
2553d056dc | ||
|
|
e377eabbc5 | ||
|
|
5b82ed9407 | ||
|
|
a2a88cb8f0 | ||
|
|
0b2aa21f5d | ||
|
|
b203539869 | ||
|
|
f6019f00a1 | ||
|
|
7654356df2 | ||
|
|
cbd2038cb5 | ||
|
|
f6c617d09f | ||
|
|
fb1b62816f | ||
|
|
84813be309 | ||
|
|
0ae54911c3 | ||
|
|
a127aab497 | ||
|
|
17bb3750c4 | ||
|
|
ecf905681c | ||
|
|
201acbd3de | ||
|
|
c55bee1273 | ||
|
|
55a21bc4fb | ||
|
|
c7a711697c | ||
|
|
bdfe3706f7 | ||
|
|
4990dd6d8a | ||
|
|
8a955255b3 | ||
|
|
cb530d4e75 | ||
|
|
58f486651e | ||
|
|
3a56e3818f | ||
|
|
57227e510f | ||
|
|
c5d4dc6d10 | ||
|
|
06ad7a51ef | ||
|
|
c96764f563 | ||
|
|
9286b43dfa | ||
|
|
5f2ca61862 | ||
|
|
0068932470 | ||
|
|
030b75b012 | ||
|
|
96da7aaf9d | ||
|
|
eecd30c2da | ||
|
|
ac59ab9201 | ||
|
|
2bd4febd28 | ||
|
|
a7a5937813 | ||
|
|
90ed1290fa | ||
|
|
2331432cc0 | ||
|
|
3d23b99242 | ||
|
|
b447e4f51d | ||
|
|
1ceb5f5c96 | ||
|
|
a61b7bbc65 | ||
|
|
4d75a29991 | ||
|
|
5de112fca5 | ||
|
|
62eecabfa5 | ||
|
|
8b2ac7b0ac | ||
|
|
f5c49609d2 | ||
|
|
ede2a2316c | ||
|
|
6e4c1307a7 | ||
|
|
83e9986bba | ||
|
|
cd936a66fd | ||
|
|
e9c850fd4e | ||
|
|
cd2a0db1ce | ||
|
|
c4dbd2cfa3 | ||
|
|
99144252f7 | ||
|
|
a4b356c8b3 | ||
|
|
e78183abde | ||
|
|
dfcd86f35a | ||
|
|
e2ad6dbc1b | ||
|
|
32b01cb39b | ||
|
|
a3952b2beb | ||
|
|
22ac8faec7 | ||
|
|
2b7ae4fa46 | ||
|
|
6b6d1b1a97 | ||
|
|
008ddfb1ef | ||
|
|
a80788d424 | ||
|
|
1c85fdc473 | ||
|
|
ce3e0c7d68 | ||
|
|
ed9133e77f | ||
|
|
e26f440729 | ||
|
|
0284fcd5c7 | ||
|
|
f136b9fd01 | ||
|
|
646bcc64ad | ||
|
|
ce893a84ff | ||
|
|
f2671fcb78 | ||
|
|
2ba0e03629 | ||
|
|
02473d8175 | ||
|
|
c43234711a | ||
|
|
3b6c2b2342 | ||
|
|
f5b2bb5057 | ||
|
|
1df719801e | ||
|
|
c67dc5d7d5 | ||
|
|
367ba3a2cf | ||
|
|
4947634a24 | ||
|
|
e73ae8c048 | ||
|
|
4526ca2610 | ||
|
|
923e246fa8 | ||
|
|
9bd2a45e72 | ||
|
|
663c8b2d80 | ||
|
|
319bd7eaa8 | ||
|
|
ae563bcf91 | ||
|
|
04dfff83e0 | ||
|
|
fc22de0522 | ||
|
|
4cdf610be0 | ||
|
|
a9c168c400 | ||
|
|
c3a21863b5 | ||
|
|
72869d53a3 | ||
|
|
872f9399cd | ||
|
|
3506ad6f17 | ||
|
|
9ec1e23c10 | ||
|
|
0c4a928ebc | ||
|
|
604ac6d90f | ||
|
|
dd9a19ab8f | ||
|
|
d2aa40a935 | ||
|
|
caf52641f0 | ||
|
|
08fc5bb38f | ||
|
|
0c5cec8f75 | ||
|
|
00d56375b0 | ||
|
|
ee2f0e04a9 | ||
|
|
a812bf18a8 | ||
|
|
bc247664eb | ||
|
|
163c70e7d8 | ||
|
|
72d6cff188 | ||
|
|
14efb8c70f | ||
|
|
de3ec75b11 | ||
|
|
566e7ef583 | ||
|
|
7d6063d05c | ||
|
|
775b64f6c7 | ||
|
|
fd02bc3d84 | ||
|
|
9889e5dfba | ||
|
|
c3220848f2 | ||
|
|
25b0cbe2f1 |
24
.github/.test/samples.json
vendored
24
.github/.test/samples.json
vendored
@@ -1244,6 +1244,30 @@
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-not-provided-in-root-with-npm.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-not-provided-in-root.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-provided-in-root-with-npm.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-provided-in-root.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-node-petstore-with-npm.sh",
|
||||
"matches": [
|
||||
|
||||
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -5,7 +5,16 @@
|
||||
|
||||
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
|
||||
- [ ] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
|
||||
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) beforehand.
|
||||
- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. 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`
|
||||
- [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.
|
||||
- [ ] 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/utils/export_docs_generators.sh
|
||||
```
|
||||
Commit all changed files.
|
||||
This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master.
|
||||
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`, `5.1.x`, `6.0.x`
|
||||
- [ ] 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.
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -31,6 +31,7 @@ packages/
|
||||
.vscode/
|
||||
**/.vs
|
||||
.factorypath
|
||||
.metals/*
|
||||
|
||||
.settings
|
||||
|
||||
@@ -258,3 +259,6 @@ samples/client/petstore/c/*.so
|
||||
# Ruby
|
||||
samples/openapi3/client/petstore/ruby/Gemfile.lock
|
||||
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock
|
||||
|
||||
# Crystal
|
||||
samples/client/petstore/crystal/lib
|
||||
|
||||
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Binary file not shown.
3
.mvn/wrapper/maven-wrapper.properties
vendored
3
.mvn/wrapper/maven-wrapper.properties
vendored
@@ -1 +1,2 @@
|
||||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||
|
||||
17
.travis.yml
17
.travis.yml
@@ -62,6 +62,17 @@ addons:
|
||||
- petstore.swagger.io
|
||||
|
||||
before_install:
|
||||
# to run petstore server locally via docker
|
||||
- echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin || true
|
||||
- docker pull swaggerapi/petstore
|
||||
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- docker ps -a
|
||||
# install crystal
|
||||
- curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash
|
||||
- curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -
|
||||
- echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list
|
||||
- sudo apt-get update
|
||||
- sudo apt install crystal
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
|
||||
- export PATH="$HOME/.yarn/bin:$PATH"
|
||||
# install rust
|
||||
@@ -75,10 +86,6 @@ before_install:
|
||||
- npm config set registry http://registry.npmjs.org/
|
||||
# set python 3.6.3 as default
|
||||
- source ~/virtualenv/python3.6/bin/activate
|
||||
# to run petstore server locally via docker
|
||||
- docker pull swaggerapi/petstore
|
||||
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- docker ps -a
|
||||
# -- skip bash test to shorten build time
|
||||
# Add bats test framework and cURL for Bash script integration tests
|
||||
#- sudo add-apt-repository ppa:duggan/bats --yes
|
||||
@@ -124,7 +131,7 @@ before_install:
|
||||
fi;
|
||||
- pushd .; cd website; yarn install; popd
|
||||
# install Deno
|
||||
- sh -s v1.1.2 < ./CI/deno_install.sh
|
||||
- sh -s v1.6.2 < ./CI/deno_install.sh
|
||||
- export PATH="$HOME/.deno/bin:$PATH"
|
||||
|
||||
install:
|
||||
|
||||
@@ -2,6 +2,11 @@ kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
# test nim client
|
||||
- name: nim-client-test
|
||||
image: nimlang/nim
|
||||
commands:
|
||||
- (cd samples/client/petstore/nim/ && nim c sample_client.nim)
|
||||
# test protobuf schema generator
|
||||
- name: protobuf-schema-test
|
||||
image: nanoservice/protobuf-go
|
||||
|
||||
@@ -41,13 +41,14 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
stack upgrade
|
||||
stack --version
|
||||
# install r
|
||||
# prepare r
|
||||
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
|
||||
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
|
||||
gpg -a --export E084DAB9 | sudo apt-key add -
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install r-base
|
||||
R --version
|
||||
|
||||
# install curl
|
||||
sudo apt-get -y build-dep libcurl4-gnutls-dev
|
||||
sudo apt-get -y install libcurl4-gnutls-dev
|
||||
|
||||
@@ -49,6 +49,7 @@ Code change should conform to the programming style guide of the respective lang
|
||||
- C++: https://google.github.io/styleguide/cppguide.html
|
||||
- C++ (Tizen): https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style
|
||||
- Clojure: https://github.com/bbatsov/clojure-style-guide
|
||||
- Crystal: https://crystal-lang.org/reference/conventions/coding_style.html
|
||||
- Dart: https://www.dartlang.org/guides/language/effective-dart/style
|
||||
- Elixir: https://github.com/christopheradams/elixir_style_guide
|
||||
- Eiffel: https://www.eiffel.org/doc/eiffel/Coding%20Standards
|
||||
|
||||
61
README.md
61
README.md
@@ -3,13 +3,13 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE)  [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
|
||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE) [](https://opencollective.com/openapi_generator) [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.0.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.0.1`):
|
||||
[](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
@@ -18,6 +18,22 @@
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
[](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22)
|
||||
|
||||
[5.1.x](https://github.com/OpenAPITools/openapi-generator/tree/5.1.x) (`5.1.x`):
|
||||
[](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
[6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`):
|
||||
[](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
@@ -47,6 +63,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[<img src="https://openapi-generator.tech/img/companies/docspring.png" width="128" height="128">](https://docspring.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/datadog.png" width="128" height="128">](https://datadoghq.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/thales.jpg" width="128" height="128">](https://cpl.thalesgroup.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/apideck.jpg" width="128" height="128">](https://www.apideck.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring
|
||||
|
||||
@@ -60,11 +77,11 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
|
||||
| | Languages/Frameworks |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **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** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) |
|
||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0), **C++** (cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **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), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) |
|
||||
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (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** |
|
||||
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
|
||||
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
||||
| **Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer** |
|
||||
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer** |
|
||||
|
||||
## Table of contents
|
||||
|
||||
@@ -102,7 +119,9 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 5.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.1-SNAPSHOT/) | TBD | Patch release with enhancements, bug fixes, etc |
|
||||
| 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Nov/Dec 2021 | Minor release with breaking changes (no fallback) |
|
||||
| 5.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.1.0-SNAPSHOT/) | Mar/Apr 2021 | Minor release with breaking changes (with fallback) |
|
||||
| 5.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.1-SNAPSHOT/) | Jan/Feb 2021 | Patch release with enhancements, bug fixes, etc |
|
||||
| [5.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.0.0) (latest stable release) | 21.12.2020 | Major release with breaking changes (no fallback) |
|
||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||
|
||||
@@ -431,10 +450,10 @@ To get a list of PHP specified options (which can be passed to the generator wit
|
||||
You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) as follows:
|
||||
|
||||
```sh
|
||||
./bin/java-petstore-okhttp-gson.sh
|
||||
./bin/generate-samples.sh ./bin/configs/java-okhttp-gson.yaml
|
||||
```
|
||||
|
||||
(On Windows, run `.\bin\windows\java-petstore-okhttp-gson.bat` instead)
|
||||
(On Windows, please install [GIT Bash for Windows](https://gitforwindows.org/) to run the command above)
|
||||
|
||||
This script uses the default library, which is `okhttp-gson`. It will run the generator with this command:
|
||||
|
||||
@@ -442,6 +461,8 @@ This script uses the default library, which is `okhttp-gson`. It will run the ge
|
||||
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 java \
|
||||
-t modules/openapi-generator/src/main/resources/Java \
|
||||
--additional-properties artifactId=petstore-okhttp-gson,hideGenerationTimestamp:true \
|
||||
-o samples/client/petstore/java/okhttp-gson
|
||||
```
|
||||
|
||||
@@ -507,13 +528,7 @@ cd samples/client/petstore/java/okhttp-gson
|
||||
mvn package
|
||||
```
|
||||
|
||||
Other languages have petstore samples, too:
|
||||
|
||||
- [Swift5](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/swift5)
|
||||
- [Ruby](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/ruby)
|
||||
- [Kotlin](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/kotlin)
|
||||
|
||||
... and more.
|
||||
Other generators have [samples](https://github.com/OpenAPITools/openapi-generator/tree/master/samples) too.
|
||||
|
||||
### [3.1 - Customization](#table-of-contents)
|
||||
|
||||
@@ -653,6 +668,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Vouchery.io](https://vouchery.io)
|
||||
- [Xero](https://www.xero.com/)
|
||||
- [Yahoo Japan](https://www.yahoo.co.jp/)
|
||||
- [viadee](https://www.viadee.de/)
|
||||
- [Vonage](https://vonage.com)
|
||||
- [YITU Technology](https://www.yitutech.com/)
|
||||
- [Yelp](https://www.yelp.com/)
|
||||
@@ -788,8 +804,11 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2020-10-31 - [[B2] OpenAPI Specification으로 타입-세이프하게 API 개발하기: 희망편 VS 절망편](https://www.youtube.com/watch?v=J4JHLESAiFk) by 최태건 at [FEConf 2020](https://2020.feconf.kr/)
|
||||
- 2020-11-05 - [Automated REST-Api Code Generation: Wie IT-Systeme miteinander sprechen](https://www.massiveart.com/blog/automated-rest-api-code-generation-wie-it-systeme-miteinander-sprechen) by Stefan Rottensteiner at [MASSIVE ART Blog](https://www.massiveart.com/blog)
|
||||
- 2020-12-01 - [OpenAPI GeneratorでGoのAPIサーバー/クライアントコードを自動生成する](https://qiita.com/saki-engineering/items/b20d8b6074c4da9664a5) by [@saki-engineering](https://qiita.com/saki-engineering)
|
||||
- 2020-12-04 - [Scaling the Test Coverage of OpenAPI Generator for 30+ Programming Languages](https://www.youtube.com/watch?v=7Lke9dHRqT0) by [William Cheng](https://github.com/wing328) at [Open Source Summit Japan + Automotive Linux Summit 2020](https://events.linuxfoundation.org/archive/2020/open-source-summit-japan/) ([Slides](https://speakerdeck.com/wing328/scaling-the-test-coverage-of-openapi-generator-for-30-plus-programming-languages))
|
||||
- 2020-12-09 - [プロジェクトにOpenAPI Generatorで自動生成された型付きAPI Clientを導入した話](https://qiita.com/yoshifujiT/items/905c18700ede23f40840) by [@yoshifujiT](https://github.com/yoshifujiT)
|
||||
- 2020-12-15 - [Next.js + NestJS + GraphQLで変化に追従するフロントエンドへ 〜 ショッピングクーポンの事例紹介](https://techblog.yahoo.co.jp/entry/2020121530052952/) by [小倉 陸](https://github.com/ogugu9) at [Yahoo! JAPAN Tech Blog](https://techblog.yahoo.co.jp/)
|
||||
- 2021-01-08 - [Hello, New API – Part 1](https://www.nginx.com/blog/hello-new-api-part-1/) by [Jeremy Schulman](https://www.nginx.com/people/jeremy-schulman/) at [Major League Baseball](https://www.mlb.com)
|
||||
- 2021-01-18 - [「アプリ開発あるある」を疑うことから始まった、API Clientコードの自動生成【デブスト2020】](https://codezine.jp/article/detail/13406?p=2) by [CodeZine編集部](https://codezine.jp/author/1)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -824,6 +843,7 @@ Here is a list of template creators:
|
||||
* C# (.NET Standard 1.3 ): @Gronsak
|
||||
* C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||
* Clojure: @xhh
|
||||
* Crystal: @wing328
|
||||
* Dart: @yissachar
|
||||
* Dart (refactor): @joernahrens
|
||||
* Dart 2: @swipesight
|
||||
@@ -882,10 +902,11 @@ Here is a list of template creators:
|
||||
* TypeScript (Angular7): @topce
|
||||
* TypeScript (Axios): @nicokoenig
|
||||
* TypeScript (Fetch): @leonyu
|
||||
* TypeScript (Inversify): @gualtierim
|
||||
* TypeScript (jQuery): @bherila
|
||||
* TypeScript (Nestjs): @vfrank66
|
||||
* TypeScript (Node): @mhardorf
|
||||
* TypeScript (Rxjs): @denyo
|
||||
* TypeScript (Inversify): @gualtierim
|
||||
* TypeScript (redux-query): @petejohansonxo
|
||||
* Server Stubs
|
||||
* Ada: @stcarrez
|
||||
@@ -939,6 +960,7 @@ Here is a list of template creators:
|
||||
* Schema
|
||||
* Avro: @sgadouar
|
||||
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||
* Ktorm: @Luiz-Monad
|
||||
* MySQL: @ybelenko
|
||||
* Protocol Buffer: @wing328
|
||||
|
||||
@@ -973,7 +995,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
|
||||
#### Members of Technical Committee
|
||||
|
||||
| Languages | Member (join date) |
|
||||
| Languages/Generators | Member (join date) |
|
||||
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ActionScript | |
|
||||
| Ada | @stcarrez (2018/02) @michelealbano (2018/02) |
|
||||
@@ -990,11 +1012,12 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Elm | @eriktim (2018/09) |
|
||||
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
|
||||
| F# | @nmfisher (2019/05) |
|
||||
| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @bkabrda (2019/07) |
|
||||
| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) |
|
||||
| GraphQL | @renepardon (2018/12) |
|
||||
| Groovy | |
|
||||
| Haskell | |
|
||||
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01) |
|
||||
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) |
|
||||
| JMeter | @kannkyo (2021/01) |
|
||||
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) |
|
||||
| Lua | @daurnimator (2017/08) |
|
||||
| Nim | |
|
||||
|
||||
@@ -46,6 +46,8 @@ build_script:
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCore\Org.OpenAPITools.sln
|
||||
# build C# API client (.net framework 4.7)
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net47\Org.OpenAPITools.sln
|
||||
# build C# API client (.net 5.0)
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\Org.OpenAPITools.sln
|
||||
# build C# API client
|
||||
- nuget restore samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln
|
||||
- msbuild samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
@@ -65,6 +67,8 @@ test_script:
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net framework 4.7)
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net 5.0)
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client
|
||||
- nunit3-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
|
||||
# test c# API client (with PropertyChanged)
|
||||
|
||||
9
bin/configs/crystal.yaml
Normal file
9
bin/configs/crystal.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: crystal
|
||||
outputDir: samples/client/petstore/crystal
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/crystal
|
||||
additionalProperties:
|
||||
shardVersion: 1.0.0
|
||||
moduleName: Petstore
|
||||
shardName: petstore
|
||||
strictSpecBehavior: false
|
||||
13
bin/configs/csharp-netcore-OpenAPIClient-net50.yaml
Normal file
13
bin/configs/csharp-netcore-OpenAPIClient-net50.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# for .net standard
|
||||
generatorName: csharp-netcore
|
||||
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0
|
||||
# TODO switch to http signature spec after fixing compilation issues
|
||||
#inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp-netcore
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net5.0
|
||||
@@ -1,6 +1,6 @@
|
||||
generatorName: elixir
|
||||
outputDir: samples/client/petstore/elixir
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/elixir
|
||||
additionalProperties:
|
||||
invokerPackage: OpenapiPetstore
|
||||
|
||||
11
bin/configs/java-jersey2-java8-localdatetime.yaml
Normal file
11
bin/configs/java-jersey2-java8-localdatetime.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/jersey2-java8-localdatetime
|
||||
library: jersey2
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-jersey2-java8-localdatetime
|
||||
hideGenerationTimestamp: "true"
|
||||
dateLibrary: java8-localdatetime
|
||||
java8: true
|
||||
delegatePattern: true
|
||||
7
bin/configs/ktorm-schema.yaml
Normal file
7
bin/configs/ktorm-schema.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
generatorName: ktorm-schema
|
||||
outputDir: samples/schema/petstore/ktorm
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ktorm-schema
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: true
|
||||
importModelPackageName: org.openapitools.client.models
|
||||
8
bin/configs/ruby-extensions-x-auth-id-alias.yaml
Normal file
8
bin/configs/ruby-extensions-x-auth-id-alias.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
generatorName: ruby
|
||||
outputDir: samples/openapi3/client/extensions/x-auth-id-alias/ruby-client
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ruby-client
|
||||
additionalProperties:
|
||||
gemName: x_auth_id_alias
|
||||
gemVersion: 1.0.0
|
||||
moduleName: XAuthIDAlias
|
||||
@@ -6,3 +6,4 @@ generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore-with-fake-endpoints-models-for-testing
|
||||
publishRustRegistry: crates-io
|
||||
|
||||
8
bin/configs/rust-server-ping-bearer-auth-v3.yaml
Normal file
8
bin/configs/rust-server-ping-bearer-auth-v3.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
generatorName: rust-server
|
||||
outputDir: samples/server/petstore/rust-server/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
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: ping-bearer-auth
|
||||
6
bin/configs/typescript-angular-v9-provided-in-any.yaml
Normal file
6
bin/configs/typescript-angular-v9-provided-in-any.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: typescript-angular
|
||||
outputDir: samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
additionalProperties:
|
||||
ngVersion: 9.0.0
|
||||
providedIn: any
|
||||
10
bin/configs/typescript-nestjs-v6-provided-in-root.yaml
Normal file
10
bin/configs/typescript-nestjs-v6-provided-in-root.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
generatorName: typescript-nestjs
|
||||
outputDir: samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-nestjs
|
||||
additionalProperties:
|
||||
nestVersion: 6.0.0
|
||||
"npmName": "@openapitools/typescript-nestjs-petstore"
|
||||
"npmVersion": "1.0.0"
|
||||
"npmRepository" : "https://skimdb.npmjs.com/registry"
|
||||
"snapshot" : false
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: ${SCRIPT}"
|
||||
@@ -17,4 +17,4 @@ do
|
||||
((i=i%N)); ((i++==0)) && wait
|
||||
./bin/utils/export_generator.sh ${GENERATOR} &
|
||||
done
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
# csharp-netcore test files and image for upload
|
||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
||||
sha256: b74ef9eefa4b41fd3233e083fe2355babf25a77f9073d28e1aa81ae2e0a5f1d0
|
||||
sha256: aceebba316148a2a803a15ef4e13bbd0b0a1b8d15006cd88adb9b39a620ee451
|
||||
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
|
||||
set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\default --additional-properties=platform=node,npmName=ts-petstore-client
|
||||
java %JAVA_OPTS% -jar %executable% %args%
|
||||
|
||||
args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\jquery --additional-properties=framework=jquery,npmName=ts-petstore-client
|
||||
java %JAVA_OPTS% -jar %executable% %args%
|
||||
|
||||
set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\object_params --additional-properties=platform=node,npmName=ts-petstore-client,useObjectParameters
|
||||
java %JAVA_OPTS% -jar %executable% %args%
|
||||
|
||||
set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\inversify --additional-properties=platform=node,npmName=ts-petstore-client,useInversify
|
||||
java %JAVA_OPTS% -jar %executable% %args%
|
||||
|
||||
set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\deno --additional-properties=platform=deno
|
||||
java %JAVA_OPTS% -jar %executable% %args%
|
||||
@@ -11,7 +11,7 @@ workflows:
|
||||
primary:
|
||||
steps:
|
||||
- git-clone@4.0.17: {}
|
||||
- brew-install@0.10.2:
|
||||
- brew-install@0.11.0:
|
||||
inputs:
|
||||
- packages: maven
|
||||
- script@1.1.6:
|
||||
@@ -30,15 +30,6 @@ workflows:
|
||||
|
||||
mvn --no-snapshot-updates package -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
title: Build openapi-generator
|
||||
- script@1.1.6:
|
||||
title: Update Swift samples
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
bin/generate-samples.sh ./bin/configs/other/swift5-*
|
||||
- script@1.1.6:
|
||||
title: Run Swift5 tests
|
||||
inputs:
|
||||
@@ -47,5 +38,5 @@ workflows:
|
||||
|
||||
set -e
|
||||
|
||||
./samples/client/test/swift5/swift5_test_all.sh
|
||||
./samples/client/petstore/swift5/swift5_test_all.sh
|
||||
|
||||
@@ -21,7 +21,7 @@ Our tooling supports the following types of configuration:
|
||||
|
||||
## Tool-specific Declarations
|
||||
|
||||
The READMEs for the [CLI](https://openapi-generator.tech/docs/usage#generate), [Gradle Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin), [Maven Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin), and [SBT Plugin](https://github.com/OpenAPITools/sbt-openapi-generator/blob/master/README.md) may have top-level or tooling specific options which appear to duplicate 'config options' or 'global properties'. Each may also expose user-facing properties slightly differently from the other tools. This may occur due to:
|
||||
The READMEs for the [CLI](https://openapi-generator.tech/docs/usage#generate), [Gradle Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin), [Maven Plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin), and [SBT Plugin](https://github.com/OpenAPITools/sbt-openapi-generator/blob/master/README.md) may have top-level or tooling specific options which appear to duplicate 'config options' or 'global properties'. Each may also expose user-facing properties slightly differently from the other tools. This may occur due to:
|
||||
|
||||
* Conventions used by the underlying tooling
|
||||
* Limitations in underlying frameworks which define how properties must be declared
|
||||
|
||||
@@ -53,6 +53,7 @@ Code change should conform to the programming style guide of the respective lang
|
||||
- C++: https://google.github.io/styleguide/cppguide.html
|
||||
- C++ (Tizen): https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style
|
||||
- Clojure: https://github.com/bbatsov/clojure-style-guide
|
||||
- Crystal: https://crystal-lang.org/reference/conventions/coding_style.html
|
||||
- Dart: https://www.dartlang.org/guides/language/effective-dart/style
|
||||
- Elixir: https://github.com/christopheradams/elixir_style_guide
|
||||
- Eiffel: https://www.eiffel.org/doc/eiffel/Coding%20Standards
|
||||
|
||||
@@ -188,7 +188,7 @@ The default is generate *everything* supported by the specific library. Once you
|
||||
To control the specific files being generated, you can pass a CSV list of what you want:
|
||||
```sh
|
||||
# generate the User and Pet models only
|
||||
--global-property models="User,Pet"
|
||||
--global-property models="User:Pet"
|
||||
|
||||
# generate the User model and the supportingFile `StringUtil.java`:
|
||||
--global-property models=User,supportingFiles=StringUtil.java
|
||||
@@ -205,7 +205,7 @@ These options default to true and don't limit the generation of the feature opti
|
||||
--global-property models,modelDocs=false
|
||||
|
||||
# generate only User and Pet models (no tests and no documentation)
|
||||
--global-property models="User,Pet",modelTests=false
|
||||
--global-property models="User:Pet",modelTests=false
|
||||
|
||||
# generate only apis (without tests)
|
||||
--global-property apis,apiTests=false
|
||||
|
||||
@@ -16,6 +16,7 @@ The following generators are available:
|
||||
* [cpp-restsdk](generators/cpp-restsdk.md)
|
||||
* [cpp-tizen](generators/cpp-tizen.md)
|
||||
* [cpp-ue4 (beta)](generators/cpp-ue4.md)
|
||||
* [crystal (beta)](generators/crystal.md)
|
||||
* [csharp](generators/csharp.md)
|
||||
* [csharp-dotnet2 (deprecated)](generators/csharp-dotnet2.md)
|
||||
* [csharp-netcore](generators/csharp-netcore.md)
|
||||
@@ -68,6 +69,7 @@ The following generators are available:
|
||||
* [typescript-fetch](generators/typescript-fetch.md)
|
||||
* [typescript-inversify](generators/typescript-inversify.md)
|
||||
* [typescript-jquery](generators/typescript-jquery.md)
|
||||
* [typescript-nestjs (experimental)](generators/typescript-nestjs.md)
|
||||
* [typescript-node](generators/typescript-node.md)
|
||||
* [typescript-redux-query](generators/typescript-redux-query.md)
|
||||
* [typescript-rxjs](generators/typescript-rxjs.md)
|
||||
@@ -92,7 +94,7 @@ The following generators are available:
|
||||
* [java-pkmst](generators/java-pkmst.md)
|
||||
* [java-play-framework](generators/java-play-framework.md)
|
||||
* [java-undertow-server](generators/java-undertow-server.md)
|
||||
* [java-vertx](generators/java-vertx.md)
|
||||
* [java-vertx (deprecated)](generators/java-vertx.md)
|
||||
* [java-vertx-web (beta)](generators/java-vertx-web.md)
|
||||
* [jaxrs-cxf](generators/jaxrs-cxf.md)
|
||||
* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md)
|
||||
@@ -141,6 +143,7 @@ The following generators are available:
|
||||
## SCHEMA generators
|
||||
* [avro-schema (beta)](generators/avro-schema.md)
|
||||
* [graphql-schema](generators/graphql-schema.md)
|
||||
* [ktorm-schema (beta)](generators/ktorm-schema.md)
|
||||
* [mysql-schema](generators/mysql-schema.md)
|
||||
* [protobuf-schema (beta)](generators/protobuf-schema.md)
|
||||
|
||||
|
||||
@@ -56,41 +56,109 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>_noreturn</li>
|
||||
<li>_static_assert</li>
|
||||
<li>_thread_local</li>
|
||||
<li>alignas</li>
|
||||
<li>alignof</li>
|
||||
<li>and</li>
|
||||
<li>and_eq</li>
|
||||
<li>asm</li>
|
||||
<li>atomic_cancel</li>
|
||||
<li>atomic_commit</li>
|
||||
<li>atomic_noexcept</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>char8_t</li>
|
||||
<li>class</li>
|
||||
<li>co_await</li>
|
||||
<li>co_return</li>
|
||||
<li>co_yield</li>
|
||||
<li>compl</li>
|
||||
<li>concept</li>
|
||||
<li>const</li>
|
||||
<li>const_cast</li>
|
||||
<li>consteval</li>
|
||||
<li>constexpr</li>
|
||||
<li>constinit</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>final</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>friend</li>
|
||||
<li>goto</li>
|
||||
<li>if</li>
|
||||
<li>inline</li>
|
||||
<li>int</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>override</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>reflexpr</li>
|
||||
<li>register</li>
|
||||
<li>reinterpret_cast</li>
|
||||
<li>remove</li>
|
||||
<li>requires</li>
|
||||
<li>restrict</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>synchronized</li>
|
||||
<li>template</li>
|
||||
<li>this</li>
|
||||
<li>thread_local</li>
|
||||
<li>throw</li>
|
||||
<li>transaction_safe</li>
|
||||
<li>transaction_safe_dynamic</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
|
||||
|
||||
@@ -232,10 +232,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✗|OAS2,OAS3
|
||||
|ApiKey|✗|OAS2,OAS3
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✗|OAS2,OAS3
|
||||
|OAuth2_Password|✗|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|
||||
226
docs/generators/crystal.md
Normal file
226
docs/generators/crystal.md
Normal file
@@ -0,0 +1,226 @@
|
||||
---
|
||||
title: Config Options for crystal
|
||||
sidebar_label: crystal
|
||||
---
|
||||
|
||||
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 |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|shardAuthor|shard author (only one is supported).| |null|
|
||||
|shardAuthorEmail|shard author email (only one is supported).| |null|
|
||||
|shardDescription|shard description.| |This shard maps to a REST API|
|
||||
|shardHomepage|shard homepage.| |http://org.openapitools|
|
||||
|shardLicense|shard license.| |unlicense|
|
||||
|shardName|shard name (e.g. twitter_client| |openapi_client|
|
||||
|shardVersion|shard version.| |1.0.0|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|Array|
|
||||
|map|Hash|
|
||||
|set|Set|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Array</li>
|
||||
<li>Boolean</li>
|
||||
<li>Date</li>
|
||||
<li>File</li>
|
||||
<li>Float</li>
|
||||
<li>Hash</li>
|
||||
<li>Integer</li>
|
||||
<li>Object</li>
|
||||
<li>String</li>
|
||||
<li>Time</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abstract</li>
|
||||
<li>alias</li>
|
||||
<li>as</li>
|
||||
<li>as?</li>
|
||||
<li>asm</li>
|
||||
<li>begin</li>
|
||||
<li>break</li>
|
||||
<li>case</li>
|
||||
<li>class</li>
|
||||
<li>def</li>
|
||||
<li>do</li>
|
||||
<li>else</li>
|
||||
<li>elsif</li>
|
||||
<li>end</li>
|
||||
<li>ensure</li>
|
||||
<li>enum</li>
|
||||
<li>extend</li>
|
||||
<li>false</li>
|
||||
<li>for</li>
|
||||
<li>fun</li>
|
||||
<li>if</li>
|
||||
<li>in</li>
|
||||
<li>include</li>
|
||||
<li>instance</li>
|
||||
<li>is_a?</li>
|
||||
<li>lib</li>
|
||||
<li>macro</li>
|
||||
<li>module</li>
|
||||
<li>next</li>
|
||||
<li>nil</li>
|
||||
<li>nil?</li>
|
||||
<li>of</li>
|
||||
<li>out</li>
|
||||
<li>pointerof</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>require</li>
|
||||
<li>rescue</li>
|
||||
<li>responds_to?</li>
|
||||
<li>return</li>
|
||||
<li>select</li>
|
||||
<li>self</li>
|
||||
<li>sizeof</li>
|
||||
<li>struct</li>
|
||||
<li>super</li>
|
||||
<li>then</li>
|
||||
<li>true</li>
|
||||
<li>type</li>
|
||||
<li>typeof</li>
|
||||
<li>uninitialized</li>
|
||||
<li>union</li>
|
||||
<li>unless</li>
|
||||
<li>until</li>
|
||||
<li>verbatim</li>
|
||||
<li>when</li>
|
||||
<li>while</li>
|
||||
<li>with</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
|
||||
|Array|✓|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
|
||||
|
||||
### 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
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✓|OAS2,OAS3
|
||||
@@ -28,10 +28,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|targetFramework|The target .NET framework version.|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dt>**netcoreapp2.1**</dt><dd>.NET Core 2.1 compatible</dd><dt>**netcoreapp3.0**</dt><dd>.NET Core 3.0 compatible</dd><dt>**netcoreapp3.1**</dt><dd>.NET Core 3.1 compatible</dd><dt>**net47**</dt><dd>.NET Framework 4.7 compatible</dd></dl>|netstandard2.0|
|
||||
|targetFramework|The target .NET framework version.|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3 compatible</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4 compatible</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5 compatible</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6 compatible</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0 compatible</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1 compatible</dd><dt>**netcoreapp2.0**</dt><dd>.NET Core 2.0 compatible</dd><dt>**netcoreapp2.1**</dt><dd>.NET Core 2.1 compatible</dd><dt>**netcoreapp3.0**</dt><dd>.NET Core 3.0 compatible</dd><dt>**netcoreapp3.1**</dt><dd>.NET Core 3.1 compatible</dd><dt>**net47**</dt><dd>.NET Framework 4.7 compatible</dd><dt>**net5.0**</dt><dd>.NET 5.0 compatible</dd></dl>|netstandard2.0|
|
||||
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|
||||
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
|
||||
|validatable|Generates self-validatable models.| |true|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -41,8 +41,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|List|
|
||||
|map|Map|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
@@ -36,8 +36,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|List|
|
||||
|map|Map|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
@@ -34,8 +34,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|List|
|
||||
|map|Map|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>Atom</li>
|
||||
<li>Boolean</li>
|
||||
<li>DateTime</li>
|
||||
<li>Decimal</li>
|
||||
<li>Float</li>
|
||||
<li>Integer</li>
|
||||
<li>List</li>
|
||||
@@ -43,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>PID</li>
|
||||
<li>String</li>
|
||||
<li>Tuple</li>
|
||||
<li>map()</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
@@ -16,7 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|packageVersion|Go package version.| |1.0.0|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|invokerPackage|root package for generated code| |org.openapitools.client|
|
||||
|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd></dl>|true|
|
||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 1.x. JSON processing: Jackson 2.9.x</dd></dl>|okhttp-gson|
|
||||
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 1.x. JSON processing: Jackson 2.9.x</dd></dl>|okhttp-gson|
|
||||
|licenseName|The name of the license| |Unlicense|
|
||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
||||
@@ -57,7 +57,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src/main/java|
|
||||
|supportJava6|Whether to support Java6 with the Jersey1 library. This option has been deprecated and will be removed in the 5.x release| |false|
|
||||
|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate library| |false|
|
||||
|useBeanValidation|Use BeanValidation API annotations| |false|
|
||||
|useGzipFeature|Send gzip-encoded requests| |false|
|
||||
|
||||
@@ -32,8 +32,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|BigDecimal|java.math.BigDecimal|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|java.time.LocalDateTime|
|
||||
|Date|java.time.LocalDate|
|
||||
|DateTime|java.time.OffsetDateTime|
|
||||
|File|java.io.File|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|
||||
@@ -26,8 +26,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|BigDecimal|java.math.BigDecimal|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|java.time.LocalDateTime|
|
||||
|Date|java.time.LocalDate|
|
||||
|DateTime|java.time.OffsetDateTime|
|
||||
|File|java.io.File|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|
||||
@@ -34,8 +34,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|BigDecimal|java.math.BigDecimal|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|java.time.LocalDateTime|
|
||||
|Date|java.time.LocalDate|
|
||||
|DateTime|java.time.OffsetDateTime|
|
||||
|File|java.io.File|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|
||||
355
docs/generators/ktorm-schema.md
Normal file
355
docs/generators/ktorm-schema.md
Normal file
@@ -0,0 +1,355 @@
|
||||
---
|
||||
title: Config Options for ktorm-schema
|
||||
sidebar_label: ktorm-schema
|
||||
---
|
||||
|
||||
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 |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|addSurrogateKey|Adds the surrogate key for all models that don't already have a primary key (named by the above convention)| |false|
|
||||
|artifactId|Generated artifact id (name of jar).| |ktorm|
|
||||
|artifactVersion|Generated artifact's package version.| |1.0.0|
|
||||
|defaultDatabaseName|Default database name for all queries| |sqlite.db|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|
||||
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|
||||
|identifierNamingConvention|Naming convention of Ktorm identifiers(table names and column names). This is not related to database name which is defined by defaultDatabaseName option|<dl><dt>**original**</dt><dd>Do not transform original names</dd><dt>**snake_case**</dt><dd>Use snake_case names</dd></dl>|original|
|
||||
|importModelPackageName|Package name of the imported models| |org.openapitools.database.models|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|packageName|Generated artifact package name.| |org.openapitools.database|
|
||||
|primaryKeyConvention|Primary key naming convention| |id|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
||||
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|BigDecimal|java.math.BigDecimal|
|
||||
|Date|java.time.LocalDate|
|
||||
|DateTime|java.time.OffsetDateTime|
|
||||
|File|java.io.File|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|LocalTime|java.time.LocalTime|
|
||||
|Timestamp|java.sql.Timestamp|
|
||||
|URI|java.net.URI|
|
||||
|UUID|java.util.UUID|
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|kotlin.collections.ArrayList|
|
||||
|list|kotlin.collections.ArrayList|
|
||||
|map|kotlin.collections.HashMap|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>kotlin.Array</li>
|
||||
<li>kotlin.Boolean</li>
|
||||
<li>kotlin.Byte</li>
|
||||
<li>kotlin.ByteArray</li>
|
||||
<li>kotlin.Char</li>
|
||||
<li>kotlin.Double</li>
|
||||
<li>kotlin.Float</li>
|
||||
<li>kotlin.Int</li>
|
||||
<li>kotlin.Long</li>
|
||||
<li>kotlin.Short</li>
|
||||
<li>kotlin.String</li>
|
||||
<li>kotlin.collections.List</li>
|
||||
<li>kotlin.collections.Map</li>
|
||||
<li>kotlin.collections.Set</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abort</li>
|
||||
<li>action</li>
|
||||
<li>add</li>
|
||||
<li>after</li>
|
||||
<li>all</li>
|
||||
<li>alter</li>
|
||||
<li>always</li>
|
||||
<li>analyze</li>
|
||||
<li>and</li>
|
||||
<li>any</li>
|
||||
<li>as</li>
|
||||
<li>asc</li>
|
||||
<li>attach</li>
|
||||
<li>autoincr</li>
|
||||
<li>autoincrement</li>
|
||||
<li>before</li>
|
||||
<li>begin</li>
|
||||
<li>between</li>
|
||||
<li>bitand</li>
|
||||
<li>bitnot</li>
|
||||
<li>bitor</li>
|
||||
<li>blob</li>
|
||||
<li>by</li>
|
||||
<li>cascade</li>
|
||||
<li>case</li>
|
||||
<li>cast</li>
|
||||
<li>check</li>
|
||||
<li>collate</li>
|
||||
<li>column</li>
|
||||
<li>comma</li>
|
||||
<li>commit</li>
|
||||
<li>concat</li>
|
||||
<li>conflict</li>
|
||||
<li>constraint</li>
|
||||
<li>create</li>
|
||||
<li>cross</li>
|
||||
<li>current</li>
|
||||
<li>current_date</li>
|
||||
<li>current_time</li>
|
||||
<li>current_timestamp</li>
|
||||
<li>database</li>
|
||||
<li>default</li>
|
||||
<li>deferrable</li>
|
||||
<li>deferred</li>
|
||||
<li>delete</li>
|
||||
<li>desc</li>
|
||||
<li>detach</li>
|
||||
<li>distinct</li>
|
||||
<li>do</li>
|
||||
<li>dot</li>
|
||||
<li>drop</li>
|
||||
<li>each</li>
|
||||
<li>else</li>
|
||||
<li>end</li>
|
||||
<li>eq</li>
|
||||
<li>escape</li>
|
||||
<li>except</li>
|
||||
<li>exclude</li>
|
||||
<li>exclusive</li>
|
||||
<li>exists</li>
|
||||
<li>explain</li>
|
||||
<li>fail</li>
|
||||
<li>filter</li>
|
||||
<li>first</li>
|
||||
<li>float</li>
|
||||
<li>following</li>
|
||||
<li>for</li>
|
||||
<li>foreign</li>
|
||||
<li>from</li>
|
||||
<li>full</li>
|
||||
<li>ge</li>
|
||||
<li>generated</li>
|
||||
<li>glob</li>
|
||||
<li>group</li>
|
||||
<li>groups</li>
|
||||
<li>gt</li>
|
||||
<li>having</li>
|
||||
<li>id</li>
|
||||
<li>if</li>
|
||||
<li>ignore</li>
|
||||
<li>immediate</li>
|
||||
<li>in</li>
|
||||
<li>index</li>
|
||||
<li>indexed</li>
|
||||
<li>initially</li>
|
||||
<li>inner</li>
|
||||
<li>insert</li>
|
||||
<li>instead</li>
|
||||
<li>integer</li>
|
||||
<li>intersect</li>
|
||||
<li>into</li>
|
||||
<li>is</li>
|
||||
<li>isnull</li>
|
||||
<li>join</li>
|
||||
<li>key</li>
|
||||
<li>last</li>
|
||||
<li>le</li>
|
||||
<li>left</li>
|
||||
<li>like</li>
|
||||
<li>limit</li>
|
||||
<li>lp</li>
|
||||
<li>lshift</li>
|
||||
<li>lt</li>
|
||||
<li>match</li>
|
||||
<li>minus</li>
|
||||
<li>natural</li>
|
||||
<li>ne</li>
|
||||
<li>no</li>
|
||||
<li>not</li>
|
||||
<li>nothing</li>
|
||||
<li>notnull</li>
|
||||
<li>null</li>
|
||||
<li>nulls</li>
|
||||
<li>of</li>
|
||||
<li>offset</li>
|
||||
<li>on</li>
|
||||
<li>or</li>
|
||||
<li>order</li>
|
||||
<li>others</li>
|
||||
<li>outer</li>
|
||||
<li>over</li>
|
||||
<li>partition</li>
|
||||
<li>plan</li>
|
||||
<li>plus</li>
|
||||
<li>pragma</li>
|
||||
<li>preceding</li>
|
||||
<li>primary</li>
|
||||
<li>query</li>
|
||||
<li>raise</li>
|
||||
<li>range</li>
|
||||
<li>recursive</li>
|
||||
<li>references</li>
|
||||
<li>regexp</li>
|
||||
<li>reindex</li>
|
||||
<li>release</li>
|
||||
<li>rem</li>
|
||||
<li>rename</li>
|
||||
<li>replace</li>
|
||||
<li>restrict</li>
|
||||
<li>right</li>
|
||||
<li>rollback</li>
|
||||
<li>row</li>
|
||||
<li>rows</li>
|
||||
<li>rp</li>
|
||||
<li>rshift</li>
|
||||
<li>savepoint</li>
|
||||
<li>select</li>
|
||||
<li>set</li>
|
||||
<li>slash</li>
|
||||
<li>star</li>
|
||||
<li>string</li>
|
||||
<li>table</li>
|
||||
<li>temp</li>
|
||||
<li>temporary</li>
|
||||
<li>then</li>
|
||||
<li>ties</li>
|
||||
<li>to</li>
|
||||
<li>transaction</li>
|
||||
<li>trigger</li>
|
||||
<li>unbounded</li>
|
||||
<li>union</li>
|
||||
<li>unique</li>
|
||||
<li>update</li>
|
||||
<li>using</li>
|
||||
<li>vacuum</li>
|
||||
<li>values</li>
|
||||
<li>variable</li>
|
||||
<li>view</li>
|
||||
<li>virtual</li>
|
||||
<li>when</li>
|
||||
<li>where</li>
|
||||
<li>window</li>
|
||||
<li>with</li>
|
||||
<li>without</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
|
||||
|Array|✓|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
|
||||
|
||||
### 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
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✗|OAS2,OAS3
|
||||
|XML|✗|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✗|OAS2,OAS3
|
||||
@@ -19,8 +19,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|powershellGalleryUrl|URL to the module in PowerShell Gallery (e.g. https://www.powershellgallery.com/packages/PSTwitter/).| |null|
|
||||
|projectUri|A URL to the main website for this project| |null|
|
||||
|releaseNotes|Release notes of the generated PowerShell module| |null|
|
||||
|skipVerbParsing|Set skipVerbParsing to not try get powershell verbs of operation names| |null|
|
||||
|tags|Tags applied to the generated PowerShell module. These help with module discovery in online galleries| |null|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |null|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |null|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|defaultController|default controller| |default_controller|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|featureCORS|use flask-cors for handling CORS requests| |false|
|
||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|packageName|python package name (convention: snake_case).| |openapi_server|
|
||||
|packageVersion|python package version.| |1.0.0|
|
||||
|
||||
@@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|defaultController|default controller| |default_controller|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|featureCORS|use flask-cors for handling CORS requests| |false|
|
||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|packageName|python package name (convention: snake_case).| |openapi_server|
|
||||
|packageVersion|python package version.| |1.0.0|
|
||||
|
||||
@@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|defaultController|default controller| |default_controller|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|featureCORS|use flask-cors for handling CORS requests| |false|
|
||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|packageName|python package name (convention: snake_case).| |openapi_server|
|
||||
|packageVersion|python package version.| |1.0.0|
|
||||
|
||||
@@ -186,7 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✗|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✗|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|
||||
@@ -196,7 +196,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||
|OAuth2_Password|✗|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|
||||
@@ -25,7 +25,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|
||||
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).| |false|
|
||||
|providedIn|Use this property to provide Injectables in wanted level (it is only valid in angular version greater or equal to 9.0.0).|<dl><dt>**root**</dt><dd>The application-level injector in most apps.</dd><dt>**none**</dt><dd>No providedIn (same as providedInRoot=false)</dd><dt>**any**</dt><dd>Provides a unique instance in each lazy loaded module while all eagerly loaded modules share one instance.</dd><dt>**platform**</dt><dd>A special singleton platform injector shared by all applications on the page.</dd></dl>|root|
|
||||
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0). IMPORTANT: Deprecated for angular version greater or equal to 9.0.0, use **providedIn** instead.| |false|
|
||||
|queryParamObjectFormat|The format for query param objects: 'dot', 'json', 'key'.| |dot|
|
||||
|serviceFileSuffix|The suffix of the file of the generated service (service<suffix>.ts).| |.service|
|
||||
|serviceSuffix|The suffix of the generated service.| |Service|
|
||||
|
||||
254
docs/generators/typescript-nestjs.md
Normal file
254
docs/generators/typescript-nestjs.md
Normal file
@@ -0,0 +1,254 @@
|
||||
---
|
||||
title: Config Options for typescript-nestjs
|
||||
sidebar_label: typescript-nestjs
|
||||
---
|
||||
|
||||
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 |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase|
|
||||
|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase|
|
||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null|
|
||||
|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|
|
||||
|nestVersion|The version of Nestjs.| |6.0.0|
|
||||
|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|
|
||||
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|
||||
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|serviceFileSuffix|The suffix of the file of the generated service (service<suffix>.ts).| |.service|
|
||||
|serviceSuffix|The suffix of the generated service.| |Service|
|
||||
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|stringEnums|Generate string enums instead of objects for enum values.| |false|
|
||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
|
||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|Array|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Array</li>
|
||||
<li>Blob</li>
|
||||
<li>Boolean</li>
|
||||
<li>Date</li>
|
||||
<li>Double</li>
|
||||
<li>Error</li>
|
||||
<li>File</li>
|
||||
<li>Float</li>
|
||||
<li>Integer</li>
|
||||
<li>Long</li>
|
||||
<li>Map</li>
|
||||
<li>Object</li>
|
||||
<li>ReadonlyArray</li>
|
||||
<li>Set</li>
|
||||
<li>String</li>
|
||||
<li>any</li>
|
||||
<li>boolean</li>
|
||||
<li>number</li>
|
||||
<li>object</li>
|
||||
<li>string</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abstract</li>
|
||||
<li>await</li>
|
||||
<li>boolean</li>
|
||||
<li>break</li>
|
||||
<li>byte</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>char</li>
|
||||
<li>class</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>debugger</li>
|
||||
<li>default</li>
|
||||
<li>delete</li>
|
||||
<li>do</li>
|
||||
<li>double</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>export</li>
|
||||
<li>extends</li>
|
||||
<li>false</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>formParams</li>
|
||||
<li>function</li>
|
||||
<li>goto</li>
|
||||
<li>headerParams</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>import</li>
|
||||
<li>in</li>
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>let</li>
|
||||
<li>long</li>
|
||||
<li>native</li>
|
||||
<li>new</li>
|
||||
<li>null</li>
|
||||
<li>package</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>queryParameters</li>
|
||||
<li>requestOptions</li>
|
||||
<li>return</li>
|
||||
<li>short</li>
|
||||
<li>static</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>synchronized</li>
|
||||
<li>this</li>
|
||||
<li>throw</li>
|
||||
<li>transient</li>
|
||||
<li>true</li>
|
||||
<li>try</li>
|
||||
<li>typeof</li>
|
||||
<li>useFormData</li>
|
||||
<li>var</li>
|
||||
<li>varLocalDeferred</li>
|
||||
<li>varLocalPath</li>
|
||||
<li>void</li>
|
||||
<li>volatile</li>
|
||||
<li>while</li>
|
||||
<li>with</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
|
||||
|Array|✓|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
|
||||
|
||||
### 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
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✗|OAS2,OAS3
|
||||
@@ -15,7 +15,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<version>5.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -76,7 +76,7 @@ buildscript {
|
||||
maven { url "https://repo1.maven.org/maven2" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,9 +111,6 @@ openApiGenerate {
|
||||
apiPackage = "org.openapi.example.api"
|
||||
invokerPackage = "org.openapi.example.invoker"
|
||||
modelPackage = "org.openapi.example.model"
|
||||
modelFilesConstrainedTo = [
|
||||
"Error"
|
||||
]
|
||||
configOptions = [
|
||||
dateLibrary: "java8"
|
||||
]
|
||||
|
||||
@@ -59,7 +59,7 @@ Short term are focused on improving contributor and user productivity (part of t
|
||||
* SPI plugins
|
||||
* Templating engine
|
||||
* Language extensions
|
||||
* Custom extensions (e.g. allowing users to load support for https://github.com/Azure/azure-rest-api-specs[azure-rest-api-specs])
|
||||
* Custom extensions (e.g. allowing users to load support for [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs))
|
||||
* Customizable templating engines (handlebars support)
|
||||
* Unit-testing templates (to previously mentioned explicit type as an interface to the template)
|
||||
* Reduce coupling
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -469,9 +469,6 @@ openApiGenerate {
|
||||
apiPackage = "org.openapi.example.api"
|
||||
invokerPackage = "org.openapi.example.invoker"
|
||||
modelPackage = "org.openapi.example.model"
|
||||
modelFilesConstrainedTo = [
|
||||
"Error"
|
||||
]
|
||||
configOptions = [
|
||||
dateLibrary: "java8"
|
||||
]
|
||||
@@ -554,7 +551,7 @@ BUILD SUCCESSFUL in 0s
|
||||
|
||||
=== openApiValidate
|
||||
|
||||
.in buid.gradle
|
||||
.in build.gradle
|
||||
[source,groovy]
|
||||
----
|
||||
openApiValidate {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=5.0.0
|
||||
openApiGeneratorVersion=5.0.1
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
33
modules/openapi-generator-gradle-plugin/gradlew
vendored
33
modules/openapi-generator-gradle-plugin/gradlew
vendored
@@ -44,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@@ -82,6 +82,7 @@ esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
@@ -129,6 +130,7 @@ fi
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
@@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -175,14 +177,9 @@ save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
189
modules/openapi-generator-gradle-plugin/gradlew.bat
vendored
189
modules/openapi-generator-gradle-plugin/gradlew.bat
vendored
@@ -1,100 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=5.0.0-SNAPSHOT
|
||||
openApiGeneratorVersion=5.0.1-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.0.0</version>
|
||||
<version>5.0.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -226,7 +226,7 @@ public class CodegenConstants {
|
||||
public static final String API_NAME_PREFIX_DESC = "Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.";
|
||||
|
||||
public static final String API_NAME_SUFFIX = "apiNameSuffix";
|
||||
public static final String API_NAME_SUFFIX_DESC = "Suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi. Note: Only ruby, python, jaxrs generators suppport this feature at the moment.";
|
||||
public static final String API_NAME_SUFFIX_DESC = "Suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi. Note: Only ruby, python, jaxrs generators support this feature at the moment.";
|
||||
|
||||
public static final String MODEL_NAME_PREFIX = "modelNamePrefix";
|
||||
public static final String MODEL_NAME_PREFIX_DESC = "Prefix that will be prepended to all model names.";
|
||||
@@ -367,5 +367,5 @@ public class CodegenConstants {
|
||||
"If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " +
|
||||
"If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.";
|
||||
public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP = "useOneOfDiscriminatorLookup";
|
||||
public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.";
|
||||
public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.";
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties
|
||||
|
||||
public Set<String> imports = new TreeSet<String>();
|
||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum;
|
||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation;
|
||||
/**
|
||||
* Indicates the OAS schema specifies "nullable: true".
|
||||
*/
|
||||
@@ -95,6 +95,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
public boolean isArray;
|
||||
public boolean hasChildren;
|
||||
public boolean isMap;
|
||||
public boolean isNull;
|
||||
/**
|
||||
* Indicates the OAS schema specifies "deprecated: true".
|
||||
*/
|
||||
@@ -611,12 +612,11 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
this.additionalProperties = additionalProperties;
|
||||
}
|
||||
|
||||
// indicates if the model component has validation on the root level schema
|
||||
// this will be true when minItems or minProperties is set
|
||||
public boolean hasValidation() {
|
||||
boolean val = (maxItems != null || minItems != null || minProperties != null || maxProperties != null || minLength != null || maxLength != null || multipleOf != null || pattern != null || minimum != null || maximum != null || Boolean.TRUE.equals(uniqueItems) || Boolean.TRUE.equals(exclusiveMaximum) || Boolean.TRUE.equals(exclusiveMinimum));
|
||||
return val;
|
||||
}
|
||||
@Override
|
||||
public boolean getHasValidation() { return hasValidation; }
|
||||
|
||||
@Override
|
||||
public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; }
|
||||
|
||||
public List<CodegenProperty> getReadOnlyVars() {
|
||||
return readOnlyVars;
|
||||
@@ -702,6 +702,16 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
this.xmlPrefix = xmlPrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsNull() {
|
||||
return isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsNull(boolean isNull) {
|
||||
this.isNull = isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
@@ -730,6 +740,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
isMap == that.isMap &&
|
||||
isDeprecated == that.isDeprecated &&
|
||||
hasOnlyReadOnly == that.hasOnlyReadOnly &&
|
||||
isNull == that.isNull &&
|
||||
hasValidation == that.hasValidation &&
|
||||
getUniqueItems() == that.getUniqueItems() &&
|
||||
getExclusiveMinimum() == that.getExclusiveMinimum() &&
|
||||
getExclusiveMaximum() == that.getExclusiveMaximum() &&
|
||||
@@ -794,7 +806,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
getDescription(), getClassVarName(), getModelJson(), getDataType(), getXmlPrefix(), getXmlNamespace(),
|
||||
getXmlName(), getClassFilename(), getUnescapedDescription(), getDiscriminator(), getDefaultValue(),
|
||||
getArrayModelType(), isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble,
|
||||
isDate, isDateTime,
|
||||
isDate, isDateTime, isNull, hasValidation,
|
||||
getVars(), getAllVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(),
|
||||
getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars,
|
||||
isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray,
|
||||
@@ -885,6 +897,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
sb.append(", items='").append(items).append('\'');
|
||||
sb.append(", additionalProperties='").append(additionalProperties).append('\'');
|
||||
sb.append(", isModel='").append(isModel).append('\'');
|
||||
sb.append(", isNull='").append(isNull);
|
||||
sb.append(", hasValidation='").append(hasValidation);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public Number multipleOf;
|
||||
private Integer maxProperties;
|
||||
private Integer minProperties;
|
||||
public boolean isNull;
|
||||
|
||||
public CodegenParameter copy() {
|
||||
CodegenParameter output = new CodegenParameter();
|
||||
@@ -147,6 +148,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
output.minimum = this.minimum;
|
||||
output.pattern = this.pattern;
|
||||
output.additionalProperties = this.additionalProperties;
|
||||
output.isNull = this.isNull;
|
||||
|
||||
if (this._enum != null) {
|
||||
output._enum = new ArrayList<String>(this._enum);
|
||||
@@ -200,7 +202,7 @@ 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, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf);
|
||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -244,6 +246,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
hasValidation == that.hasValidation &&
|
||||
isNullable == that.isNullable &&
|
||||
required == that.required &&
|
||||
isNull == that.isNull &&
|
||||
getExclusiveMaximum() == that.getExclusiveMaximum() &&
|
||||
getExclusiveMinimum() == that.getExclusiveMinimum() &&
|
||||
getUniqueItems() == that.getUniqueItems() &&
|
||||
@@ -357,6 +360,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
sb.append(", uniqueItems=").append(uniqueItems);
|
||||
sb.append(", contentType=").append(contentType);
|
||||
sb.append(", multipleOf=").append(multipleOf);
|
||||
sb.append(", isNull=").append(isNull);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -568,5 +572,21 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public void setRequiredVars(List<CodegenProperty> requiredVars) {
|
||||
this.requiredVars = requiredVars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsNull() {
|
||||
return isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsNull(boolean isNull) {
|
||||
this.isNull = isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasValidation() { return hasValidation; }
|
||||
|
||||
@Override
|
||||
public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; }
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
public boolean isUuid;
|
||||
public boolean isUri;
|
||||
public boolean isEmail;
|
||||
public boolean isNull;
|
||||
/**
|
||||
* The type is a free-form object, i.e. it is a map of string to values with no declared properties.
|
||||
* A OAS free-form schema may include the 'additionalProperties' attribute, which puts a constraint
|
||||
@@ -676,6 +677,22 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
this.requiredVars = requiredVars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsNull() {
|
||||
return isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsNull(boolean isNull) {
|
||||
this.isNull = isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasValidation() { return hasValidation; }
|
||||
|
||||
@Override
|
||||
public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("CodegenProperty{");
|
||||
@@ -764,6 +781,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
sb.append(", xmlName='").append(xmlName).append('\'');
|
||||
sb.append(", xmlNamespace='").append(xmlNamespace).append('\'');
|
||||
sb.append(", isXmlWrapped=").append(isXmlWrapped);
|
||||
sb.append(", isNull=").append(isNull);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -812,6 +830,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
isInherited == that.isInherited &&
|
||||
isXmlAttribute == that.isXmlAttribute &&
|
||||
isXmlWrapped == that.isXmlWrapped &&
|
||||
isNull == that.isNull &&
|
||||
Objects.equals(openApiType, that.openApiType) &&
|
||||
Objects.equals(baseName, that.baseName) &&
|
||||
Objects.equals(complexType, that.complexType) &&
|
||||
@@ -873,6 +892,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
items, mostInnerItems, additionalProperties, vars, requiredVars,
|
||||
vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,
|
||||
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName,
|
||||
xmlNamespace, isXmlWrapped);
|
||||
xmlNamespace, isXmlWrapped, isNull);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
public boolean isArray;
|
||||
public boolean isBinary = false;
|
||||
public boolean isFile = false;
|
||||
public boolean isNull;
|
||||
public Object schema;
|
||||
public String jsonSchema;
|
||||
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
|
||||
@@ -77,6 +78,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
public CodegenProperty additionalProperties;
|
||||
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>(); // all properties (without parent's properties)
|
||||
public List<CodegenProperty> requiredVars = new ArrayList<CodegenProperty>();
|
||||
private boolean hasValidation;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@@ -84,7 +86,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate,
|
||||
isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType,
|
||||
isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties,
|
||||
vars, requiredVars,
|
||||
vars, requiredVars, isNull, hasValidation,
|
||||
getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(),
|
||||
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
|
||||
is1xx, is2xx, is3xx, is4xx, is5xx);
|
||||
@@ -122,6 +124,8 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
isFile == that.isFile &&
|
||||
items == that.items &&
|
||||
additionalProperties == that.additionalProperties &&
|
||||
isNull == that.isNull &&
|
||||
hasValidation == that.hasValidation &&
|
||||
is1xx == that.is1xx &&
|
||||
is2xx == that.is2xx &&
|
||||
is3xx == that.is3xx &&
|
||||
@@ -423,6 +427,8 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
sb.append(", additionalProperties='").append(additionalProperties).append('\'');
|
||||
sb.append(", vars='").append(vars).append('\'');
|
||||
sb.append(", requiredVars='").append(requiredVars).append('\'');
|
||||
sb.append(", isNull='").append(isNull);
|
||||
sb.append(", hasValidation='").append(hasValidation);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -443,4 +449,20 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsNull() {
|
||||
return isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsNull(boolean isNull) {
|
||||
this.isNull = isNull;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasValidation() { return hasValidation; }
|
||||
|
||||
@Override
|
||||
public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; }
|
||||
}
|
||||
|
||||
@@ -2258,6 +2258,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL);
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
|
||||
if (reservedWords.contains(name)) {
|
||||
m.name = escapeReservedWord(name);
|
||||
@@ -2305,7 +2306,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
m.setItems(arrayProperty.items);
|
||||
m.arrayModelType = arrayProperty.complexType;
|
||||
addParentContainer(m, name, schema);
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
} else if (ModelUtils.isNullType(schema)) {
|
||||
m.isNull = true;
|
||||
} else if (schema instanceof ComposedSchema) {
|
||||
final ComposedSchema composed = (ComposedSchema) schema;
|
||||
Map<String, Schema> properties = new LinkedHashMap<String, Schema>();
|
||||
@@ -2498,8 +2500,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
m.isMap = true;
|
||||
} else if (ModelUtils.isIntegerSchema(schema)) { // integer type
|
||||
// NOTE: Integral schemas as CodegenModel is a rare use case and may be removed at a later date.
|
||||
// Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty.
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
|
||||
m.isNumeric = Boolean.TRUE;
|
||||
if (ModelUtils.isLongSchema(schema)) { // int64/long format
|
||||
@@ -2509,23 +2509,15 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
} else if (ModelUtils.isDateTimeSchema(schema)) {
|
||||
// NOTE: DateTime schemas as CodegenModel is a rare use case and may be removed at a later date.
|
||||
// Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty.
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
m.isDateTime = Boolean.TRUE;
|
||||
} else if (ModelUtils.isDateSchema(schema)) {
|
||||
// NOTE: Date schemas as CodegenModel is a rare use case and may be removed at a later date.
|
||||
// Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty.
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
m.isDate = Boolean.TRUE;
|
||||
} else if (ModelUtils.isStringSchema(schema)) {
|
||||
// NOTE: String schemas as CodegenModel is a rare use case and may be removed at a later date.
|
||||
// Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty.
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
m.isString = Boolean.TRUE;
|
||||
} else if (ModelUtils.isNumberSchema(schema)) {
|
||||
// NOTE: Number schemas as CodegenModel is a rare use case and may be removed at a later date.
|
||||
// Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty.
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
m.isNumeric = Boolean.TRUE;
|
||||
if (ModelUtils.isFloatSchema(schema)) { // float
|
||||
m.isFloat = Boolean.TRUE;
|
||||
@@ -2536,7 +2528,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
} else if (ModelUtils.isFreeFormObject(openAPI, schema)) {
|
||||
addAdditionPropertiesToCodeGenModel(m, schema);
|
||||
ModelUtils.syncValidationProperties(schema, m);
|
||||
}
|
||||
|
||||
if (Boolean.TRUE.equals(schema.getNullable())) {
|
||||
@@ -3075,7 +3066,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
p = unaliasSchema(p, importMapping);
|
||||
|
||||
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
|
||||
|
||||
ModelUtils.syncValidationProperties(p, property);
|
||||
|
||||
property.name = toVarName(name);
|
||||
@@ -3142,27 +3132,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
property.isInteger = Boolean.TRUE;
|
||||
}
|
||||
|
||||
if (p.getMinimum() != null) {
|
||||
property.minimum = String.valueOf(p.getMinimum().longValue());
|
||||
}
|
||||
if (p.getMaximum() != null) {
|
||||
property.maximum = String.valueOf(p.getMaximum().longValue());
|
||||
}
|
||||
if (p.getExclusiveMinimum() != null) {
|
||||
property.exclusiveMinimum = p.getExclusiveMinimum();
|
||||
}
|
||||
if (p.getExclusiveMaximum() != null) {
|
||||
property.exclusiveMaximum = p.getExclusiveMaximum();
|
||||
}
|
||||
if (p.getMultipleOf() != null) {
|
||||
property.multipleOf = p.getMultipleOf();
|
||||
}
|
||||
|
||||
// check if any validation rule defined
|
||||
// exclusive* are noop without corresponding min/max
|
||||
if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null)
|
||||
property.hasValidation = true;
|
||||
|
||||
} else if (ModelUtils.isBooleanSchema(p)) { // boolean type
|
||||
property.isBoolean = true;
|
||||
property.getter = toBooleanGetter(name);
|
||||
@@ -3175,27 +3144,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
property.isDateTime = true;
|
||||
} else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number
|
||||
property.isDecimal = true;
|
||||
if (p.getMinimum() != null) {
|
||||
property.minimum = String.valueOf(p.getMinimum());
|
||||
}
|
||||
if (p.getMaximum() != null) {
|
||||
property.maximum = String.valueOf(p.getMaximum());
|
||||
}
|
||||
if (p.getExclusiveMinimum() != null) {
|
||||
property.exclusiveMinimum = p.getExclusiveMinimum();
|
||||
}
|
||||
if (p.getExclusiveMaximum() != null) {
|
||||
property.exclusiveMaximum = p.getExclusiveMaximum();
|
||||
}
|
||||
if (p.getMultipleOf() != null) {
|
||||
property.multipleOf = p.getMultipleOf();
|
||||
}
|
||||
|
||||
// check if any validation rule defined
|
||||
// exclusive* are noop without corresponding min/max
|
||||
if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null) {
|
||||
property.hasValidation = true;
|
||||
}
|
||||
} else if (ModelUtils.isStringSchema(p)) {
|
||||
if (ModelUtils.isByteArraySchema(p)) {
|
||||
property.isByteArray = true;
|
||||
@@ -3217,15 +3165,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else {
|
||||
property.isString = true;
|
||||
}
|
||||
|
||||
property.maxLength = p.getMaxLength();
|
||||
property.minLength = p.getMinLength();
|
||||
property.pattern = toRegularExpression(p.getPattern());
|
||||
|
||||
// check if any validation rule defined
|
||||
if (property.pattern != null || property.minLength != null || property.maxLength != null)
|
||||
property.hasValidation = true;
|
||||
|
||||
} else if (ModelUtils.isNumberSchema(p)) {
|
||||
property.isNumeric = Boolean.TRUE;
|
||||
if (ModelUtils.isFloatSchema(p)) { // float
|
||||
@@ -3236,28 +3177,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
property.isNumber = Boolean.TRUE;
|
||||
}
|
||||
|
||||
if (p.getMinimum() != null) {
|
||||
property.minimum = String.valueOf(p.getMinimum());
|
||||
}
|
||||
if (p.getMaximum() != null) {
|
||||
property.maximum = String.valueOf(p.getMaximum());
|
||||
}
|
||||
if (p.getExclusiveMinimum() != null) {
|
||||
property.exclusiveMinimum = p.getExclusiveMinimum();
|
||||
}
|
||||
if (p.getExclusiveMaximum() != null) {
|
||||
property.exclusiveMaximum = p.getExclusiveMaximum();
|
||||
}
|
||||
if (p.getMultipleOf() != null) {
|
||||
property.multipleOf = p.getMultipleOf();
|
||||
}
|
||||
|
||||
// check if any validation rule defined
|
||||
// exclusive* are noop without corresponding min/max
|
||||
if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null) {
|
||||
property.hasValidation = true;
|
||||
}
|
||||
|
||||
} else if (isFreeFormObject(p)) {
|
||||
property.isFreeFormObject = true;
|
||||
} else if (isAnyTypeSchema(p)) {
|
||||
@@ -3279,6 +3198,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
innerSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type");
|
||||
p.setAdditionalProperties(innerSchema);
|
||||
}
|
||||
} else if (ModelUtils.isNullType(p)) {
|
||||
property.isNull = true;
|
||||
}
|
||||
|
||||
//Inline enum case:
|
||||
@@ -3343,8 +3264,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
// handle inner property
|
||||
property.maxItems = p.getMaxItems();
|
||||
property.minItems = p.getMinItems();
|
||||
String itemName = null;
|
||||
if (p.getExtensions() != null && p.getExtensions().get("x-item-name") != null) {
|
||||
itemName = p.getExtensions().get("x-item-name").toString();
|
||||
@@ -3361,6 +3280,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
property.isMap = true;
|
||||
property.containerType = "map";
|
||||
property.baseType = getSchemaType(p);
|
||||
// TODO remove this hack in the future, code should use minProperties and maxProperties for object schemas
|
||||
property.minItems = p.getMinProperties();
|
||||
property.maxItems = p.getMaxProperties();
|
||||
|
||||
@@ -3979,20 +3899,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
public CodegenResponse fromResponse(String responseCode, ApiResponse response) {
|
||||
CodegenResponse r = CodegenModelFactory.newInstance(CodegenModelType.RESPONSE);
|
||||
|
||||
if (response.getContent() != null && response.getContent().size() > 0) {
|
||||
// Ensure validation properties from a target schema are persisted on CodegenResponse.
|
||||
// This ignores any edge case where different schemas have different validations because we don't
|
||||
// have a way to indicate a preference for response schema and are effective 1:1.
|
||||
Schema contentSchema = null;
|
||||
for (MediaType mt : response.getContent().values()) {
|
||||
if (contentSchema != null) break;
|
||||
contentSchema = mt.getSchema();
|
||||
}
|
||||
if (contentSchema != null) {
|
||||
ModelUtils.syncValidationProperties(contentSchema, r);
|
||||
}
|
||||
}
|
||||
|
||||
if ("default".equals(responseCode) || "defaultResponse".equals(responseCode)) {
|
||||
r.code = "0";
|
||||
r.isDefault = true;
|
||||
@@ -4026,8 +3932,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
responseSchema = ModelUtils.getSchemaFromResponse(response);
|
||||
}
|
||||
r.schema = responseSchema;
|
||||
if (responseSchema != null && responseSchema.getPattern() != null) {
|
||||
r.setPattern(toRegularExpression(responseSchema.getPattern()));
|
||||
if (responseSchema != null) {
|
||||
ModelUtils.syncValidationProperties(responseSchema, r);
|
||||
if (responseSchema.getPattern() != null) {
|
||||
r.setPattern(toRegularExpression(responseSchema.getPattern()));
|
||||
}
|
||||
}
|
||||
|
||||
r.message = escapeText(response.getDescription());
|
||||
@@ -4044,6 +3953,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (r.schema != null) {
|
||||
Map<String, Schema> allSchemas = null;
|
||||
CodegenProperty cp = fromProperty("response", responseSchema);
|
||||
r.isNull = cp.isNull;
|
||||
|
||||
if (ModelUtils.isArraySchema(responseSchema)) {
|
||||
ArraySchema as = (ArraySchema) responseSchema;
|
||||
@@ -4214,20 +4124,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
public CodegenParameter fromParameter(Parameter parameter, Set<String> imports) {
|
||||
CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER);
|
||||
|
||||
if (parameter.getContent() != null && parameter.getContent().size() > 0) {
|
||||
// Ensure validation properties from a target schema are persisted on CodegenParameter.
|
||||
// This ignores any edge case where different schemas have different validations because we don't
|
||||
// have a way to indicate a preference for parameter schema and are effective 1:1.
|
||||
Schema contentSchema = null;
|
||||
for (MediaType mt : parameter.getContent().values()) {
|
||||
if (contentSchema != null) break;
|
||||
contentSchema = mt.getSchema();
|
||||
}
|
||||
if (contentSchema != null) {
|
||||
ModelUtils.syncValidationProperties(contentSchema, codegenParameter);
|
||||
}
|
||||
}
|
||||
|
||||
codegenParameter.baseName = parameter.getName();
|
||||
codegenParameter.description = escapeText(parameter.getDescription());
|
||||
codegenParameter.unescapedDescription = parameter.getDescription();
|
||||
@@ -4266,6 +4162,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
LOGGER.warn("warning! Schema not found for parameter \"" + parameter.getName() + "\", using String");
|
||||
parameterSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to missing type definition.");
|
||||
}
|
||||
ModelUtils.syncValidationProperties(parameterSchema, codegenParameter);
|
||||
|
||||
if (Boolean.TRUE.equals(parameterSchema.getNullable())) { // use nullable defined in the spec
|
||||
codegenParameter.isNullable = true;
|
||||
@@ -4317,6 +4214,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
imports.add(codegenProperty.baseType);
|
||||
codegenProperty = codegenProperty.items;
|
||||
}
|
||||
} else if (ModelUtils.isNullType(parameterSchema)) {
|
||||
codegenParameter.isNull = true;
|
||||
}
|
||||
/* TODO revise the logic below
|
||||
} else {
|
||||
@@ -5458,7 +5357,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (var.defaultValue != null) {
|
||||
String enumName = null;
|
||||
final String enumDefaultValue;
|
||||
if ("string".equalsIgnoreCase(dataType)) {
|
||||
if (isDataTypeString(dataType)) {
|
||||
enumDefaultValue = toEnumValue(var.defaultValue, dataType);
|
||||
} else {
|
||||
enumDefaultValue = var.defaultValue;
|
||||
@@ -6022,9 +5921,10 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (StringUtils.isNotBlank(schema.get$ref())) {
|
||||
name = ModelUtils.getSimpleRef(schema.get$ref());
|
||||
}
|
||||
Schema validationSchema = unaliasSchema(schema, importMapping);
|
||||
schema = ModelUtils.getReferencedSchema(this.openAPI, schema);
|
||||
|
||||
ModelUtils.syncValidationProperties(schema, codegenParameter);
|
||||
ModelUtils.syncValidationProperties(validationSchema, codegenParameter);
|
||||
|
||||
if (ModelUtils.isMapSchema(schema)) {
|
||||
// Schema with additionalproperties: true (including composed schemas with additionalproperties: true)
|
||||
@@ -6146,17 +6046,12 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else {
|
||||
codegenParameter.baseName = bodyParameterName;
|
||||
}
|
||||
codegenParameter.isNull = codegenProperty.isNull;
|
||||
codegenParameter.isPrimitiveType = true;
|
||||
codegenParameter.baseType = codegenProperty.baseType;
|
||||
codegenParameter.dataType = codegenProperty.dataType;
|
||||
codegenParameter.description = codegenProperty.description;
|
||||
codegenParameter.paramName = toParamName(codegenParameter.baseName);
|
||||
codegenParameter.minimum = codegenProperty.minimum;
|
||||
codegenParameter.maximum = codegenProperty.maximum;
|
||||
codegenParameter.exclusiveMinimum = codegenProperty.exclusiveMinimum;
|
||||
codegenParameter.exclusiveMaximum = codegenProperty.exclusiveMaximum;
|
||||
codegenParameter.minLength = codegenProperty.minLength;
|
||||
codegenParameter.maxLength = codegenProperty.maxLength;
|
||||
codegenParameter.pattern = codegenProperty.pattern;
|
||||
codegenParameter.isNullable = codegenProperty.isNullable;
|
||||
|
||||
|
||||
@@ -266,9 +266,9 @@ public class DefaultGenerator implements Generator {
|
||||
// TODO: Allow user to define _which_ servers object in the array to target.
|
||||
// Configures contextPath/basePath according to api document's servers
|
||||
URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides());
|
||||
contextPath = config.escapeText(url.getPath()).replaceAll("/$", ""); // for backward compatibility
|
||||
contextPath = removeTrailingSlash(config.escapeText(url.getPath())); // for backward compatibility
|
||||
basePathWithoutHost = contextPath;
|
||||
basePath = config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides())).replaceAll("/$", "");
|
||||
basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides())));
|
||||
}
|
||||
|
||||
private void configureOpenAPIInfo() {
|
||||
@@ -552,7 +552,7 @@ public class DefaultGenerator implements Generator {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void generateApis(List<File> files, List<Object> allOperations, List<Object> allModels) {
|
||||
void generateApis(List<File> files, List<Object> allOperations, List<Object> allModels) {
|
||||
if (!generateApis) {
|
||||
// TODO: Process these anyway and present info via dryRun?
|
||||
LOGGER.info("Skipping generation of APIs.");
|
||||
@@ -580,7 +580,7 @@ public class DefaultGenerator implements Generator {
|
||||
Map<String, Object> operation = processOperations(config, tag, ops, allModels);
|
||||
URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides());
|
||||
operation.put("basePath", basePath);
|
||||
operation.put("basePathWithoutHost", config.encodePath(url.getPath()).replaceAll("/$", ""));
|
||||
operation.put("basePathWithoutHost", removeTrailingSlash(config.encodePath(url.getPath())));
|
||||
operation.put("contextPath", contextPath);
|
||||
operation.put("baseName", tag);
|
||||
operation.put("apiPackage", config.apiPackage());
|
||||
@@ -756,7 +756,7 @@ public class DefaultGenerator implements Generator {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<String, Object> buildSupportFileBundle(List<Object> allOperations, List<Object> allModels) {
|
||||
Map<String, Object> buildSupportFileBundle(List<Object> allOperations, List<Object> allModels) {
|
||||
|
||||
Map<String, Object> bundle = new HashMap<>(config.additionalProperties());
|
||||
bundle.put("apiPackage", config.apiPackage());
|
||||
@@ -806,6 +806,7 @@ public class DefaultGenerator implements Generator {
|
||||
|
||||
List<CodegenServer> servers = config.fromServers(openAPI.getServers());
|
||||
if (servers != null && !servers.isEmpty()) {
|
||||
servers.forEach(server -> server.url = removeTrailingSlash(server.url));
|
||||
bundle.put("servers", servers);
|
||||
bundle.put("hasServers", true);
|
||||
}
|
||||
@@ -1483,4 +1484,8 @@ public class DefaultGenerator implements Generator {
|
||||
}
|
||||
}
|
||||
|
||||
private String removeTrailingSlash(String value) {
|
||||
return StringUtils.removeEnd(value, "/");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -90,4 +90,12 @@ public interface IJsonSchemaValidationProperties {
|
||||
List<CodegenProperty> getRequiredVars();
|
||||
|
||||
void setRequiredVars(List<CodegenProperty> requiredVars);
|
||||
|
||||
boolean getIsNull();
|
||||
|
||||
void setIsNull(boolean isNull);
|
||||
|
||||
boolean getHasValidation();
|
||||
|
||||
void setHasValidation(boolean hasValidation);
|
||||
}
|
||||
|
||||
@@ -378,38 +378,34 @@ public class InlineModelResolver {
|
||||
ListIterator<Schema> listIterator = children.listIterator();
|
||||
while (listIterator.hasNext()) {
|
||||
Schema component = listIterator.next();
|
||||
if (component instanceof ObjectSchema || // for inline schema with type:object
|
||||
(component != null && component.getProperties() != null &&
|
||||
!component.getProperties().isEmpty())) { // for inline schema without type:object
|
||||
Schema op = component;
|
||||
if (op.get$ref() == null && op.getProperties() != null && op.getProperties().size() > 0) {
|
||||
// If a `title` attribute is defined in the inline schema, codegen uses it to name the
|
||||
// inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc.
|
||||
// We know that this is not the best way to name the model.
|
||||
//
|
||||
// Such naming strategy may result in issues. If the value of the 'title' attribute
|
||||
// happens to match a schema defined elsewhere in the specification, 'innerModelName'
|
||||
// will be the same as that other schema.
|
||||
//
|
||||
// To have complete control of the model naming, one can define the model separately
|
||||
// instead of inline.
|
||||
String innerModelName = resolveModelName(op.getTitle(), key);
|
||||
Schema innerModel = modelFromProperty(openAPI, op, innerModelName);
|
||||
String existing = matchGenerated(innerModel);
|
||||
if (existing == null) {
|
||||
openAPI.getComponents().addSchemas(innerModelName, innerModel);
|
||||
addGenerated(innerModelName, innerModel);
|
||||
Schema schema = new Schema().$ref(innerModelName);
|
||||
schema.setRequired(op.getRequired());
|
||||
listIterator.set(schema);
|
||||
} else {
|
||||
Schema schema = new Schema().$ref(existing);
|
||||
schema.setRequired(op.getRequired());
|
||||
listIterator.set(schema);
|
||||
}
|
||||
if ((component != null) &&
|
||||
(component.get$ref() == null) &&
|
||||
((component.getProperties() != null && !component.getProperties().isEmpty()) ||
|
||||
(component.getEnum() != null && !component.getEnum().isEmpty()))) {
|
||||
// If a `title` attribute is defined in the inline schema, codegen uses it to name the
|
||||
// inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc.
|
||||
// We know that this is not the best way to name the model.
|
||||
//
|
||||
// Such naming strategy may result in issues. If the value of the 'title' attribute
|
||||
// happens to match a schema defined elsewhere in the specification, 'innerModelName'
|
||||
// will be the same as that other schema.
|
||||
//
|
||||
// To have complete control of the model naming, one can define the model separately
|
||||
// instead of inline.
|
||||
String innerModelName = resolveModelName(component.getTitle(), key);
|
||||
Schema innerModel = modelFromProperty(openAPI, component, innerModelName);
|
||||
String existing = matchGenerated(innerModel);
|
||||
if (existing == null) {
|
||||
openAPI.getComponents().addSchemas(innerModelName, innerModel);
|
||||
addGenerated(innerModelName, innerModel);
|
||||
Schema schema = new Schema().$ref(innerModelName);
|
||||
schema.setRequired(component.getRequired());
|
||||
listIterator.set(schema);
|
||||
} else {
|
||||
Schema schema = new Schema().$ref(existing);
|
||||
schema.setRequired(component.getRequired());
|
||||
listIterator.set(schema);
|
||||
}
|
||||
} else {
|
||||
// likely a reference to schema (not inline schema)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -540,7 +536,7 @@ public class InlineModelResolver {
|
||||
*/
|
||||
private String sanitizeName(final String name) {
|
||||
return name
|
||||
.replaceAll("^[0-9]", "_") // e.g. 12object => _2object
|
||||
.replaceAll("^[0-9]", "_$0") // e.g. 12object => _12object
|
||||
.replaceAll("[^A-Za-z0-9]", "_"); // e.g. io.schema.User name => io_schema_User_name
|
||||
}
|
||||
|
||||
@@ -671,6 +667,8 @@ public class InlineModelResolver {
|
||||
model.setXml(xml);
|
||||
model.setRequired(object.getRequired());
|
||||
model.setNullable(object.getNullable());
|
||||
model.setEnum(object.getEnum());
|
||||
model.setType(object.getType());
|
||||
model.setDiscriminator(object.getDiscriminator());
|
||||
model.setWriteOnly(object.getWriteOnly());
|
||||
model.setUniqueItems(object.getUniqueItems());
|
||||
|
||||
@@ -109,15 +109,15 @@ public class TemplateManager implements TemplatingExecutor, TemplateProcessor {
|
||||
if (name == null || name.contains("..")) {
|
||||
throw new IllegalArgumentException("Template location must be constrained to template directory.");
|
||||
}
|
||||
try {
|
||||
Reader reader = getTemplateReader(name);
|
||||
try (Reader reader = getTemplateReader(name)) {
|
||||
if (reader == null) {
|
||||
throw new RuntimeException("no file found");
|
||||
}
|
||||
Scanner s = new Scanner(reader).useDelimiter("\\A");
|
||||
return s.hasNext() ? s.next() : "";
|
||||
try (Scanner s = new Scanner(reader).useDelimiter("\\A")) {
|
||||
return s.hasNext() ? s.next() : "";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(e.getMessage());
|
||||
LOGGER.error("{}", e.getMessage(), e);
|
||||
}
|
||||
throw new RuntimeException("can't load template " + name);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class TemplateManager implements TemplatingExecutor, TemplateProcessor {
|
||||
if (name == null || name.contains("..")) {
|
||||
throw new IllegalArgumentException("Template location must be constrained to template directory.");
|
||||
}
|
||||
is = new FileInputStream(new File(name)); // May throw but never return a null value
|
||||
is = new FileInputStream(name); // May throw but never return a null value
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class CodegenConfiguratorUtils {
|
||||
public static void applyGlobalPropertiesKvp(String globalProperties, CodegenConfigurator configurator) {
|
||||
final Map<String, String> map = createMapFromKeyValuePairs(globalProperties);
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
configurator.addGlobalProperty(entry.getKey(), entry.getValue());
|
||||
configurator.addGlobalProperty(entry.getKey(), entry.getValue().replace(":",","));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -517,6 +517,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
importMapping.put("JsonReader", "com.google.gson.stream.JsonReader");
|
||||
importMapping.put("JsonWriter", "com.google.gson.stream.JsonWriter");
|
||||
importMapping.put("IOException", "java.io.IOException");
|
||||
importMapping.put("Arrays", "java.util.Arrays");
|
||||
importMapping.put("Objects", "java.util.Objects");
|
||||
importMapping.put("StringUtil", invokerPackage + ".StringUtil");
|
||||
// import JsonCreator if JsonProperty is imported
|
||||
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
typeMapping.put("ByteArray", "kotlin.ByteArray");
|
||||
typeMapping.put("number", "java.math.BigDecimal");
|
||||
typeMapping.put("decimal", "java.math.BigDecimal");
|
||||
typeMapping.put("date-time", "java.time.LocalDateTime");
|
||||
typeMapping.put("date-time", "java.time.OffsetDateTime");
|
||||
typeMapping.put("date", "java.time.LocalDate");
|
||||
typeMapping.put("file", "java.io.File");
|
||||
typeMapping.put("array", "kotlin.Array");
|
||||
@@ -163,7 +163,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
typeMapping.put("object", "kotlin.Any");
|
||||
typeMapping.put("binary", "kotlin.ByteArray");
|
||||
typeMapping.put("Date", "java.time.LocalDate");
|
||||
typeMapping.put("DateTime", "java.time.LocalDateTime");
|
||||
typeMapping.put("DateTime", "java.time.OffsetDateTime");
|
||||
|
||||
instantiationTypes.put("array", "kotlin.collections.ArrayList");
|
||||
instantiationTypes.put("list", "kotlin.collections.ArrayList");
|
||||
@@ -174,9 +174,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
importMapping.put("UUID", "java.util.UUID");
|
||||
importMapping.put("URI", "java.net.URI");
|
||||
importMapping.put("File", "java.io.File");
|
||||
importMapping.put("Date", "java.util.Date");
|
||||
importMapping.put("Date", "java.time.LocalDate");
|
||||
importMapping.put("Timestamp", "java.sql.Timestamp");
|
||||
importMapping.put("DateTime", "java.time.LocalDateTime");
|
||||
importMapping.put("DateTime", "java.time.OffsetDateTime");
|
||||
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
|
||||
importMapping.put("LocalDate", "java.time.LocalDate");
|
||||
importMapping.put("LocalTime", "java.time.LocalTime");
|
||||
@@ -898,7 +898,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toDefaultValue(Schema p) {
|
||||
public String toDefaultValue(Schema schema) {
|
||||
Schema p = ModelUtils.getReferencedSchema(this.openAPI, schema);
|
||||
if (ModelUtils.isBooleanSchema(p)) {
|
||||
if (p.getDefault() != null) {
|
||||
return p.getDefault().toString();
|
||||
@@ -921,8 +922,15 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
} else if (ModelUtils.isStringSchema(p)) {
|
||||
if (p.getDefault() != null) {
|
||||
return "\"" + p.getDefault() + "\"";
|
||||
String _default = (String) p.getDefault();
|
||||
if (p.getEnum() == null) {
|
||||
return "\"" + escapeText(_default) + "\"";
|
||||
} else {
|
||||
// convert to enum var name later in postProcessModels
|
||||
return _default;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -49,6 +49,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
||||
public static final String CONTROLLER_PACKAGE = "controllerPackage";
|
||||
public static final String DEFAULT_CONTROLLER = "defaultController";
|
||||
public static final String SUPPORT_PYTHON2 = "supportPython2";
|
||||
public static final String FEATURE_CORS = "featureCORS";
|
||||
// nose is a python testing framework, we use pytest if USE_NOSE is unset
|
||||
public static final String USE_NOSE = "useNose";
|
||||
public static final String PYTHON_SRC_ROOT = "pythonSrcRoot";
|
||||
@@ -61,6 +62,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
||||
protected String defaultController;
|
||||
protected Map<Character, String> regexModifiers;
|
||||
protected boolean fixBodyName;
|
||||
protected boolean featureCORS = Boolean.FALSE;
|
||||
protected boolean useNose = Boolean.FALSE;
|
||||
protected String pythonSrcRoot;
|
||||
|
||||
@@ -165,6 +167,8 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
||||
defaultValue("false"));
|
||||
cliOptions.add(new CliOption("serverPort", "TCP port to listen to in app.run").
|
||||
defaultValue("8080"));
|
||||
cliOptions.add(CliOption.newBoolean(FEATURE_CORS, "use flask-cors for handling CORS requests").
|
||||
defaultValue(Boolean.FALSE.toString()));
|
||||
cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework").
|
||||
defaultValue(Boolean.FALSE.toString()));
|
||||
cliOptions.add(new CliOption(PYTHON_SRC_ROOT, "put python sources in this subdirectory of output folder (defaults to \"\" for). Use this for src/ layout.").
|
||||
@@ -213,6 +217,9 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
||||
additionalProperties.put(SUPPORT_PYTHON2, Boolean.TRUE);
|
||||
typeMapping.put("long", "long");
|
||||
}
|
||||
if (additionalProperties.containsKey(FEATURE_CORS)) {
|
||||
setFeatureCORS((String) additionalProperties.get(FEATURE_CORS));
|
||||
}
|
||||
if (additionalProperties.containsKey(USE_NOSE)) {
|
||||
setUseNose((String) additionalProperties.get(USE_NOSE));
|
||||
}
|
||||
@@ -236,6 +243,10 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
||||
controllerPackage = packageName + "." + controllerPackage;
|
||||
}
|
||||
|
||||
public void setFeatureCORS(String val) {
|
||||
this.featureCORS = Boolean.valueOf(val);
|
||||
}
|
||||
|
||||
public void setUseNose(String val) {
|
||||
this.useNose = Boolean.valueOf(val);
|
||||
}
|
||||
|
||||
@@ -172,9 +172,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
|
||||
|
||||
@Override
|
||||
public String toVarName(final String name) {
|
||||
String varName;
|
||||
// sanitize name
|
||||
varName = sanitizeName(name);
|
||||
String varName = sanitizeName(name);
|
||||
// if it's all uppper case, convert to lower case
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
varName = varName.toLowerCase(Locale.ROOT);
|
||||
@@ -207,7 +205,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
|
||||
// method name cannot use reserved keyword, e.g. return
|
||||
if (isReservedWord(operationId)) {
|
||||
String newOperationId = underscore("call_" + operationId);
|
||||
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
|
||||
LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
|
||||
return newOperationId;
|
||||
}
|
||||
|
||||
@@ -241,15 +239,16 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
int exitValue = p.waitFor();
|
||||
if (exitValue != 0) {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream(), StandardCharsets.UTF_8));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
try(BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb.toString());
|
||||
}
|
||||
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb.toString());
|
||||
} else {
|
||||
LOGGER.info("Successfully executed: " + command);
|
||||
LOGGER.info("Successfully executed: `{}`", command);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
|
||||
|
||||
@@ -143,7 +143,111 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
"_Imaginary",
|
||||
"_Noreturn",
|
||||
"_Static_assert",
|
||||
"_Thread_local")
|
||||
"_Thread_local",
|
||||
|
||||
// cpp reserved keywords
|
||||
// ref: https://en.cppreference.com/w/cpp/keyword
|
||||
"alignas",
|
||||
"alignof",
|
||||
"and",
|
||||
"and_eq",
|
||||
"asm",
|
||||
"atomic_cancel",
|
||||
"atomic_commit",
|
||||
"atomic_noexcept",
|
||||
//"auto",
|
||||
"bitand",
|
||||
"bitor",
|
||||
"bool",
|
||||
//"break",
|
||||
//"case",
|
||||
"catch",
|
||||
//"char",
|
||||
"char8_t",
|
||||
"char16_t",
|
||||
"char32_t",
|
||||
"class",
|
||||
"compl",
|
||||
"concept",
|
||||
//"const",
|
||||
"consteval",
|
||||
"constexpr",
|
||||
"constinit",
|
||||
"const_cast",
|
||||
//"continue",
|
||||
"co_await",
|
||||
"co_return",
|
||||
"co_yield",
|
||||
"decltype",
|
||||
//"default",
|
||||
"delete",
|
||||
//"do",
|
||||
//"double",
|
||||
"dynamic_cast",
|
||||
//"else",
|
||||
//"enum",
|
||||
"explicit",
|
||||
"export",
|
||||
//"extern",
|
||||
"false",
|
||||
//"float",
|
||||
//"for",
|
||||
"friend",
|
||||
//"goto",
|
||||
//"if",
|
||||
//"inline",
|
||||
//"int",
|
||||
//"long",
|
||||
"mutable",
|
||||
"namespace",
|
||||
"new",
|
||||
"noexcept",
|
||||
"not",
|
||||
"not_eq",
|
||||
"nullptr",
|
||||
"operator",
|
||||
"or",
|
||||
"or_eq",
|
||||
"private",
|
||||
"protected",
|
||||
"public",
|
||||
"reflexpr",
|
||||
//"register",
|
||||
"reinterpret_cast",
|
||||
"requires",
|
||||
//"return",
|
||||
//"short",
|
||||
//"signed",
|
||||
//"sizeof",
|
||||
//"static",
|
||||
"static_assert",
|
||||
"static_cast",
|
||||
//"struct",
|
||||
//"switch",
|
||||
"synchronized",
|
||||
"template",
|
||||
"this",
|
||||
"thread_local",
|
||||
"throw",
|
||||
"true",
|
||||
"try",
|
||||
//"typedef",
|
||||
"typeid",
|
||||
"typename",
|
||||
//"union",
|
||||
//"unsigned",
|
||||
"using",
|
||||
"virtual",
|
||||
//"void",
|
||||
//"volatile",
|
||||
"wchar_t",
|
||||
//"while",
|
||||
"xor",
|
||||
"xor_eq",
|
||||
"final",
|
||||
"override",
|
||||
"transaction_safe",
|
||||
"transaction_safe_dynamic")
|
||||
);
|
||||
|
||||
instantiationTypes.clear();
|
||||
|
||||
@@ -63,7 +63,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
FrameworkStrategy.NETCOREAPP_2_1,
|
||||
FrameworkStrategy.NETCOREAPP_3_0,
|
||||
FrameworkStrategy.NETCOREAPP_3_1,
|
||||
FrameworkStrategy.NETFRAMEWORK_4_7
|
||||
FrameworkStrategy.NETFRAMEWORK_4_7,
|
||||
FrameworkStrategy.NET_5_0
|
||||
);
|
||||
private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0;
|
||||
protected final Map<String, String> frameworks;
|
||||
@@ -787,8 +788,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
}
|
||||
|
||||
// string
|
||||
String var = value.replaceAll("_", " ");
|
||||
//var = WordUtils.capitalizeFully(var);
|
||||
String var = value.replaceAll(" ", "_");
|
||||
var = camelize(var);
|
||||
var = var.replaceAll("\\W+", "");
|
||||
|
||||
@@ -909,6 +909,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
};
|
||||
static FrameworkStrategy NETFRAMEWORK_4_7 = new FrameworkStrategy("net47", ".NET Framework 4.7 compatible", "net47", Boolean.FALSE) {
|
||||
};
|
||||
static FrameworkStrategy NET_5_0 = new FrameworkStrategy("net5.0", ".NET 5.0 compatible", "net5.0", Boolean.FALSE) {
|
||||
};
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected String testTargetFramework;
|
||||
|
||||
@@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.features.*;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -123,6 +124,11 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
|
||||
return objs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
||||
return postProcessModelsEnum(objs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeQuotationMark(String input) {
|
||||
// just return the original string
|
||||
@@ -134,4 +140,14 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
|
||||
// just return the original string
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeText(String input) {
|
||||
if (input == null) {
|
||||
return input;
|
||||
}
|
||||
|
||||
// chomp tailing newline because it breaks the tables and keep all other sign to show documentation properly
|
||||
return StringUtils.chomp(input);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user