Skip to content

Commit

Permalink
Merge pull request #3 from OpenAPITools/master
Browse files Browse the repository at this point in the history
merge latest openapi
  • Loading branch information
bflamand committed Dec 10, 2020
2 parents 7b42777 + d20d944 commit ea5a5eb
Show file tree
Hide file tree
Showing 2,152 changed files with 66,844 additions and 9,895 deletions.
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ samples/client/petstore/erlang-proper/rebar.lock
samples/server/petstore/erlang-server/_build/
samples/server/petstore/erlang-server/rebar.lock

# dart
samples/client/petstore/dart/petstore/packages
samples/client/petstore/dart/flutter_petstore/test/packages
samples/client/petstore/dart/petstore/test/packages
**/.dart_tool
# Dart
**/dart*/**/.dart_tool
**/dart*/**/.packages
**/dart*/**/pubspec.lock
# Dart dio
**/dart*/**/*.g.dart
# Dart jaguar
**/dart*/**/*.jser.dart
**/dart*/**/*.jretro.dart

# JS
samples/client/petstore/javascript-es6/package-lock.json
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ before_install:
fi;
- pushd .; cd website; yarn install; popd
# install Deno
- curl -fsSL https://deno.land/x/install/install.sh | sh -s v1.1.2
- sh -s v1.1.2 < ./CI/deno_install.sh
- export PATH="$HOME/.deno/bin:$PATH"

install:
Expand All @@ -140,6 +140,8 @@ install:
script:
# fail fast
- set -e
# fail if the test files have changes
- bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml
# fail if templates/generators contain carriage return '\r'
- /bin/bash ./bin/utils/detect_carriage_return.sh
# fail if generators contain merge conflicts
Expand Down
52 changes: 52 additions & 0 deletions CI/deno_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh
# Copyright 2019 the Deno authors. All rights reserved. MIT license.
# TODO(everyone): Keep this script simple and easily auditable.

set -e

if ! command -v unzip >/dev/null; then
echo "Error: unzip is required to install Deno (see: https://github.com/denoland/deno_install#unzip-is-required)." 1>&2
exit 1
fi

if [ "$OS" = "Windows_NT" ]; then
target="x86_64-pc-windows-msvc"
else
case $(uname -s) in
Darwin) target="x86_64-apple-darwin" ;;
*) target="x86_64-unknown-linux-gnu" ;;
esac
fi

