Skip to content

Commit 38c33b9

Browse files
Add scala-pekko client generator (#17417)
* feat: add scala-pekko client generator * feat: add scala-pekko client to CI
1 parent 986a914 commit 38c33b9

65 files changed

Lines changed: 6540 additions & 0 deletions

Some content is hidden

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

.github/workflows/samples-scala.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
# clients
2323
- 'samples/client/petstore/java/okhttp-gson'
2424
- samples/client/petstore/scalaz
25+
- samples/client/petstore/scala-pekko
2526
#- samples/client/petstore/scala-sttp # won't pass while the same tests in circleci pass
2627
# servers
2728
- samples/server/petstore/scala-lagom-server

bin/configs/scala-pekko.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
generatorName: scala-pekko
2+
outputDir: samples/client/petstore/scala-pekko
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/scala-pekko/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/scala-pekko-client
5+
additionalProperties:
6+
artifactId: scala-pekko-petstore-client

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The following generators are available:
5959
* [rust](generators/rust.md)
6060
* [scala-akka](generators/scala-akka.md)
6161
* [scala-gatling](generators/scala-gatling.md)
62+
* [scala-pekko](generators/scala-pekko.md)
6263
* [scala-sttp](generators/scala-sttp.md)
6364
* [scala-sttp4 (beta)](generators/scala-sttp4.md)
6465
* [scalaz](generators/scalaz.md)

docs/generators/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The following generators are available:
4545
* [ruby](ruby.md)
4646
* [rust](rust.md)
4747
* [scala-akka](scala-akka.md)
48+
* [scala-pekko](scala-pekko.md)
4849
* [scala-gatling](scala-gatling.md)
4950
* [scalaz](scalaz.md)
5051
* [swift4](swift4.md)

docs/generators/scala-pekko.md

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
---
2+
title: Documentation for the scala-pekko Generator
3+
---
4+
5+
## METADATA
6+
7+
| Property | Value | Notes |
8+
| -------- | ----- | ----- |
9+
| generator name | scala-pekko | pass this to the generate command after -g |
10+
| generator stability | STABLE | |
11+
| generator type | CLIENT | |
12+
| generator language | Scala | |
13+
| generator default templating engine | mustache | |
14+
| helpTxt | Generates a Scala client library (beta) base on pekko/Spray. | |
15+
16+
## CONFIG OPTIONS
17+
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
18+
19+
| Option | Description | Values | Default |
20+
| ------ | ----------- | ------ | ------- |
21+
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
22+
|apiPackage|package for generated api classes| |null|
23+
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
24+
|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|
25+
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
26+
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
27+
|legacyDiscriminatorBehavior|Set to false 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|
28+
|mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client|
29+
|modelPackage|package for generated models| |null|
30+
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
31+
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
32+
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
33+
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
34+
|sourceFolder|source folder for generated code| |null|
35+
36+
## IMPORT MAPPING
37+
38+
| Type/Alias | Imports |
39+
| ---------- | ------- |
40+
|Array|java.util.List|
41+
|ArrayList|java.util.ArrayList|
42+
|BigDecimal|java.math.BigDecimal|
43+
|Date|java.util.Date|
44+
|DateTime|org.joda.time.*|
45+
|File|java.io.File|
46+
|HashMap|java.util.HashMap|
47+
|ListBuffer|scala.collection.mutable.ListBuffer|
48+
|ListSet|scala.collection.immutable.ListSet|
49+
|LocalDate|org.joda.time.*|
50+
|LocalDateTime|org.joda.time.*|
51+
|LocalTime|org.joda.time.*|
52+
|Timestamp|java.sql.Timestamp|
53+
|URI|java.net.URI|
54+
|UUID|java.util.UUID|
55+
56+
57+
## INSTANTIATION TYPES
58+
59+
| Type/Alias | Instantiated By |
60+
| ---------- | --------------- |
61+
|array|ListBuffer|
62+
|map|Map|
63+
|set|Set|
64+
65+
66+
## LANGUAGE PRIMITIVES
67+
68+
<ul class="column-ul">
69+
<li>Any</li>
70+
<li>Array</li>
71+
<li>Boolean</li>
72+
<li>Byte</li>
73+
<li>Double</li>
74+
<li>Float</li>
75+
<li>Int</li>
76+
<li>List</li>
77+
<li>Long</li>
78+
<li>Map</li>
79+
<li>Object</li>
80+
<li>Seq</li>
81+
<li>String</li>
82+
<li>boolean</li>
83+
</ul>
84+
85+
## RESERVED WORDS
86+
87+
<ul class="column-ul">
88+
<li>abstract</li>
89+
<li>case</li>
90+
<li>catch</li>
91+
<li>class</li>
92+
<li>def</li>
93+
<li>do</li>
94+
<li>else</li>
95+
<li>extends</li>
96+
<li>false</li>
97+
<li>final</li>
98+
<li>finally</li>
99+
<li>for</li>
100+
<li>forsome</li>
101+
<li>if</li>
102+
<li>implicit</li>
103+
<li>import</li>
104+
<li>lazy</li>
105+
<li>match</li>
106+
<li>new</li>
107+
<li>null</li>
108+
<li>object</li>
109+
<li>override</li>
110+
<li>package</li>
111+
<li>private</li>
112+
<li>protected</li>
113+
<li>return</li>
114+
<li>sealed</li>
115+
<li>super</li>
116+
<li>this</li>
117+
<li>throw</li>
118+
<li>trait</li>
119+
<li>true</li>
120+
<li>try</li>
121+
<li>type</li>
122+
<li>val</li>
123+
<li>var</li>
124+
<li>while</li>
125+
<li>with</li>
126+
<li>yield</li>
127+
</ul>
128+
129+
## FEATURE SET
130+
131+
132+
### Client Modification Feature
133+
| Name | Supported | Defined By |
134+
| ---- | --------- | ---------- |
135+
|BasePath|✓|ToolingExtension
136+
|Authorizations|✗|ToolingExtension
137+
|UserAgent|✓|ToolingExtension
138+
|MockServer|✗|ToolingExtension
139+
140+
### Data Type Feature
141+
| Name | Supported | Defined By |
142+
| ---- | --------- | ---------- |
143+
|Custom|✗|OAS2,OAS3
144+
|Int32|✓|OAS2,OAS3
145+
|Int64|✓|OAS2,OAS3
146+
|Float|✓|OAS2,OAS3
147+
|Double|✓|OAS2,OAS3
148+
|Decimal|✓|ToolingExtension
149+
|String|✓|OAS2,OAS3
150+
|Byte|✓|OAS2,OAS3
151+
|Binary|✓|OAS2,OAS3
152+
|Boolean|✓|OAS2,OAS3
153+
|Date|✓|OAS2,OAS3
154+
|DateTime|✓|OAS2,OAS3
155+
|Password|✓|OAS2,OAS3
156+
|File|✓|OAS2
157+
|Uuid||
158+
|Array|✓|OAS2,OAS3
159+
|Null|✗|OAS3
160+
|AnyType|✗|OAS2,OAS3
161+
|Object|✓|OAS2,OAS3
162+
|Maps|✓|ToolingExtension
163+
|CollectionFormat|✓|OAS2
164+
|CollectionFormatMulti|✓|OAS2
165+
|Enum|✓|OAS2,OAS3
166+
|ArrayOfEnum|✓|ToolingExtension
167+
|ArrayOfModel|✓|ToolingExtension
168+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
169+
|ArrayOfCollectionOfModel|✓|ToolingExtension
170+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
171+
|MapOfEnum|✓|ToolingExtension
172+
|MapOfModel|✓|ToolingExtension
173+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
174+
|MapOfCollectionOfModel|✓|ToolingExtension
175+
|MapOfCollectionOfEnum|✓|ToolingExtension
176+
177+
### Documentation Feature
178+
| Name | Supported | Defined By |
179+
| ---- | --------- | ---------- |
180+
|Readme|✓|ToolingExtension
181+
|Model|✓|ToolingExtension
182+
|Api|✓|ToolingExtension
183+
184+
### Global Feature
185+
| Name | Supported | Defined By |
186+
| ---- | --------- | ---------- |
187+
|Host|✓|OAS2,OAS3
188+
|BasePath|✓|OAS2,OAS3
189+
|Info|✓|OAS2,OAS3
190+
|Schemes|✗|OAS2,OAS3
191+
|PartialSchemes|✓|OAS2,OAS3
192+
|Consumes|✓|OAS2
193+
|Produces|✓|OAS2
194+
|ExternalDocumentation|✓|OAS2,OAS3
195+
|Examples|✓|OAS2,OAS3
196+
|XMLStructureDefinitions|✗|OAS2,OAS3
197+
|MultiServer|✗|OAS3
198+
|ParameterizedServer|✗|OAS3
199+
|ParameterStyling|✗|OAS3
200+
|Callbacks|✗|OAS3
201+
|LinkObjects|✗|OAS3
202+
203+
### Parameter Feature
204+
| Name | Supported | Defined By |
205+
| ---- | --------- | ---------- |
206+
|Path|✓|OAS2,OAS3
207+
|Query|✓|OAS2,OAS3
208+
|Header|✓|OAS2,OAS3
209+
|Body|✓|OAS2
210+
|FormUnencoded|✓|OAS2
211+
|FormMultipart|✓|OAS2
212+
|Cookie|✗|OAS3
213+
214+
### Schema Support Feature
215+
| Name | Supported | Defined By |
216+
| ---- | --------- | ---------- |
217+
|Simple|✓|OAS2,OAS3
218+
|Composite|✓|OAS2,OAS3
219+
|Polymorphism|✗|OAS2,OAS3
220+
|Union|✗|OAS3
221+
|allOf|✗|OAS2,OAS3
222+
|anyOf|✗|OAS3
223+
|oneOf|✗|OAS3
224+
|not|✗|OAS3
225+
226+
### Security Feature
227+
| Name | Supported | Defined By |
228+
| ---- | --------- | ---------- |
229+
|BasicAuth|✓|OAS2,OAS3
230+
|ApiKey|✓|OAS2,OAS3
231+
|OpenIDConnect|✗|OAS3
232+
|BearerToken|✓|OAS3
233+
|OAuth2_Implicit|✗|OAS2,OAS3
234+
|OAuth2_Password|✗|OAS2,OAS3
235+
|OAuth2_ClientCredentials|✗|OAS2,OAS3
236+
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
237+
|SignatureAuth|✗|OAS3
238+
|AWSV4Signature|✗|ToolingExtension
239+
240+
### Wire Format Feature
241+
| Name | Supported | Defined By |
242+
| ---- | --------- | ---------- |
243+
|JSON|✓|OAS2,OAS3
244+
|XML|✓|OAS2,OAS3
245+
|PROTOBUF|✗|ToolingExtension
246+
|Custom|✓|OAS2,OAS3

0 commit comments

Comments
 (0)