Skip to content

Commit 9b7528d

Browse files
committed
update samples, docs
1 parent 455add6 commit 9b7528d

File tree

6 files changed

+297
-1
lines changed

6 files changed

+297
-1
lines changed

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ The following generators are available:
134134
* [rust-server](generators/rust-server.md)
135135
* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md)
136136
* [scala-finch](generators/scala-finch.md)
137+
* [scala-http4s-server](generators/scala-http4s-server.md)
137138
* [scala-lagom-server](generators/scala-lagom-server.md)
138139
* [scala-play-server](generators/scala-play-server.md)
139140
* [scalatra](generators/scalatra.md)
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
---
2+
title: Documentation for the scala-http4s-server Generator
3+
---
4+
5+
## METADATA
6+
7+
| Property | Value | Notes |
8+
| -------- | ----- | ----- |
9+
| generator name | scala-http4s-server | pass this to the generate command after -g |
10+
| generator stability | STABLE | |
11+
| generator type | SERVER | |
12+
| generator language | Scala | |
13+
| generator default templating engine | mustache | |
14+
| helpTxt | Generates a Scala http4s server bindings. | |
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+
|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|
23+
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
24+
|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|
25+
|excludeSbt|exclude sbt from generation| |null|
26+
|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|
27+
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
28+
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
29+
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
30+
|sourceSubfolder|name of subfolder, for example to generate code in src/scala/generated| |null|
31+
32+
## IMPORT MAPPING
33+
34+
| Type/Alias | Imports |
35+
| ---------- | ------- |
36+
|And|eu.timepit.refined.boolean.And|
37+
|ArrayBuffer|scala.collection.mutable.ArrayBuffer|
38+
|Date|java.util.Date|
39+
|DateTime|java.time.LocalDateTime|
40+
|File|java.io.File|
41+
|Greater|eu.timepit.refined.numeric.Greater|
42+
|GreaterEqual|eu.timepit.refined.numeric.GreaterEqual|
43+
|HashMap|scala.collection.immutable.HashMap|
44+
|Less|eu.timepit.refined.numeric.Less|
45+
|LessEqual|eu.timepit.refined.numeric.LessEqual|
46+
|LocalDate|java.time.LocalDate|
47+
|LocalDateTime|java.time.LocalDateTime|
48+
|LocalTime|java.time.LocalTime|
49+
|Map|scala.collection.immutable.Map|
50+
|MatchesRegex|eu.timepit.refined.string.MatchesRegex|
51+
|MaxSize|eu.timepit.refined.collection.MaxSize|
52+
|MinSize|eu.timepit.refined.collection.MinSize|
53+
|OffsetDateTime|java.time.OffsetDateTime|
54+
|Refined|eu.timepit.refined.api.Refined|
55+
|Seq|scala.collection.immutable.Seq|
56+
|Timestamp|java.sql.Timestamp|
57+
|URI|java.net.URI|
58+
|UUID|java.util.UUID|
59+
|ZonedDateTime|java.time.ZonedDateTime|
60+
61+
62+
## INSTANTIATION TYPES
63+
64+
| Type/Alias | Instantiated By |
65+
| ---------- | --------------- |
66+
|array|ArrayList|
67+
|map|HashMap|
68+
69+
70+
## LANGUAGE PRIMITIVES
71+
72+
<ul class="column-ul">
73+
<li>Any</li>
74+
<li>AnyRef</li>
75+
<li>AnyVal</li>
76+
<li>BigDecimal</li>
77+
<li>Boolean</li>
78+
<li>Double</li>
79+
<li>Float</li>
80+
<li>Int</li>
81+
<li>Integer</li>
82+
<li>Long</li>
83+
<li>Object</li>
84+
<li>String</li>
85+
</ul>
86+
87+
## RESERVED WORDS
88+
89+
<ul class="column-ul">
90+
<li>abstract</li>
91+
<li>assert</li>
92+
<li>break</li>
93+
<li>byte</li>
94+
<li>case</li>
95+
<li>catch</li>
96+
<li>char</li>
97+
<li>class</li>
98+
<li>const</li>
99+
<li>continue</li>
100+
<li>def</li>
101+
<li>default</li>
102+
<li>do</li>
103+
<li>double</li>
104+
<li>else</li>
105+
<li>enum</li>
106+
<li>extends</li>
107+
<li>false</li>
108+
<li>final</li>
109+
<li>finally</li>
110+
<li>float</li>
111+
<li>for</li>
112+
<li>forsome</li>
113+
<li>goto</li>
114+
<li>if</li>
115+
<li>implements</li>
116+
<li>implicit</li>
117+
<li>import</li>
118+
<li>instanceof</li>
119+
<li>int</li>
120+
<li>interface</li>
121+
<li>lazy</li>
122+
<li>long</li>
123+
<li>match</li>
124+
<li>native</li>
125+
<li>new</li>
126+
<li>null</li>
127+
<li>object</li>
128+
<li>override</li>
129+
<li>package</li>
130+
<li>private</li>
131+
<li>protected</li>
132+
<li>public</li>
133+
<li>return</li>
134+
<li>sealed</li>
135+
<li>short</li>
136+
<li>static</li>
137+
<li>strictfp</li>
138+
<li>super</li>
139+
<li>switch</li>
140+
<li>synchronized</li>
141+
<li>this</li>
142+
<li>throw</li>
143+
<li>throws</li>
144+
<li>trait</li>
145+
<li>transient</li>
146+
<li>true</li>
147+
<li>try</li>
148+
<li>type</li>
149+
<li>val</li>
150+
<li>var</li>
151+
<li>void</li>
152+
<li>volatile</li>
153+
<li>while</li>
154+
<li>with</li>
155+
<li>yield</li>
156+
</ul>
157+
158+
## FEATURE SET
159+
160+
161+
### Client Modification Feature
162+
| Name | Supported | Defined By |
163+
| ---- | --------- | ---------- |
164+
|BasePath|✗|ToolingExtension
165+
|Authorizations|✗|ToolingExtension
166+
|UserAgent|✗|ToolingExtension
167+
|MockServer|✗|ToolingExtension
168+
169+
### Data Type Feature
170+
| Name | Supported | Defined By |
171+
| ---- | --------- | ---------- |
172+
|Custom|✗|OAS2,OAS3
173+
|Int32|✓|OAS2,OAS3
174+
|Int64|✓|OAS2,OAS3
175+
|Float|✓|OAS2,OAS3
176+
|Double|✓|OAS2,OAS3
177+
|Decimal|✓|ToolingExtension
178+
|String|✓|OAS2,OAS3
179+
|Byte|✓|OAS2,OAS3
180+
|Binary|✓|OAS2,OAS3
181+
|Boolean|✓|OAS2,OAS3
182+
|Date|✓|OAS2,OAS3
183+
|DateTime|✓|OAS2,OAS3
184+
|Password|✓|OAS2,OAS3
185+
|File|✓|OAS2
186+
|Uuid||
187+
|Array|✓|OAS2,OAS3
188+
|Null|✗|OAS3
189+
|AnyType|✗|OAS2,OAS3
190+
|Object|✓|OAS2,OAS3
191+
|Maps|✓|ToolingExtension
192+
|CollectionFormat|✓|OAS2
193+
|CollectionFormatMulti|✓|OAS2
194+
|Enum|✓|OAS2,OAS3
195+
|ArrayOfEnum|✓|ToolingExtension
196+
|ArrayOfModel|✓|ToolingExtension
197+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
198+
|ArrayOfCollectionOfModel|✓|ToolingExtension
199+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
200+
|MapOfEnum|✓|ToolingExtension
201+
|MapOfModel|✓|ToolingExtension
202+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
203+
|MapOfCollectionOfModel|✓|ToolingExtension
204+
|MapOfCollectionOfEnum|✓|ToolingExtension
205+
206+
### Documentation Feature
207+
| Name | Supported | Defined By |
208+
| ---- | --------- | ---------- |
209+
|Readme|✗|ToolingExtension
210+
|Model|✓|ToolingExtension
211+
|Api|✓|ToolingExtension
212+
213+
### Global Feature
214+
| Name | Supported | Defined By |
215+
| ---- | --------- | ---------- |
216+
|Host|✓|OAS2,OAS3
217+
|BasePath|✓|OAS2,OAS3
218+
|Info|✓|OAS2,OAS3
219+
|Schemes|✗|OAS2,OAS3
220+
|PartialSchemes|✓|OAS2,OAS3
221+
|Consumes|✓|OAS2
222+
|Produces|✓|OAS2
223+
|ExternalDocumentation|✓|OAS2,OAS3
224+
|Examples|✓|OAS2,OAS3
225+
|XMLStructureDefinitions|✗|OAS2,OAS3
226+
|MultiServer|✗|OAS3
227+
|ParameterizedServer|✗|OAS3
228+
|ParameterStyling|✗|OAS3
229+
|Callbacks|✗|OAS3
230+
|LinkObjects|✗|OAS3
231+
232+
### Parameter Feature
233+
| Name | Supported | Defined By |
234+
| ---- | --------- | ---------- |
235+
|Path|✓|OAS2,OAS3
236+
|Query|✓|OAS2,OAS3
237+
|Header|✓|OAS2,OAS3
238+
|Body|✓|OAS2
239+
|FormUnencoded|✓|OAS2
240+
|FormMultipart|✓|OAS2
241+
|Cookie|✗|OAS3
242+
243+
### Schema Support Feature
244+
| Name | Supported | Defined By |
245+
| ---- | --------- | ---------- |
246+
|Simple|✓|OAS2,OAS3
247+
|Composite|✓|OAS2,OAS3
248+
|Polymorphism|✗|OAS2,OAS3
249+
|Union|✗|OAS3
250+
|allOf|✗|OAS2,OAS3
251+
|anyOf|✗|OAS3
252+
|oneOf|✗|OAS3
253+
|not|✗|OAS3
254+
255+
### Security Feature
256+
| Name | Supported | Defined By |
257+
| ---- | --------- | ---------- |
258+
|BasicAuth|✗|OAS2,OAS3
259+
|ApiKey|✗|OAS2,OAS3
260+
|OpenIDConnect|✗|OAS3
261+
|BearerToken|✗|OAS3
262+
|OAuth2_Implicit|✗|OAS2,OAS3
263+
|OAuth2_Password|✗|OAS2,OAS3
264+
|OAuth2_ClientCredentials|✗|OAS2,OAS3
265+
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
266+
|SignatureAuth|✗|OAS3
267+
|AWSV4Signature|✗|ToolingExtension
268+
269+
### Wire Format Feature
270+
| Name | Supported | Defined By |
271+
| ---- | --------- | ---------- |
272+
|JSON|✓|OAS2,OAS3
273+
|XML|✓|OAS2,OAS3
274+
|PROTOBUF|✗|ToolingExtension
275+
|Custom|✓|OAS2,OAS3

samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/PetApi.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import kotlin.collections.Map
4040
interface PetApi {
4141

4242
@Operation(
43+
tags = ["pet",],
4344
summary = "Add a new pet to the store",
4445
operationId = "addPet",
4546
description = """""",
@@ -58,6 +59,7 @@ interface PetApi {
5859
}
5960

6061
@Operation(
62+
tags = ["pet",],
6163
summary = "Deletes a pet",
6264
operationId = "deletePet",
6365
description = """""",
@@ -75,6 +77,7 @@ interface PetApi {
7577
}
7678

7779
@Operation(
80+
tags = ["pet",],
7881
summary = "Finds Pets by status",
7982
operationId = "findPetsByStatus",
8083
description = """Multiple status values can be provided with comma separated strings""",
@@ -94,6 +97,7 @@ interface PetApi {
9497
}
9598

9699
@Operation(
100+
tags = ["pet",],
97101
summary = "Finds Pets by tags",
98102
operationId = "findPetsByTags",
99103
description = """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.""",
@@ -113,6 +117,7 @@ interface PetApi {
113117
}
114118

115119
@Operation(
120+
tags = ["pet",],
116121
summary = "Find pet by ID",
117122
operationId = "getPetById",
118123
description = """Returns a single pet""",
@@ -133,6 +138,7 @@ interface PetApi {
133138
}
134139

135140
@Operation(
141+
tags = ["pet",],
136142
summary = "Update an existing pet",
137143
operationId = "updatePet",
138144
description = """""",
@@ -153,6 +159,7 @@ interface PetApi {
153159
}
154160

155161
@Operation(
162+
tags = ["pet",],
156163
summary = "Updates a pet in the store with form data",
157164
operationId = "updatePetWithForm",
158165
description = """""",
@@ -171,6 +178,7 @@ interface PetApi {
171178
}
172179

173180
@Operation(
181+
tags = ["pet",],
174182
summary = "uploads an image",
175183
operationId = "uploadFile",
176184
description = """""",

samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/StoreApi.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import kotlin.collections.Map
3939
interface StoreApi {
4040

4141
@Operation(
42+
tags = ["store",],
4243
summary = "Delete purchase order by ID",
4344
operationId = "deleteOrder",
4445
description = """For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors""",
@@ -56,6 +57,7 @@ interface StoreApi {
5657
}
5758

5859
@Operation(
60+
tags = ["store",],
5961
summary = "Returns pet inventories by status",
6062
operationId = "getInventory",
6163
description = """Returns a map of status codes to quantities""",
@@ -74,6 +76,7 @@ interface StoreApi {
7476
}
7577

7678
@Operation(
79+
tags = ["store",],
7780
summary = "Find purchase order by ID",
7881
operationId = "getOrderById",
7982
description = """For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions""",
@@ -93,6 +96,7 @@ interface StoreApi {
9396
}
9497

9598
@Operation(
99+
tags = ["store",],
96100
summary = "Place an order for a pet",
97101
operationId = "placeOrder",
98102
description = """""",

0 commit comments

Comments
 (0)