forked from loafle/openapi-generator-original
Compare commits
13 Commits
v5.3.0
...
circleci-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff80c4ea83 | ||
|
|
90176c8a2e | ||
|
|
a8840e7a26 | ||
|
|
5e857e749d | ||
|
|
6bbafdfa30 | ||
|
|
ae39d782e0 | ||
|
|
3a667784ac | ||
|
|
8d490835b7 | ||
|
|
f1ab3edbc0 | ||
|
|
01a4569995 | ||
|
|
d1089d785c | ||
|
|
97e079fde0 | ||
|
|
378465702c |
@@ -42,24 +42,6 @@ jobs:
|
||||
command: |-
|
||||
printf '127.0.0.1 petstore.swagger.io
|
||||
' | sudo tee -a /etc/hosts
|
||||
# Dependencies
|
||||
# Install latest stable node for angular 6
|
||||
- run:
|
||||
name: Install node@stable (for angular 6)
|
||||
command: |
|
||||
set +e
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
|
||||
export NVM_DIR="/opt/circleci/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
#nvm install stable
|
||||
# install v16 instead of the latest stable version
|
||||
nvm install 16
|
||||
nvm alias default 16
|
||||
|
||||
# Each step uses the same `$BASH_ENV`, so need to modify it
|
||||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
|
||||
- run: node --version
|
||||
# - run: docker pull openapitools/openapi-petstore
|
||||
# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore
|
||||
- run: docker pull swaggerapi/petstore
|
||||
|
||||
@@ -40,6 +40,13 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
||||
sudo apt-get -y build-dep libcurl4-gnutls-dev
|
||||
sudo apt-get -y install libcurl4-gnutls-dev
|
||||
|
||||
# Install golang version 1.14
|
||||
go version
|
||||
sudo mkdir /usr/local/go1.14
|
||||
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
|
||||
export PATH="/usr/local/go1.14/go/bin:$PATH"
|
||||
go version
|
||||
|
||||
# run integration tests
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
elif [ "$NODE_INDEX" = "3" ]; then
|
||||
@@ -55,6 +62,21 @@ elif [ "$NODE_INDEX" = "3" ]; then
|
||||
pyenv global 3.6.3
|
||||
python3 --version
|
||||
|
||||
# Install node@stable (for angular 6)
|
||||
set +e
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
|
||||
export NVM_DIR="/opt/circleci/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
#nvm install stable
|
||||
# install v16 instead of the latest stable version
|
||||
nvm install 16
|
||||
nvm alias default 16
|
||||
node --version
|
||||
|
||||
# Each step uses the same `$BASH_ENV`, so need to modify it
|
||||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
|
||||
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node3 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
|
||||
else
|
||||
@@ -62,13 +84,6 @@ else
|
||||
#sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
java -version
|
||||
|
||||
# Install golang version 1.14
|
||||
go version
|
||||
sudo mkdir /usr/local/go1.14
|
||||
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
|
||||
export PATH="/usr/local/go1.14/go/bin:$PATH"
|
||||
go version
|
||||
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
fi
|
||||
|
||||
26
README.md
26
README.md
@@ -9,7 +9,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.3.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.3.1`):
|
||||
[](https://travis-ci.com/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
|
||||
@@ -17,6 +17,13 @@
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
[](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22)
|
||||
|
||||
[5.4.x](https://github.com/OpenAPITools/openapi-generator/tree/5.4.x) (`5.4.x`):
|
||||
[](https://travis-ci.com/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
|
||||
[](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.com/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
@@ -110,9 +117,10 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 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.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.3.0-SNAPSHOT/) | Sep/Oct 2021 | Minor release with breaking changes (with fallback) |
|
||||
| [5.2.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.2.1) (latest stable release) | 016.08.2021 | Patch release (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/) | Jan/Feb 2022 | Minor release with breaking changes (no fallback) |
|
||||
| 5.4.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.4.0-SNAPSHOT/) | Dec 2021 | Minor release with breaking changes (with fallback) |
|
||||
| 5.3.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.3.1-SNAPSHOT/) | Nov/Dec 2021 | Patch release (enhancements, bug fixes, etc) |
|
||||
| [5.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.0) (latest stable release) | 24.10.2021 | Minor release with breaking changes (with fallback) |
|
||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||
|
||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||
@@ -169,16 +177,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
||||
<!-- RELEASE_VERSION -->
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
||||
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
```
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -403,7 +411,7 @@ openapi-generator-cli version
|
||||
To use a specific version of "openapi-generator-cli"
|
||||
|
||||
```sh
|
||||
openapi-generator-cli version-manager set 5.2.1
|
||||
openapi-generator-cli version-manager set 5.3.0
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -427,7 +435,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar)
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar)
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||
|
||||
@@ -5,3 +5,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: microprofile-rest-client
|
||||
configKey: petstore
|
||||
|
||||
@@ -19,6 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false|
|
||||
|configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date (if you really have a good reason not to use threetenbp</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk < 1.8)</dd></dl>|threetenbp|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|
||||
@@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
|
||||
To install a specific version of the tool, pass the version during installation:
|
||||
<!-- RELEASE_VERSION -->
|
||||
```bash
|
||||
openapi-generator-cli version-manager set 5.1.0
|
||||
openapi-generator-cli version-manager set 5.3.0
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
To install the tool as a dev dependency in your current project:
|
||||
@@ -80,18 +80,18 @@ docker run --rm \
|
||||
<!-- RELEASE_VERSION -->
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
||||
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
|
||||
```bash
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.1.0/openapi-generator-cli-5.1.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
|
||||
[source,group]
|
||||
----
|
||||
plugins {
|
||||
id "org.openapi.generator" version "5.1.1"
|
||||
id "org.openapi.generator" version "5.3.0"
|
||||
}
|
||||
----
|
||||
|
||||
@@ -113,7 +113,7 @@ buildscript {
|
||||
// url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:5.1.1"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:5.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:4.2.3') {
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:5.3.0') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=5.3.0
|
||||
openApiGeneratorVersion=5.3.1-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -18,5 +18,5 @@ gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
|
||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||
|
||||
```bash
|
||||
gradle -PopenApiGeneratorVersion=5.1.0 openApiValidate
|
||||
gradle -PopenApiGeneratorVersion=5.3.0 openApiValidate
|
||||
```
|
||||
|
||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.1.0</version>
|
||||
<version>5.3.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.openapitools.codegen;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class CodegenComposedSchemas {
|
||||
private List<CodegenProperty> allOf;
|
||||
private List<CodegenProperty> oneOf;
|
||||
private List<CodegenProperty> anyOf;
|
||||
|
||||
public CodegenComposedSchemas(List<CodegenProperty> allOf, List<CodegenProperty> oneOf, List<CodegenProperty> anyOf) {
|
||||
this.allOf = allOf;
|
||||
this.oneOf = oneOf;
|
||||
this.anyOf = anyOf;
|
||||
}
|
||||
|
||||
public List<CodegenProperty> getAllOf() {
|
||||
return allOf;
|
||||
}
|
||||
|
||||
public List<CodegenProperty> getOneOf() {
|
||||
return oneOf;
|
||||
}
|
||||
|
||||
public List<CodegenProperty> getAnyOf() {
|
||||
return anyOf;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("CodegenComposedSchemas{");
|
||||
sb.append("oneOf=").append(oneOf);
|
||||
sb.append(", anyOf=").append(anyOf);
|
||||
sb.append(", allOf=").append(allOf);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CodegenComposedSchemas that = (CodegenComposedSchemas) o;
|
||||
return Objects.equals(oneOf, that.oneOf) &&
|
||||
Objects.equals(anyOf, that.anyOf) &&
|
||||
Objects.equals(allOf, that.allOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(oneOf, anyOf, allOf);
|
||||
}
|
||||
}
|
||||
@@ -49,11 +49,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
public Set<String> oneOf = new TreeSet<String>();
|
||||
public Set<String> allOf = new TreeSet<String>();
|
||||
|
||||
// anyOf, oneOf, allOf with full properties/tags (e.g. isString, etc)
|
||||
public List<CodegenProperty> anyOfProps = new ArrayList<>();
|
||||
public List<CodegenProperty> allOfProps = new ArrayList<>();
|
||||
public List<CodegenProperty> oneOfProps = new ArrayList<>();
|
||||
|
||||
// The schema name as written in the OpenAPI document.
|
||||
public String name;
|
||||
// The language-specific name of the class that implements this schema.
|
||||
@@ -110,6 +105,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
public ExternalDocumentation externalDocumentation;
|
||||
|
||||
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
|
||||
private CodegenComposedSchemas composedSchemas;
|
||||
|
||||
/**
|
||||
* The type of the value for the additionalProperties keyword in the OAS document.
|
||||
@@ -810,6 +806,16 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
this.isAnyType = isAnyType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setComposedSchemas(CodegenComposedSchemas composedSchemas) {
|
||||
this.composedSchemas = composedSchemas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenComposedSchemas getComposedSchemas() {
|
||||
return composedSchemas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
@@ -849,6 +855,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
getUniqueItems() == that.getUniqueItems() &&
|
||||
getExclusiveMinimum() == that.getExclusiveMinimum() &&
|
||||
getExclusiveMaximum() == that.getExclusiveMaximum() &&
|
||||
Objects.equals(composedSchemas, that.composedSchemas) &&
|
||||
Objects.equals(parent, that.parent) &&
|
||||
Objects.equals(parentSchema, that.parentSchema) &&
|
||||
Objects.equals(interfaces, that.interfaces) &&
|
||||
@@ -856,9 +863,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
Objects.equals(parentModel, that.parentModel) &&
|
||||
Objects.equals(interfaceModels, that.interfaceModels) &&
|
||||
Objects.equals(children, that.children) &&
|
||||
Objects.equals(anyOf, that.anyOfProps) &&
|
||||
Objects.equals(oneOf, that.oneOfProps) &&
|
||||
Objects.equals(allOf, that.allOfProps) &&
|
||||
Objects.equals(anyOf, that.anyOf) &&
|
||||
Objects.equals(oneOf, that.oneOf) &&
|
||||
Objects.equals(allOf, that.allOf) &&
|
||||
@@ -921,8 +925,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(),
|
||||
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
|
||||
getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(),
|
||||
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping, anyOfProps, oneOfProps, allOfProps,
|
||||
isAnyType);
|
||||
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping,
|
||||
isAnyType, getComposedSchemas());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -938,9 +942,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
sb.append(", anyOf=").append(anyOf);
|
||||
sb.append(", oneOf=").append(oneOf);
|
||||
sb.append(", allOf=").append(allOf);
|
||||
sb.append(", anyOf=").append(anyOfProps);
|
||||
sb.append(", oneOf=").append(oneOfProps);
|
||||
sb.append(", allOf=").append(allOfProps);
|
||||
sb.append(", name='").append(name).append('\'');
|
||||
sb.append(", classname='").append(classname).append('\'');
|
||||
sb.append(", title='").append(title).append('\'');
|
||||
@@ -1017,6 +1018,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
sb.append(", getAdditionalPropertiesIsAnyType=").append(getAdditionalPropertiesIsAnyType());
|
||||
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
|
||||
sb.append(", getIsAnyType=").append(getIsAnyType());
|
||||
sb.append(", composedSchemas=").append(composedSchemas);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public boolean isNull;
|
||||
private boolean hasRequired;
|
||||
private boolean hasDiscriminatorWithNonEmptyMapping;
|
||||
private CodegenComposedSchemas composedSchemas;
|
||||
|
||||
public CodegenParameter copy() {
|
||||
CodegenParameter output = new CodegenParameter();
|
||||
@@ -159,6 +160,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
output.setHasRequired(this.hasRequired);
|
||||
output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping);
|
||||
|
||||
if (this.composedSchemas != null) {
|
||||
output.setComposedSchemas(this.getComposedSchemas());
|
||||
}
|
||||
if (this._enum != null) {
|
||||
output._enum = new ArrayList<String>(this._enum);
|
||||
}
|
||||
@@ -216,7 +220,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, isDeepObject, isAllowEmptyValue, 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, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping);
|
||||
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, isDeepObject, isAllowEmptyValue, 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, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,6 +275,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
getExclusiveMaximum() == that.getExclusiveMaximum() &&
|
||||
getExclusiveMinimum() == that.getExclusiveMinimum() &&
|
||||
getUniqueItems() == that.getUniqueItems() &&
|
||||
Objects.equals(composedSchemas, that.getComposedSchemas()) &&
|
||||
Objects.equals(baseName, that.baseName) &&
|
||||
Objects.equals(paramName, that.paramName) &&
|
||||
Objects.equals(dataType, that.dataType) &&
|
||||
@@ -393,6 +398,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
sb.append(", getHasVars=").append(hasVars);
|
||||
sb.append(", getHasRequired=").append(hasRequired);
|
||||
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
|
||||
sb.append(", composedSchemas=").append(composedSchemas);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -706,5 +712,15 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public void setIsAnyType(boolean isAnyType) {
|
||||
this.isAnyType = isAnyType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setComposedSchemas(CodegenComposedSchemas composedSchemas) {
|
||||
this.composedSchemas = composedSchemas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenComposedSchemas getComposedSchemas() {
|
||||
return composedSchemas;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
private boolean hasVars;
|
||||
private boolean hasRequired;
|
||||
private boolean hasDiscriminatorWithNonEmptyMapping;
|
||||
private CodegenComposedSchemas composedSchemas = null;
|
||||
|
||||
public String getBaseName() {
|
||||
return baseName;
|
||||
@@ -614,6 +615,16 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
this.xmlNamespace = xmlNamespace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setComposedSchemas(CodegenComposedSchemas composedSchemas) {
|
||||
this.composedSchemas = composedSchemas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenComposedSchemas getComposedSchemas() {
|
||||
return composedSchemas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenProperty clone() {
|
||||
try {
|
||||
@@ -642,6 +653,9 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
if (this.vendorExtensions != null) {
|
||||
cp.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
|
||||
}
|
||||
if (this.composedSchemas != null) {
|
||||
cp.composedSchemas = this.composedSchemas;
|
||||
}
|
||||
|
||||
return cp;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
@@ -882,6 +896,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
sb.append(", getHasVars=").append(getHasVars());
|
||||
sb.append(", getHasRequired=").append(getHasRequired());
|
||||
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
|
||||
sb.append(", composedSchemas=").append(composedSchemas);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -937,6 +952,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
||||
getHasVars() == that.getHasVars() &&
|
||||
getHasRequired() ==that.getHasRequired() &&
|
||||
Objects.equals(composedSchemas, that.composedSchemas) &&
|
||||
Objects.equals(openApiType, that.openApiType) &&
|
||||
Objects.equals(baseName, that.baseName) &&
|
||||
Objects.equals(complexType, that.complexType) &&
|
||||
@@ -999,6 +1015,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,
|
||||
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName,
|
||||
xmlNamespace, isXmlWrapped, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired,
|
||||
hasDiscriminatorWithNonEmptyMapping);
|
||||
hasDiscriminatorWithNonEmptyMapping, composedSchemas);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
private boolean hasVars;
|
||||
private boolean hasRequired;
|
||||
private boolean hasDiscriminatorWithNonEmptyMapping;
|
||||
private CodegenComposedSchemas composedSchemas;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@@ -96,7 +97,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(),
|
||||
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
|
||||
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired,
|
||||
hasDiscriminatorWithNonEmptyMapping);
|
||||
hasDiscriminatorWithNonEmptyMapping, composedSchemas);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,6 +145,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
||||
getHasVars() == that.getHasVars() &&
|
||||
getHasRequired() == that.getHasRequired() &&
|
||||
Objects.equals(composedSchemas, that.getComposedSchemas()) &&
|
||||
Objects.equals(vars, that.vars) &&
|
||||
Objects.equals(requiredVars, that.requiredVars) &&
|
||||
Objects.equals(headers, that.headers) &&
|
||||
@@ -482,6 +484,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
sb.append(", getHasVars=").append(hasVars);
|
||||
sb.append(", getHasRequired=").append(hasRequired);
|
||||
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
|
||||
sb.append(", composedSchemas=").append(composedSchemas);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -570,4 +573,14 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
public void setIsAnyType(boolean isAnyType) {
|
||||
this.isAnyType = isAnyType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setComposedSchemas(CodegenComposedSchemas composedSchemas) {
|
||||
this.composedSchemas = composedSchemas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenComposedSchemas getComposedSchemas() {
|
||||
return composedSchemas;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2440,9 +2440,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
// interfaces (schemas defined in allOf, anyOf, oneOf)
|
||||
List<Schema> interfaces = ModelUtils.getInterfaces(composed);
|
||||
List<CodegenProperty> anyOfProps = new ArrayList<>();
|
||||
List<CodegenProperty> allOfProps = new ArrayList<>();
|
||||
List<CodegenProperty> oneOfProps = new ArrayList<>();
|
||||
if (!interfaces.isEmpty()) {
|
||||
// m.interfaces is for backward compatibility
|
||||
if (m.interfaces == null)
|
||||
@@ -2467,7 +2464,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
LOGGER.warn("{} (anyOf schema) already has `{}` defined and therefore it's skipped.", m.name, languageType);
|
||||
} else {
|
||||
m.anyOf.add(languageType);
|
||||
anyOfProps.add(interfaceProperty);
|
||||
|
||||
}
|
||||
} else if (composed.getOneOf() != null) {
|
||||
@@ -2475,7 +2471,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
LOGGER.warn("{} (oneOf schema) already has `{}` defined and therefore it's skipped.", m.name, languageType);
|
||||
} else {
|
||||
m.oneOf.add(languageType);
|
||||
oneOfProps.add(interfaceProperty);
|
||||
}
|
||||
} else if (composed.getAllOf() != null) {
|
||||
// no need to add primitive type to allOf, which should comprise of schemas (models) only
|
||||
@@ -2511,23 +2506,16 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
if (composed.getAnyOf() != null) {
|
||||
m.anyOf.add(modelName);
|
||||
anyOfProps.add(interfaceProperty);
|
||||
} else if (composed.getOneOf() != null) {
|
||||
m.oneOf.add(modelName);
|
||||
oneOfProps.add(interfaceProperty);
|
||||
} else if (composed.getAllOf() != null) {
|
||||
m.allOf.add(modelName);
|
||||
allOfProps.add(interfaceProperty);
|
||||
} else {
|
||||
LOGGER.error("Composed schema has incorrect anyOf, allOf, oneOf defined: {}", composed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m.oneOfProps = oneOfProps;
|
||||
m.allOfProps = allOfProps;
|
||||
m.anyOfProps = anyOfProps;
|
||||
|
||||
if (parent != null && composed.getAllOf() != null) { // set parent for allOf only
|
||||
m.parentSchema = parentName;
|
||||
m.parent = toModelName(parentName);
|
||||
@@ -2696,6 +2684,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
m.setTypeProperties(schema);
|
||||
m.setComposedSchemas(getComposedSchemas(schema));
|
||||
if (ModelUtils.isArraySchema(schema)) {
|
||||
CodegenProperty arrayProperty = fromProperty(name, schema);
|
||||
m.setItems(arrayProperty.items);
|
||||
@@ -3514,6 +3503,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
property.setTypeProperties(p);
|
||||
property.setComposedSchemas(getComposedSchemas(p));
|
||||
if (ModelUtils.isIntegerSchema(p)) { // integer type
|
||||
property.isNumeric = Boolean.TRUE;
|
||||
if (ModelUtils.isLongSchema(p)) { // int64/long format
|
||||
@@ -4265,6 +4255,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
r.setTypeProperties(responseSchema);
|
||||
r.setComposedSchemas(getComposedSchemas(responseSchema));
|
||||
if (ModelUtils.isArraySchema(responseSchema)) {
|
||||
r.simpleType = false;
|
||||
r.containerType = cp.containerType;
|
||||
@@ -4547,6 +4538,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
ModelUtils.syncValidationProperties(parameterSchema, codegenParameter);
|
||||
codegenParameter.setTypeProperties(parameterSchema);
|
||||
codegenParameter.setComposedSchemas(getComposedSchemas(parameterSchema));
|
||||
|
||||
if (Boolean.TRUE.equals(parameterSchema.getNullable())) { // use nullable defined in the spec
|
||||
codegenParameter.isNullable = true;
|
||||
@@ -6156,6 +6148,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
Schema ps = unaliasSchema(propertySchema, importMapping);
|
||||
ModelUtils.syncValidationProperties(ps, codegenParameter);
|
||||
codegenParameter.setTypeProperties(ps);
|
||||
codegenParameter.setComposedSchemas(getComposedSchemas(ps));
|
||||
if (ps.getPattern() != null) {
|
||||
codegenParameter.pattern = toRegularExpression(ps.getPattern());
|
||||
}
|
||||
@@ -6590,6 +6583,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
ModelUtils.syncValidationProperties(unaliasedSchema, codegenParameter);
|
||||
codegenParameter.setTypeProperties(unaliasedSchema);
|
||||
codegenParameter.setComposedSchemas(getComposedSchemas(unaliasedSchema));
|
||||
// TODO in the future switch al the below schema usages to unaliasedSchema
|
||||
// because it keeps models as refs and will not get their referenced schemas
|
||||
if (ModelUtils.isArraySchema(schema)) {
|
||||
@@ -7154,4 +7148,30 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
protected String getCollectionFormat(CodegenParameter codegenParameter) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private CodegenComposedSchemas getComposedSchemas(Schema schema) {
|
||||
if (!(schema instanceof ComposedSchema)) {
|
||||
return null;
|
||||
}
|
||||
ComposedSchema cs = (ComposedSchema) schema;
|
||||
return new CodegenComposedSchemas(
|
||||
getComposedProperties(cs.getAllOf(), "allOf"),
|
||||
getComposedProperties(cs.getOneOf(), "oneOf"),
|
||||
getComposedProperties(cs.getAnyOf(), "anyOf")
|
||||
);
|
||||
}
|
||||
|
||||
private List<CodegenProperty> getComposedProperties(List<Schema> xOfCollection, String collectionName) {
|
||||
if (xOfCollection == null) {
|
||||
return null;
|
||||
}
|
||||
List<CodegenProperty> xOf = new ArrayList<>();
|
||||
int i = 0;
|
||||
for (Schema xOfSchema: xOfCollection) {
|
||||
CodegenProperty cp = fromProperty(collectionName + "_" + String.valueOf(i), xOfSchema);
|
||||
xOf.add(cp);
|
||||
i += 1;
|
||||
}
|
||||
return xOf;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,11 @@ public interface IJsonSchemaValidationProperties {
|
||||
|
||||
void setIsAnyType(boolean isAnyType);
|
||||
|
||||
CodegenComposedSchemas getComposedSchemas();
|
||||
|
||||
void setComposedSchemas(CodegenComposedSchemas composedSchemas);
|
||||
|
||||
|
||||
/**
|
||||
* Syncs all the schema's type properties into the IJsonSchemaValidationProperties instance
|
||||
* for now this only supports types without format information
|
||||
|
||||
@@ -56,6 +56,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
public static final String USE_PLAY_WS = "usePlayWS";
|
||||
public static final String PLAY_VERSION = "playVersion";
|
||||
public static final String ASYNC_NATIVE = "asyncNative";
|
||||
public static final String CONFIG_KEY = "configKey";
|
||||
public static final String PARCELABLE_MODEL = "parcelableModel";
|
||||
public static final String USE_RUNTIME_EXCEPTION = "useRuntimeException";
|
||||
public static final String USE_REFLECTION_EQUALS_HASHCODE = "useReflectionEqualsHashCode";
|
||||
@@ -102,6 +103,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
protected boolean usePlayWS = false;
|
||||
protected String playVersion = PLAY_26;
|
||||
protected String microprofileFramework = MICROPROFILE_DEFAULT;
|
||||
protected String configKey = null;
|
||||
|
||||
protected boolean asyncNative = false;
|
||||
protected boolean parcelableModel = false;
|
||||
@@ -160,6 +162,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations));
|
||||
cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint (beta)", this.supportStreaming));
|
||||
cliOptions.add(CliOption.newString(GRADLE_PROPERTIES, "Append additional Gradle proeprties to the gradle.properties file"));
|
||||
cliOptions.add(CliOption.newString(CONFIG_KEY, "Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option."));
|
||||
|
||||
supportedLibraries.put(JERSEY1, "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 libraries instead.");
|
||||
supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x");
|
||||
@@ -281,6 +284,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
additionalProperties.put(MICROPROFILE_FRAMEWORK, microprofileFramework);
|
||||
|
||||
if (additionalProperties.containsKey(CONFIG_KEY)) {
|
||||
this.setConfigKey(additionalProperties.get(CONFIG_KEY).toString());
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(ASYNC_NATIVE)) {
|
||||
this.setAsyncNative(convertPropertyToBooleanAndWriteBack(ASYNC_NATIVE));
|
||||
}
|
||||
@@ -964,6 +971,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
this.microprofileFramework = microprofileFramework;
|
||||
}
|
||||
|
||||
public void setConfigKey(String configKey) {
|
||||
this.configKey = configKey;
|
||||
}
|
||||
|
||||
public void setParcelableModel(boolean parcelableModel) {
|
||||
this.parcelableModel = parcelableModel;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
public static enum PROVIDED_IN_LEVEL {none, root, any, platform}
|
||||
|
||||
private static final String DEFAULT_IMPORT_PREFIX = "./";
|
||||
private static final String DEFAULT_MODEL_IMPORT_DIRECTORY_PREFIX = "../";
|
||||
|
||||
public static final String NPM_REPOSITORY = "npmRepository";
|
||||
public static final String WITH_INTERFACES = "withInterfaces";
|
||||
@@ -634,7 +635,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
if (importMapping.containsKey(name)) {
|
||||
return importMapping.get(name);
|
||||
}
|
||||
return modelPackage() + "/" + toModelFilename(name).substring(DEFAULT_IMPORT_PREFIX.length());
|
||||
return DEFAULT_MODEL_IMPORT_DIRECTORY_PREFIX + modelPackage() + "/" + toModelFilename(name).substring(DEFAULT_IMPORT_PREFIX.length());
|
||||
}
|
||||
|
||||
public String getNpmRepository() {
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.github.jknack.handlebars.Template;
|
||||
import com.github.jknack.handlebars.context.FieldValueResolver;
|
||||
import com.github.jknack.handlebars.context.JavaBeanValueResolver;
|
||||
import com.github.jknack.handlebars.context.MapValueResolver;
|
||||
import com.github.jknack.handlebars.context.MethodValueResolver;
|
||||
import com.github.jknack.handlebars.helper.ConditionalHelpers;
|
||||
import com.github.jknack.handlebars.helper.StringHelpers;
|
||||
import com.github.jknack.handlebars.io.AbstractTemplateLoader;
|
||||
@@ -46,6 +47,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
|
||||
// We use this as a simple lookup for valid file name extensions. This adapter will inspect .mustache (built-in) and infer the relevant handlebars filename
|
||||
private final String[] canCompileFromExtensions = new String[]{".handlebars",".hbs",".mustache"};
|
||||
private boolean infiniteLoops = false;
|
||||
private boolean prettyPrint = false;
|
||||
|
||||
/**
|
||||
* Provides an identifier used to load the adapter. This could be a name, uuid, or any other string.
|
||||
@@ -71,7 +73,8 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
|
||||
.resolver(
|
||||
MapValueResolver.INSTANCE,
|
||||
JavaBeanValueResolver.INSTANCE,
|
||||
FieldValueResolver.INSTANCE)
|
||||
FieldValueResolver.INSTANCE,
|
||||
MethodValueResolver.INSTANCE)
|
||||
.build();
|
||||
|
||||
Handlebars handlebars = new Handlebars(loader);
|
||||
@@ -84,6 +87,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
|
||||
handlebars.registerHelpers(ConditionalHelpers.class);
|
||||
handlebars.registerHelpers(org.openapitools.codegen.templating.handlebars.StringHelpers.class);
|
||||
handlebars.setInfiniteLoops(infiniteLoops);
|
||||
handlebars.setPrettyPrint(prettyPrint);
|
||||
Template tmpl = handlebars.compile(templateFile);
|
||||
return tmpl.apply(context);
|
||||
}
|
||||
@@ -134,5 +138,9 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
|
||||
this.infiniteLoops = infiniteLoops;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setPrettyPrint(boolean prettyPrint) {
|
||||
this.prettyPrint = prettyPrint;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||
*/
|
||||
{{/appName}}
|
||||
|
||||
@RegisterRestClient
|
||||
@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}
|
||||
@RegisterProvider(ApiExceptionMapper.class)
|
||||
@Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}")
|
||||
public interface {{classname}} {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>enforce-maven</id>
|
||||
@@ -77,7 +77,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M4</version>
|
||||
<version>3.0.0-M5</version>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<property>
|
||||
@@ -109,7 +109,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -125,7 +125,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.10</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add_sources</id>
|
||||
@@ -156,7 +156,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
@@ -179,7 +179,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
@@ -200,7 +200,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
@@ -278,7 +278,7 @@
|
||||
<dependency>
|
||||
<groupId>io.swagger.parser.v3</groupId>
|
||||
<artifactId>swagger-parser-v3</artifactId>
|
||||
<version>2.0.23</version>
|
||||
<version>2.0.28</version>
|
||||
</dependency>
|
||||
{{/dynamicOperations}}
|
||||
{{#useBeanValidation}}
|
||||
@@ -295,7 +295,7 @@
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<version>5.4.1.Final</version>
|
||||
<version>5.4.3.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.el</groupId>
|
||||
@@ -335,19 +335,19 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<version>3.12.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<gson-fire-version>1.8.5</gson-fire-version>
|
||||
<swagger-core-version>1.6.2</swagger-core-version>
|
||||
<okhttp-version>4.9.1</okhttp-version>
|
||||
<gson-version>2.8.6</gson-version>
|
||||
<commons-lang3-version>3.11</commons-lang3-version>
|
||||
<swagger-core-version>1.6.3</swagger-core-version>
|
||||
<okhttp-version>4.9.2</okhttp-version>
|
||||
<gson-version>2.8.8</gson-version>
|
||||
<commons-lang3-version>3.12.0</commons-lang3-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
@@ -362,9 +362,9 @@
|
||||
<jakarta.el-version>3.0.3</jakarta.el-version>
|
||||
{{/performBeanValidation}}
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
<junit-version>4.13.1</junit-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -1,39 +1,14 @@
|
||||
# Generated by: https://openapi-generator.tech
|
||||
#
|
||||
|
||||
*.gem
|
||||
*.rbc
|
||||
/.config
|
||||
/coverage/
|
||||
/InstalledFiles
|
||||
/pkg/
|
||||
/spec/reports/
|
||||
/spec/examples.txt
|
||||
/test/tmp/
|
||||
/test/version_tmp/
|
||||
/docs/
|
||||
/lib/
|
||||
/bin/
|
||||
/.shards/
|
||||
*.dwarf
|
||||
|
||||
# Libraries don't need dependency lock
|
||||
# Dependencies will be locked in applications that use them
|
||||
/shard.lock
|
||||
|
||||
/tmp/
|
||||
|
||||
## Specific to RubyMotion:
|
||||
.dat*
|
||||
.repl_history
|
||||
build/
|
||||
|
||||
## Documentation cache and generated files:
|
||||
/.yardoc/
|
||||
/_yardoc/
|
||||
/doc/
|
||||
/rdoc/
|
||||
|
||||
## Environment normalization:
|
||||
/.bundle/
|
||||
/vendor/bundle
|
||||
/lib/bundler/man/
|
||||
|
||||
# for a library or gem, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# Gemfile.lock
|
||||
# .ruby-version
|
||||
# .ruby-gemset
|
||||
|
||||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
||||
.rvmrc
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
--color
|
||||
--require spec_helper
|
||||
@@ -1,148 +0,0 @@
|
||||
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
|
||||
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
||||
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||
DisabledByDefault: true
|
||||
Exclude:
|
||||
- '**/templates/**/*'
|
||||
- '**/vendor/**/*'
|
||||
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
||||
|
||||
# Prefer &&/|| over and/or.
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
|
||||
# Align `when` with `case`.
|
||||
Layout/CaseIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Align comments with method definitions.
|
||||
Layout/CommentIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/ElseAlignment:
|
||||
Enabled: true
|
||||
|
||||
Layout/EmptyLineAfterMagicComment:
|
||||
Enabled: true
|
||||
|
||||
# In a regular class definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundClassBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular method definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundMethodBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular module definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: true
|
||||
|
||||
Layout/FirstArgumentIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||
Style/HashSyntax:
|
||||
Enabled: false
|
||||
|
||||
# Method definitions after `private` or `protected` isolated calls need one
|
||||
# extra level of indentation.
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: true
|
||||
EnforcedStyle: indented_internal_methods
|
||||
|
||||
# Two spaces, no tabs (for indentation).
|
||||
Layout/IndentationWidth:
|
||||
Enabled: true
|
||||
|
||||
Layout/LeadingCommentSpace:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterColon:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundEqualsInParameterDefault:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundKeyword:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeFirstArg:
|
||||
Enabled: true
|
||||
|
||||
Style/DefWithParentheses:
|
||||
Enabled: true
|
||||
|
||||
# Defining a method with parameters needs parentheses.
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
EnforcedStyle: always
|
||||
|
||||
# Use `foo {}` not `foo{}`.
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `foo { bar }` not `foo {bar}`.
|
||||
Layout/SpaceInsideBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `{ a: 1 }` not `{a:1}`.
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceInsideParens:
|
||||
Enabled: true
|
||||
|
||||
# Check quotes usage according to lint rule below.
|
||||
#Style/StringLiterals:
|
||||
# Enabled: true
|
||||
# EnforcedStyle: single_quotes
|
||||
|
||||
# Detect hard tabs, no hard tabs.
|
||||
Layout/IndentationStyle:
|
||||
Enabled: true
|
||||
|
||||
# Blank lines should not have any spaces.
|
||||
Layout/TrailingEmptyLines:
|
||||
Enabled: true
|
||||
|
||||
# No trailing whitespace.
|
||||
Layout/TrailingWhitespace:
|
||||
Enabled: false
|
||||
|
||||
# Use quotes for string literals when they are enough.
|
||||
Style/RedundantPercentQ:
|
||||
Enabled: true
|
||||
|
||||
# Align `end` with the matching keyword or starting expression except for
|
||||
# assignments, where it should be aligned with the LHS.
|
||||
Layout/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
AutoCorrect: true
|
||||
|
||||
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
||||
Lint/RequireParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantReturn:
|
||||
Enabled: true
|
||||
AllowMultipleReturnValues: true
|
||||
|
||||
Style/Semicolon:
|
||||
Enabled: true
|
||||
AllowAsExpressionSeparator: true
|
||||
@@ -106,7 +106,7 @@ class _${{classname}}Serializer implements StructuredSerializer<{{classname}}> {
|
||||
{{/isContainer}}
|
||||
{{#isModel}}
|
||||
{{#isPrimitiveType}}
|
||||
{{! These are models that have nee manually marked as primitve via generator param. }}
|
||||
{{! These are models that have nee manually marked as primitive via generator param. }}
|
||||
result.{{{name}}} = valueDes;
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
|
||||
@@ -278,6 +278,9 @@ conf = {{{packageName}}}.Configuration(
|
||||
self.proxy = None
|
||||
"""Proxy URL
|
||||
"""
|
||||
self.no_proxy = None
|
||||
"""bypass proxy for host in the no_proxy list.
|
||||
"""
|
||||
self.proxy_headers = None
|
||||
"""Proxy headers
|
||||
"""
|
||||
|
||||
@@ -6,8 +6,10 @@ import logging
|
||||
import re
|
||||
import ssl
|
||||
from urllib.parse import urlencode
|
||||
|
||||
from urllib.parse import urlparse
|
||||
from urllib.request import proxy_bypass_environment
|
||||
import urllib3
|
||||
import ipaddress
|
||||
|
||||
from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||
|
||||
@@ -64,7 +66,7 @@ class RESTClientObject(object):
|
||||
maxsize = 4
|
||||
|
||||
# https pool manager
|
||||
if configuration.proxy:
|
||||
if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''):
|
||||
self.pool_manager = urllib3.ProxyManager(
|
||||
num_pools=pools_size,
|
||||
maxsize=maxsize,
|
||||
@@ -282,3 +284,55 @@ class RESTClientObject(object):
|
||||
_preload_content=_preload_content,
|
||||
_request_timeout=_request_timeout,
|
||||
body=body)
|
||||
|
||||
# end of class RESTClientObject
|
||||
def is_ipv4(target):
|
||||
""" Test if IPv4 address or not
|
||||
"""
|
||||
try:
|
||||
chk = ipaddress.IPv4Address(target)
|
||||
return True
|
||||
except ipaddress.AddressValueError:
|
||||
return False
|
||||
|
||||
def in_ipv4net(target, net):
|
||||
""" Test if target belongs to given IPv4 network
|
||||
"""
|
||||
try:
|
||||
nw = ipaddress.IPv4Network(net)
|
||||
ip = ipaddress.IPv4Address(target)
|
||||
if ip in nw:
|
||||
return True
|
||||
return False
|
||||
except ipaddress.AddressValueError:
|
||||
return False
|
||||
except ipaddress.NetmaskValueError:
|
||||
return False
|
||||
|
||||
def should_bypass_proxies(url, no_proxy=None):
|
||||
""" Yet another requests.should_bypass_proxies
|
||||
Test if proxies should not be used for a particular url.
|
||||
"""
|
||||
|
||||
parsed = urlparse(url)
|
||||
|
||||
# special cases
|
||||
if parsed.hostname in [None, '']:
|
||||
return True
|
||||
|
||||
# special cases
|
||||
if no_proxy in [None , '']:
|
||||
return False
|
||||
if no_proxy == '*':
|
||||
return True
|
||||
|
||||
no_proxy = no_proxy.lower().replace(' ','');
|
||||
entries = (
|
||||
host for host in no_proxy.split(',') if host
|
||||
)
|
||||
|
||||
if is_ipv4(parsed.hostname):
|
||||
for item in entries:
|
||||
if in_ipv4net(parsed.hostname, item):
|
||||
return True
|
||||
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
|
||||
|
||||
@@ -9,7 +9,7 @@ import { CustomHttpParameterCodec } from '../encoder';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
{{#imports}}
|
||||
import { {{classname}} } from '../model/models';
|
||||
import { {{ classname }} } from '{{ filename }}';
|
||||
{{/imports}}
|
||||
|
||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
||||
|
||||
@@ -29,6 +29,7 @@ import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -464,4 +465,26 @@ public class PythonClientTest {
|
||||
|
||||
}
|
||||
|
||||
@Test(description = "tests NoProxyPyClient")
|
||||
public void testNoProxyPyClient() throws Exception {
|
||||
|
||||
final String gen = "python";
|
||||
final String spec = "src/test/resources/3_0/petstore.yaml";
|
||||
|
||||
File output = Files.createTempDirectory("test").toFile();
|
||||
final CodegenConfigurator configurator = new CodegenConfigurator()
|
||||
.setGeneratorName(gen)
|
||||
.setInputSpec(spec)
|
||||
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
|
||||
final ClientOptInput clientOptInput = configurator.toClientOptInput();
|
||||
DefaultGenerator generator = new DefaultGenerator();
|
||||
List<File> files = generator.opts(clientOptInput).generate();
|
||||
|
||||
for (String f : new String[] { "openapi_client/configuration.py", "openapi_client/rest.py" } ) {
|
||||
TestUtils.ensureContainsFile(files, output, f);
|
||||
Path p = output.toPath().resolve(f);
|
||||
TestUtils.assertFileContains(p, "no_proxy");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ public class TypeScriptAngularClientCodegenTest {
|
||||
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("test", schema);
|
||||
codegen.setOpenAPI(openAPI);
|
||||
|
||||
Assert.assertEquals(codegen.toModelImport(modelName), "model/foo-response-links");
|
||||
Assert.assertEquals(codegen.toModelImport(modelName), "../model/foo-response-links");
|
||||
Assert.assertEquals(codegen.toModelFilename(modelName), "./foo-response-links");
|
||||
}
|
||||
|
||||
@@ -258,4 +258,13 @@ public class TypeScriptAngularClientCodegenTest {
|
||||
Assert.assertEquals(codegen.toParamName("valid_id"), "ValidId");
|
||||
Assert.assertEquals(codegen.toParamName("illegal-id+"), "IllegalId");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCorrectlyProducesImportsWithImportMapping() {
|
||||
TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen();
|
||||
final String importedModel = "SharedApiModel";
|
||||
final String importName = "@lib/custom/model";
|
||||
codegen.importMapping().put(importedModel, importName);
|
||||
Assert.assertEquals(codegen.toModelImport(importedModel), importName);
|
||||
}
|
||||
}
|
||||
|
||||
72
pom.xml
72
pom.xml
@@ -10,7 +10,7 @@
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
@@ -1172,7 +1172,6 @@
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/kotlin-springboot</module>
|
||||
<module>samples/server/petstore/jaxrs/jersey2</module>
|
||||
<module>samples/server/petstore/jaxrs/jersey2-useTags</module>
|
||||
<module>samples/server/petstore/spring-mvc</module>
|
||||
@@ -1230,7 +1229,6 @@
|
||||
<module>samples/server/petstore/scala-akka-http-server</module>
|
||||
<module>samples/server/petstore/scalatra</module>
|
||||
<module>samples/server/petstore/scala-finch</module>
|
||||
<!--<module>samples/server/petstore/kotlin/vertx</module>-->
|
||||
</modules>
|
||||
</profile>
|
||||
<!-- node 3 tests in CircleCI -->
|
||||
@@ -1247,6 +1245,33 @@
|
||||
<module>samples/client/petstore/python</module>
|
||||
<module>samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent</module>
|
||||
<module>samples/openapi3/client/petstore/python</module>
|
||||
<!-- TODO comment out below when the test for typescript-nestjs is ready
|
||||
<module>samples/client/petstore/typescript-nestjs-v6-provided-in-root</module>-->
|
||||
<!-- comment out due to error `npm run build`
|
||||
<module>samples/client/petstore/typescript-jquery/npm</module>-->
|
||||
<module>samples/client/petstore/typescript-angular-v7-provided-in-root</module>
|
||||
<module>samples/client/petstore/typescript-angular-v11-provided-in-root</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/jquery</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/jquery</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/object_params</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/object_params</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/inversify</module>
|
||||
<!-- comment out due to failure in travis ci
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/inversify</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/deno</module>-->
|
||||
<module>samples/client/petstore/typescript-fetch/builds/default</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
||||
<module>samples/client/petstore/typescript-fetch/tests/default</module>
|
||||
<module>samples/client/petstore/typescript-node/npm</module>
|
||||
<module>samples/client/petstore/typescript-rxjs/builds/with-npm-version</module>
|
||||
<module>samples/client/petstore/typescript-axios/builds/with-npm-version</module>
|
||||
<module>samples/client/petstore/typescript-axios/tests/default</module>
|
||||
<module>samples/client/petstore/javascript-flowtyped</module>
|
||||
<module>samples/client/petstore/javascript-es6</module>
|
||||
<module>samples/client/petstore/javascript-promise-es6</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<!-- other tests in CircleCI -->
|
||||
@@ -1290,39 +1315,6 @@
|
||||
<module>samples/client/petstore/java/microprofile-rest-client</module>
|
||||
<module>samples/client/petstore/java/apache-httpclient</module>
|
||||
<module>samples/client/petstore/groovy</module>
|
||||
<!-- test non-java projects -->
|
||||
<module>samples/client/petstore/go</module>
|
||||
<module>samples/openapi3/client/petstore/go</module>
|
||||
<module>samples/client/petstore/javascript-flowtyped</module>
|
||||
<module>samples/client/petstore/javascript-es6</module>
|
||||
<module>samples/client/petstore/javascript-promise-es6</module>
|
||||
<module>samples/server/petstore/go-api-server</module>
|
||||
<module>samples/server/petstore/go-gin-api-server</module>
|
||||
<module>samples/server/petstore/go-echo-server</module>
|
||||
<!-- TODO comment out below when the test for typescript-nestjs is ready
|
||||
<module>samples/client/petstore/typescript-nestjs-v6-provided-in-root</module>-->
|
||||
<!-- comment out due to error `npm run build`
|
||||
<module>samples/client/petstore/typescript-jquery/npm</module>-->
|
||||
<module>samples/client/petstore/typescript-angular-v7-provided-in-root</module>
|
||||
<module>samples/client/petstore/typescript-angular-v11-provided-in-root</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/jquery</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/jquery</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/object_params</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/object_params</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/inversify</module>
|
||||
<!-- comment out due to failure in travis ci
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/inversify</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/deno</module>-->
|
||||
<module>samples/client/petstore/typescript-fetch/builds/default</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
||||
<module>samples/client/petstore/typescript-fetch/tests/default</module>
|
||||
<module>samples/client/petstore/typescript-node/npm</module>
|
||||
<module>samples/client/petstore/typescript-rxjs/builds/with-npm-version</module>
|
||||
<module>samples/client/petstore/typescript-axios/builds/with-npm-version</module>
|
||||
<module>samples/client/petstore/typescript-axios/tests/default</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<!-- test with JDK9 in Shippable CI -->
|
||||
@@ -1356,6 +1348,8 @@
|
||||
<module>samples/client/petstore/kotlin-threetenbp</module>
|
||||
<module>samples/client/petstore/kotlin-uppercase-enum</module>
|
||||
<!-- servers -->
|
||||
<module>samples/server/petstore/kotlin-springboot</module>
|
||||
<!--<module>samples/server/petstore/kotlin/vertx</module>-->
|
||||
<!--<module>samples/server/petstore/erlang-server</module>-->
|
||||
</modules>
|
||||
</profile>
|
||||
@@ -1388,6 +1382,12 @@
|
||||
<!--<module>samples/client/petstore/haskell-http-client</module>-->
|
||||
<!-- servers -->
|
||||
<!--<module>samples/server/petstore/haskell-servant</module>-->
|
||||
<!-- test Go projects -->
|
||||
<module>samples/client/petstore/go</module>
|
||||
<module>samples/openapi3/client/petstore/go</module>
|
||||
<module>samples/server/petstore/go-api-server</module>
|
||||
<module>samples/server/petstore/go-gin-api-server</module>
|
||||
<module>samples/server/petstore/go-echo-server</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -50,7 +50,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>enforce-maven</id>
|
||||
@@ -70,7 +70,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M4</version>
|
||||
<version>3.0.0-M5</version>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<property>
|
||||
@@ -102,7 +102,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -118,7 +118,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.10</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add_sources</id>
|
||||
@@ -149,7 +149,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
@@ -172,7 +172,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
@@ -193,7 +193,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
@@ -272,23 +272,23 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<version>3.12.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<java.version>1.7</java.version>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<gson-fire-version>1.8.5</gson-fire-version>
|
||||
<swagger-core-version>1.6.2</swagger-core-version>
|
||||
<okhttp-version>4.9.1</okhttp-version>
|
||||
<gson-version>2.8.6</gson-version>
|
||||
<commons-lang3-version>3.11</commons-lang3-version>
|
||||
<swagger-core-version>1.6.3</swagger-core-version>
|
||||
<okhttp-version>4.9.2</okhttp-version>
|
||||
<gson-version>2.8.8</gson-version>
|
||||
<commons-lang3-version>3.12.0</commons-lang3-version>
|
||||
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
|
||||
<threetenbp-version>1.5.0</threetenbp-version>
|
||||
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
|
||||
<junit-version>4.13.1</junit-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
45
samples/client/petstore/crystal/.gitignore
vendored
45
samples/client/petstore/crystal/.gitignore
vendored
@@ -1,39 +1,14 @@
|
||||
# Generated by: https://openapi-generator.tech
|
||||
#
|
||||
|
||||
*.gem
|
||||
*.rbc
|
||||
/.config
|
||||
/coverage/
|
||||
/InstalledFiles
|
||||
/pkg/
|
||||
/spec/reports/
|
||||
/spec/examples.txt
|
||||
/test/tmp/
|
||||
/test/version_tmp/
|
||||
/docs/
|
||||
/lib/
|
||||
/bin/
|
||||
/.shards/
|
||||
*.dwarf
|
||||
|
||||
# Libraries don't need dependency lock
|
||||
# Dependencies will be locked in applications that use them
|
||||
/shard.lock
|
||||
|
||||
/tmp/
|
||||
|
||||
## Specific to RubyMotion:
|
||||
.dat*
|
||||
.repl_history
|
||||
build/
|
||||
|
||||
## Documentation cache and generated files:
|
||||
/.yardoc/
|
||||
/_yardoc/
|
||||
/doc/
|
||||
/rdoc/
|
||||
|
||||
## Environment normalization:
|
||||
/.bundle/
|
||||
/vendor/bundle
|
||||
/lib/bundler/man/
|
||||
|
||||
# for a library or gem, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# Gemfile.lock
|
||||
# .ruby-version
|
||||
# .ruby-gemset
|
||||
|
||||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
||||
.rvmrc
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.3.0-SNAPSHOT
|
||||
5.3.1-SNAPSHOT
|
||||
@@ -1,2 +0,0 @@
|
||||
--color
|
||||
--require spec_helper
|
||||
@@ -1,148 +0,0 @@
|
||||
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
|
||||
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
||||
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||
DisabledByDefault: true
|
||||
Exclude:
|
||||
- '**/templates/**/*'
|
||||
- '**/vendor/**/*'
|
||||
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
||||
|
||||
# Prefer &&/|| over and/or.
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
|
||||
# Align `when` with `case`.
|
||||
Layout/CaseIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Align comments with method definitions.
|
||||
Layout/CommentIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/ElseAlignment:
|
||||
Enabled: true
|
||||
|
||||
Layout/EmptyLineAfterMagicComment:
|
||||
Enabled: true
|
||||
|
||||
# In a regular class definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundClassBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular method definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundMethodBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular module definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: true
|
||||
|
||||
Layout/FirstArgumentIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||
Style/HashSyntax:
|
||||
Enabled: false
|
||||
|
||||
# Method definitions after `private` or `protected` isolated calls need one
|
||||
# extra level of indentation.
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: true
|
||||
EnforcedStyle: indented_internal_methods
|
||||
|
||||
# Two spaces, no tabs (for indentation).
|
||||
Layout/IndentationWidth:
|
||||
Enabled: true
|
||||
|
||||
Layout/LeadingCommentSpace:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterColon:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundEqualsInParameterDefault:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundKeyword:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeFirstArg:
|
||||
Enabled: true
|
||||
|
||||
Style/DefWithParentheses:
|
||||
Enabled: true
|
||||
|
||||
# Defining a method with parameters needs parentheses.
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
EnforcedStyle: always
|
||||
|
||||
# Use `foo {}` not `foo{}`.
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `foo { bar }` not `foo {bar}`.
|
||||
Layout/SpaceInsideBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `{ a: 1 }` not `{a:1}`.
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceInsideParens:
|
||||
Enabled: true
|
||||
|
||||
# Check quotes usage according to lint rule below.
|
||||
#Style/StringLiterals:
|
||||
# Enabled: true
|
||||
# EnforcedStyle: single_quotes
|
||||
|
||||
# Detect hard tabs, no hard tabs.
|
||||
Layout/IndentationStyle:
|
||||
Enabled: true
|
||||
|
||||
# Blank lines should not have any spaces.
|
||||
Layout/TrailingEmptyLines:
|
||||
Enabled: true
|
||||
|
||||
# No trailing whitespace.
|
||||
Layout/TrailingWhitespace:
|
||||
Enabled: false
|
||||
|
||||
# Use quotes for string literals when they are enough.
|
||||
Style/RedundantPercentQ:
|
||||
Enabled: true
|
||||
|
||||
# Align `end` with the matching keyword or starting expression except for
|
||||
# assignments, where it should be aligned with the LHS.
|
||||
Layout/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
AutoCorrect: true
|
||||
|
||||
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
||||
Lint/RequireParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantReturn:
|
||||
Enabled: true
|
||||
AllowMultipleReturnValues: true
|
||||
|
||||
Style/Semicolon:
|
||||
Enabled: true
|
||||
AllowAsExpressionSeparator: true
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
language: crystal
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
# load modules
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
# Dependencies
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
require "uri"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
require "uri"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
require "uri"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
#Generated by: https://openapi-generator.tech
|
||||
#OpenAPI Generator version: 5.3.0-SNAPSHOT
|
||||
#OpenAPI Generator version: 5.3.1-SNAPSHOT
|
||||
#
|
||||
|
||||
require "json"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user