Skip to content

Commit 1661128

Browse files
Merge remote-tracking branch 'origin' into go-experimental-free-form
2 parents 48fac66 + 165ad45 commit 1661128

File tree

724 files changed

+10550
-19194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

724 files changed

+10550
-19194
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
6464

6565
| | Languages/Frameworks |
6666
|-|-|
67-
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
67+
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
6868
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra)
6969
**API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**
7070
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
@@ -814,6 +814,7 @@ Here is a list of template creators:
814814
* Rust (rust-server): @metaswitch
815815
* Scala (scalaz & http4s): @tbrown1979
816816
* Scala (Akka): @cchafer
817+
* Scala (sttp): @chameleon82
817818
* Swift: @tkqubo
818819
* Swift 3: @hexelon
819820
* Swift 4: @ehyche

bin/openapi3/python-flask-petstore-python2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ then
2626
fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
29-
input=modules/openapi-generator/src/test/resources/3_0/petstore.yaml
29+
input=modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml
3030
out_folder=samples/openapi3/server/petstore/python-flask-python2
3131
resources=modules/openapi-generator/src/main/resources/python-flask
3232

bin/openapi3/python-flask-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ then
2626
fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
29-
input=modules/openapi-generator/src/test/resources/3_0/petstore.yaml
29+
input=modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml
3030
out_folder=samples/openapi3/server/petstore/python-flask
3131
resources=modules/openapi-generator/src/main/resources/python-flask
3232

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
while [ -h "$SCRIPT" ] ; do
7+
ls=`ls -ld "$SCRIPT"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
SCRIPT="$link"
11+
else
12+
SCRIPT=`dirname "$SCRIPT"`/"$link"
13+
fi
14+
done
15+
16+
if [ ! -d "${APP_DIR}" ]; then
17+
APP_DIR=`dirname "$SCRIPT"`/..
18+
APP_DIR=`cd "${APP_DIR}"; pwd`
19+
fi
20+
21+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
22+
23+
if [ ! -f "$executable" ]
24+
then
25+
mvn clean package
26+
fi
27+
28+
# if you've executed sbt assembly previously it will use that instead.
29+
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
30+
ags="generate --artifact-id 'scala-sttp-petstore' -t modules/openapi-generator/src/main/resources/scala-sttp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-sttp -o samples/openapi3/client/petstore/scala-sttp $@"
31+
32+
java $JAVA_OPTS -jar $executable $ags

bin/openapi3/windows/python-experimental-petstore.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\openapi3\client\petstore\python-experimental --additional-properties packageName=petstore_api
8+
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -g python-experimental -o samples\openapi3\client\petstore\python-experimental --additional-properties packageName=petstore_api
99

1010
java %JAVA_OPTS% -jar %executable% %ags%
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
2+
3+
If Not Exist %executable% (
4+
mvn clean package
5+
)
6+
7+
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
8+
set ags=generate --artifact-id "scala-sttp-petstore" -t modules\openapi-generator\src\main\resources\scala-sttp -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g scala-sttp -o samples\openapi3\client\petstore\scala-sttp
9+
10+
java %JAVA_OPTS% -jar %executable% %ags%

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The following generators are available:
5454
* [scala-akka](generators/scala-akka.md)
5555
* [scala-gatling](generators/scala-gatling.md)
5656
* [scala-httpclient-deprecated (deprecated)](generators/scala-httpclient-deprecated.md)
57+
* [scala-sttp (beta)](generators/scala-sttp.md)
5758
* [scalaz](generators/scalaz.md)
5859
* [swift2-deprecated (deprecated)](generators/swift2-deprecated.md)
5960
* [swift3-deprecated (deprecated)](generators/swift3-deprecated.md)

docs/generators/javascript-flowtyped.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_label: javascript-flowtyped
99
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
1010
|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat|
1111
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase|
12-
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
12+
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
1313
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
1414
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
1515
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|

docs/generators/scala-sttp.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
title: Config Options for scala-sttp
3+
sidebar_label: scala-sttp
4+
---
5+
6+
| Option | Description | Values | Default |
7+
| ------ | ----------- | ------ | ------- |
8+
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
9+
|apiPackage|package for generated api classes| |null|
10+
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
11+
|mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client|
12+
|modelPackage|package for generated models| |null|
13+
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
14+
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
15+
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
16+
|sourceFolder|source folder for generated code| |null|
17+
18+
## IMPORT MAPPING
19+
20+
| Type/Alias | Imports |
21+
| ---------- | ------- |
22+
|Array|java.util.List|
23+
|ArrayList|java.util.ArrayList|
24+
|BigDecimal|java.math.BigDecimal|
25+
|Date|java.util.Date|
26+
|DateTime|org.joda.time.DateTime|
27+
|File|java.io.File|
28+
|HashMap|java.util.HashMap|
29+
|ListBuffer|scala.collection.mutable.ListBuffer|
30+
|ListSet|scala.collection.immutable.ListSet|
31+
|LocalDate|org.joda.time.*|
32+
|LocalDateTime|org.joda.time.*|
33+
|LocalTime|org.joda.time.*|
34+
|Timestamp|java.sql.Timestamp|
35+
|URI|java.net.URI|
36+
|UUID|java.util.UUID|
37+
38+
39+
## INSTANTIATION TYPES
40+
41+
| Type/Alias | Instantiated By |
42+
| ---------- | --------------- |
43+
|array|ListBuffer|
44+
|map|Map|
45+
|set|Set|
46+
47+
48+
## LANGUAGE PRIMITIVES
49+
50+
<ul class="column-ul">
51+
<li>Any</li>
52+
<li>Array</li>
53+
<li>Boolean</li>
54+
<li>Double</li>
55+
<li>Float</li>
56+
<li>Int</li>
57+
<li>List</li>
58+
<li>Long</li>
59+
<li>Map</li>
60+
<li>Object</li>
61+
<li>Seq</li>
62+
<li>String</li>
63+
<li>boolean</li>
64+
</ul>
65+
66+
## RESERVED WORDS
67+
68+
<ul class="column-ul">
69+
<li>abstract</li>
70+
<li>case</li>
71+
<li>catch</li>
72+
<li>class</li>
73+
<li>def</li>
74+
<li>do</li>
75+
<li>else</li>
76+
<li>extends</li>
77+
<li>false</li>
78+
<li>final</li>
79+
<li>finally</li>
80+
<li>for</li>
81+
<li>forsome</li>
82+
<li>if</li>
83+
<li>implicit</li>
84+
<li>import</li>
85+
<li>lazy</li>
86+
<li>match</li>
87+
<li>new</li>
88+
<li>null</li>
89+
<li>object</li>
90+
<li>override</li>
91+
<li>package</li>
92+
<li>private</li>
93+
<li>protected</li>
94+
<li>return</li>
95+
<li>sealed</li>
96+
<li>super</li>
97+
<li>this</li>
98+
<li>throw</li>
99+
<li>trait</li>
100+
<li>true</li>
101+
<li>try</li>
102+
<li>type</li>
103+
<li>val</li>
104+
<li>var</li>
105+
<li>while</li>
106+
<li>with</li>
107+
<li>yield</li>
108+
</ul>
109+
110+
## FEATURE SET
111+
112+
113+
### Client Modification Feature
114+
| Name | Supported | Defined By |
115+
| ---- | --------- | ---------- |
116+
|BasePath|✓|ToolingExtension
117+
|Authorizations|✗|ToolingExtension
118+
|UserAgent|✓|ToolingExtension
119+
120+
### Data Type Feature
121+
| Name | Supported | Defined By |
122+
| ---- | --------- | ---------- |
123+
|Custom|✗|OAS2,OAS3
124+
|Int32|✓|OAS2,OAS3
125+
|Int64|✓|OAS2,OAS3
126+
|Float|✓|OAS2,OAS3
127+
|Double|✓|OAS2,OAS3
128+
|Decimal|✓|ToolingExtension
129+
|String|✓|OAS2,OAS3
130+
|Byte|✓|OAS2,OAS3
131+
|Binary|✓|OAS2,OAS3
132+
|Boolean|✓|OAS2,OAS3
133+
|Date|✓|OAS2,OAS3
134+
|DateTime|✓|OAS2,OAS3
135+
|Password|✓|OAS2,OAS3
136+
|File|✓|OAS2
137+
|Array|✓|OAS2,OAS3
138+
|Maps|✓|ToolingExtension
139+
|CollectionFormat|✓|OAS2
140+
|CollectionFormatMulti|✓|OAS2
141+
|Enum|✓|OAS2,OAS3
142+
|ArrayOfEnum|✓|ToolingExtension
143+
|ArrayOfModel|✓|ToolingExtension
144+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
145+
|ArrayOfCollectionOfModel|✓|ToolingExtension
146+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
147+
|MapOfEnum|✓|ToolingExtension
148+
|MapOfModel|✓|ToolingExtension
149+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
150+
|MapOfCollectionOfModel|✓|ToolingExtension
151+
|MapOfCollectionOfEnum|✓|ToolingExtension
152+
153+
### Documentation Feature
154+
| Name | Supported | Defined By |
155+
| ---- | --------- | ---------- |
156+
|Readme|✓|ToolingExtension
157+
|Model|✓|ToolingExtension
158+
|Api|✓|ToolingExtension
159+
160+
### Global Feature
161+
| Name | Supported | Defined By |
162+
| ---- | --------- | ---------- |
163+
|Host|✓|OAS2,OAS3
164+
|BasePath|✓|OAS2,OAS3
165+
|Info|✓|OAS2,OAS3
166+
|Schemes|✗|OAS2,OAS3
167+
|PartialSchemes|✓|OAS2,OAS3
168+
|Consumes|✓|OAS2
169+
|Produces|✓|OAS2
170+
|ExternalDocumentation|✓|OAS2,OAS3
171+
|Examples|✓|OAS2,OAS3
172+
|XMLStructureDefinitions|✗|OAS2,OAS3
173+
|MultiServer|✗|OAS3
174+
|ParameterizedServer|✗|OAS3
175+
|ParameterStyling|✗|OAS3
176+
|Callbacks|✗|OAS3
177+
|LinkObjects|✗|OAS3
178+
179+
### Parameter Feature
180+
| Name | Supported | Defined By |
181+
| ---- | --------- | ---------- |
182+
|Path|✓|OAS2,OAS3
183+
|Query|✓|OAS2,OAS3
184+
|Header|✓|OAS2,OAS3
185+
|Body|✓|OAS2
186+
|FormUnencoded|✓|OAS2
187+
|FormMultipart|✓|OAS2
188+
|Cookie|✗|OAS3
189+
190+
### Schema Support Feature
191+
| Name | Supported | Defined By |
192+
| ---- | --------- | ---------- |
193+
|Simple|✓|OAS2,OAS3
194+
|Composite|✓|OAS2,OAS3
195+
|Polymorphism|✗|OAS2,OAS3
196+
|Union|✗|OAS3
197+
198+
### Security Feature
199+
| Name | Supported | Defined By |
200+
| ---- | --------- | ---------- |
201+
|BasicAuth|✓|OAS2,OAS3
202+
|ApiKey|✓|OAS2,OAS3
203+
|OpenIDConnect|✗|OAS3
204+
|BearerToken|✓|OAS3
205+
|OAuth2_Implicit|✗|OAS2,OAS3
206+
|OAuth2_Password|✗|OAS2,OAS3
207+
|OAuth2_ClientCredentials|✗|OAS2,OAS3
208+
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
209+
210+
### Wire Format Feature
211+
| Name | Supported | Defined By |
212+
| ---- | --------- | ---------- |
213+
|JSON|✓|OAS2,OAS3
214+
|XML|✓|OAS2,OAS3
215+
|PROTOBUF|✗|ToolingExtension
216+
|Custom|✓|OAS2,OAS3

docs/generators/scalatra.md

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,56 +67,44 @@ sidebar_label: scalatra
6767

6868
<ul class="column-ul">
6969
<li>abstract</li>
70-
<li>assert</li>
71-
<li>boolean</li>
72-
<li>break</li>
73-
<li>byte</li>
7470
<li>case</li>
7571
<li>catch</li>
76-
<li>char</li>
7772
<li>class</li>
78-
<li>const</li>
79-
<li>continue</li>
80-
<li>default</li>
73+
<li>def</li>
8174
<li>do</li>
82-
<li>double</li>
8375
<li>else</li>
84-
<li>enum</li>
8576
<li>extends</li>
77+
<li>false</li>
8678
<li>final</li>
8779
<li>finally</li>
88-
<li>float</li>
8980
<li>for</li>
90-
<li>goto</li>
81+
<li>forSome</li>
9182
<li>if</li>
92-
<li>implements</li>
83+
<li>implicit</li>
9384
<li>import</li>
94-
<li>instanceof</li>
95-
<li>int</li>
96-
<li>interface</li>
97-
<li>long</li>
98-
<li>native</li>
85+
<li>lazy</li>
86+
<li>match</li>
9987
<li>new</li>
88+
<li>null</li>
89+
<li>object</li>
90+
<li>override</li>
10091
<li>package</li>
10192
<li>private</li>
10293
<li>protected</li>
103-
<li>public</li>
10494
<li>return</li>
105-
<li>short</li>
106-
<li>static</li>
107-
<li>strictfp</li>
95+
<li>sealed</li>
10896
<li>super</li>
109-
<li>switch</li>
110-
<li>synchronized</li>
11197
<li>this</li>
11298
<li>throw</li>
113-
<li>throws</li>
114-
<li>transient</li>
99+
<li>trait</li>
100+
<li>true</li>
115101
<li>try</li>
116102
<li>type</li>
117-
<li>void</li>
118-
<li>volatile</li>
103+
<li>val</li>
104+
<li>var</li>
119105
<li>while</li>
106+
<li>with</li>
107+
<li>yield</li>
120108
</ul>
121109

122110
## FEATURE SET

0 commit comments

Comments
 (0)