if [ $# -eq 0 ]; then
deno_uri="https://github.com/denoland/deno/releases/latest/download/deno-${target}.zip"
else
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno-${target}.zip"
fi

deno_install="${DENO_INSTALL:-$HOME/.deno}"
bin_dir="$deno_install/bin"
exe="$bin_dir/deno"

if [ ! -d "$bin_dir" ]; then
mkdir -p "$bin_dir"
fi

curl --fail --location --progress-bar --output "$exe.zip" "$deno_uri"
unzip -d "$bin_dir" -o "$exe.zip"
chmod +x "$exe"
rm "$exe.zip"

echo "Deno was installed successfully to $exe"
if command -v deno >/dev/null; then
echo "Run 'deno --help' to get started"
else
case $SHELL in
/bin/zsh) shell_profile=".zshrc" ;;
*) shell_profile=".bash_profile" ;;
esac
echo "Manually add the directory to your \$HOME/$shell_profile (or similar)"
echo " export DENO_INSTALL=\"$deno_install\""
echo " export PATH=\"\$DENO_INSTALL/bin:\$PATH\""
echo "Run '$exe --help' to get started"
fi
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [TravelTime platform](https://www.traveltimeplatform.com/)
- [TribalScale](https://www.tribalscale.com)
- [TUI InfoTec GmbH](http://www.tui-infotec.com/)
- [Twitter](https://twitter.com)
- [unblu inc.](https://www.unblu.com/)
- [Veamly](https://www.veamly.com/)
- [wbt-solutions](https://www.wbt-solutions.de/)
Expand Down Expand Up @@ -784,6 +785,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2020-09-25 - [Generate OpenAPI Angular Client](https://medium.com/@pguso/generate-openapi-angular-client-8c9288e8bbd4) by [Patric](https://medium.com/@pguso)
- 2020-10-24 - [Working with Microsoft Identity - React Native Client](https://www.josephguadagno.net/2020/10/24/working-with-microsoft-identity-react-native-client) by [Joseph Guadagno](https://www.josephguadagno.net/)
- 2020-10-31 - [[B2] OpenAPI Specification으로 타입-세이프하게 API 개발하기: 희망편 VS 절망편](https://www.youtube.com/watch?v=J4JHLESAiFk) by 최태건 at [FEConf 2020](https://2020.feconf.kr/)
- 2020-11-05 - [Automated REST-Api Code Generation: Wie IT-Systeme miteinander sprechen](https://www.massiveart.com/blog/automated-rest-api-code-generation-wie-it-systeme-miteinander-sprechen) by Stefan Rottensteiner at [MASSIVE ART Blog](https://www.massiveart.com/blog)
- 2020-12-01 - [OpenAPI GeneratorでGoのAPIサーバー/クライアントコードを自動生成する](https://qiita.com/saki-engineering/items/b20d8b6074c4da9664a5) by [@saki-engineering](https://qiita.com/saki-engineering)

## [6 - About Us](#table-of-contents)

Expand Down Expand Up @@ -1026,7 +1029,7 @@ OpenAPI Generator is a fork of [Swagger Codegen](https://github.com/swagger-api/
- [Daniel](https://github.com/Danielku15)
- [Emiliano Bonassi](https://github.com/emilianobonassi)
- [Erik Timmers](https://github.com/eriktim)
- [Esteban Marin](https://github.com/macjohnny)
- [Esteban Gehring](https://github.com/macjohnny)
- [Gustavo Paz](https://github.com/gustavoapaz)
- [Javier Velilla](https://github.com/jvelilla)
- [Jean-François Côté](https://github.com/JFCote)
Expand Down
6 changes: 6 additions & 0 deletions bin/configs/dart-dio-petstore-client-lib-fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart-dio
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-dio
additionalProperties:
hideGenerationTimestamp: "true"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generatorName: dart-dio
outputDir: samples/client/petstore/dart-dio
outputDir: samples/client/petstore/dart-dio/petstore_client_lib
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-dio
additionalProperties:
Expand Down
6 changes: 6 additions & 0 deletions bin/configs/dart-dio-petstore-client-lib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart-dio
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-dio
additionalProperties:
hideGenerationTimestamp: "true"
6 changes: 6 additions & 0 deletions bin/configs/dart-petstore-client-lib-fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart2
additionalProperties:
hideGenerationTimestamp: "true"
File renamed without changes.
6 changes: 6 additions & 0 deletions bin/configs/dart-petstore-client-lib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/dart2
additionalProperties:
hideGenerationTimestamp: "true"
9 changes: 9 additions & 0 deletions bin/configs/java-okhttp-gson-dynamicOperations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: java
outputDir: samples/client/petstore/java/okhttp-gson-dynamicOperations
library: okhttp-gson
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-okhttp-gson-dynamicoperations
hideGenerationTimestamp: "true"
dynamicOperations: "true"
4 changes: 4 additions & 0 deletions bin/configs/powershell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ additionalProperties:
powershellGalleryUrl: https://www.powershellgallery.com/packages/PSPetstore
apiNamePrefix: PS
powershellVersion: "5.0"
licenseUri: https://www.apache.org/licenses/LICENSE-2.0.txt
projectUri: https://github.com/OpenAPITools/openapi-generator
releaseNotes: 'This is a sample project'
tags: 'PetStore,powershell,sdk'
57 changes: 57 additions & 0 deletions bin/utils/detect_test_file_changes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env ruby
# ruby script to detect changes in test-related files
require 'yaml'
require 'digest'

hash = Digest::SHA256.hexdigest("xyz")

filename= ARGV[0]

if !filename
puts "Usage: #{$0} filename"
exit 1
end

if !File.file? filename
warn "Error. #{filename} doesn't exist."
exit 1
end

mismatch = 0
count = 0

test_files = YAML.load_file(filename)
test_files.each do |test_file|
count = count + 1
# file still exists?
if !File.file? test_file['filename']
warn "Error. Provided test file `#{test_file['filename']}` doesn't exist."
mismatch = mismatch + 1
end

# check sha256 hash
sha256 = Digest::SHA256.hexdigest(File.read(test_file['filename']))
if test_file['sha256'] != sha256
warn "Looks like #{test_file['filename']} has been modified as its SHA256 `#{sha256}` is not the same as the one in the record: #{test_file['sha256']}"
mismatch = mismatch + 1
else
# no change to the test file
end
end

if mismatch > 0
warn "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
warn "There are #{mismatch} mismatch. Please review the test files to ensure it has not been deleted/regenerated."
warn "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
else
puts "OK. All matched!"
end

if count == 0
warn "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
warn "Looks like the test file list in #{filename} is empty! Please check!"
warn "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
end

6 changes: 6 additions & 0 deletions bin/utils/test_file_list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# csharp-netcore test files and image for upload
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
sha256: b74ef9eefa4b41fd3233e083fe2355babf25a77f9073d28e1aa81ae2e0a5f1d0
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
19 changes: 19 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,25 @@ jobs:
- ~/.stack
- /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work
- ~/R
# save "default" cache using the key "source-v2-"
- save_cache:
key: source-v2-
paths:
# This is a broad list of cache paths to include many possible development environments
# You can probably delete some of these entries
- vendor/bundle
- ~/virtualenvs
- ~/.m2
- ~/.ivy2
- ~/.sbt
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.cache/bower
- ".git"
- ~/.stack
- /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work
- ~/R
# Teardown
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# Save test results
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/ada-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.</dd></dl>|true|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|projectName|GNAT project name| |defaultProject|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/ada.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.</dd></dl>|true|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|projectName|GNAT project name| |defaultProject|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
Expand Down
Loading

0 comments on commit ea5a5eb

Please sign in to comment.