Skip to content

Commit 1b4d85d

Browse files
committed
re-gen samples
1 parent 8692c38 commit 1b4d85d

114 files changed

Lines changed: 1162 additions & 78 deletions

File tree

Some content is hidden

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

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/docs/Animal.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
## Properties
55
| Name | Type | Description | Notes |
66
| ------------ | ------------- | ------------- | ------------- |
7-
| **discriminator** | **kotlin.String** | | |
87
| **anotherDiscriminator** | **kotlin.String** | | |
98
| **propertyA** | **kotlin.String** | | [optional] |
109
| **sameNameProperty** | **kotlin.String** | | [optional] |

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/docs/AnotherAnimal.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
| Name | Type | Description | Notes |
66
| ------------ | ------------- | ------------- | ------------- |
77
| **discriminator** | **kotlin.String** | | |
8-
| **anotherDiscriminator** | **kotlin.String** | | |
98
| **propertyA** | **kotlin.String** | | [optional] |
109
| **sameNameProperty** | **kotlin.String** | | [optional] |
1110
| **propertyB** | **kotlin.String** | | [optional] |

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/docs/Bird.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
## Properties
55
| Name | Type | Description | Notes |
66
| ------------ | ------------- | ------------- | ------------- |
7-
| **discriminator** | **kotlin.String** | | |
8-
| **anotherDiscriminator** | **kotlin.String** | | |
97
| **propertyA** | **kotlin.String** | | [optional] |
108
| **sameNameProperty** | **kotlin.Int** | | [optional] |
119

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/docs/Robobird.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
## Properties
55
| Name | Type | Description | Notes |
66
| ------------ | ------------- | ------------- | ------------- |
7-
| **discriminator** | **kotlin.String** | | |
8-
| **anotherDiscriminator** | **kotlin.String** | | |
97
| **propertyB** | **kotlin.String** | | [optional] |
108
| **sameNameProperty** | **kotlin.String** | | [optional] |
119

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Animal.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ import kotlinx.serialization.json.jsonPrimitive
4343
@Serializable(with = AnimalSerializer::class)
4444
sealed interface Animal {
4545
@JvmInline
46-
value class BirdWrapper(val value: Bird) : Animal
46+
value class (val value: Bird) : Animal
4747

4848
@JvmInline
49-
value class RobobirdWrapper(val value: Robobird) : Animal
49+
value class (val value: Robobird) : Animal
5050

5151
}
5252

@@ -56,12 +56,12 @@ object AnimalSerializer : KSerializer<Animal> {
5656
override fun serialize(encoder: Encoder, value: Animal) {
5757
require(encoder is JsonEncoder)
5858
val jsonObject = when (value) {
59-
is Animal.BirdWrapper -> {
59+
is Animal. -> {
6060
val jsonMap = encoder.json.encodeToJsonElement(Bird.serializer(), value.value).jsonObject.toMutableMap()
6161
jsonMap["discriminator"] = JsonPrimitive("BIRD")
6262
JsonObject(jsonMap)
6363
}
64-
is Animal.RobobirdWrapper -> {
64+
is Animal. -> {
6565
val jsonMap = encoder.json.encodeToJsonElement(Robobird.serializer(), value.value).jsonObject.toMutableMap()
6666
jsonMap["discriminator"] = JsonPrimitive("ROBOBIRD")
6767
JsonObject(jsonMap)
@@ -80,11 +80,11 @@ object AnimalSerializer : KSerializer<Animal> {
8080
return when (discriminatorValue) {
8181
"BIRD" -> {
8282
val decoded = decoder.json.decodeFromJsonElement(Bird.serializer(), element)
83-
Animal.BirdWrapper(decoded)
83+
Animal.(decoded)
8484
}
8585
"ROBOBIRD" -> {
8686
val decoded = decoder.json.decodeFromJsonElement(Robobird.serializer(), element)
87-
Animal.RobobirdWrapper(decoded)
87+
Animal.(decoded)
8888
}
8989
else -> throw SerializationException("Unknown Animal discriminator: $discriminatorValue")
9090
}

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnotherAnimal.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ import kotlinx.serialization.json.jsonPrimitive
4343
@Serializable(with = AnotherAnimalSerializer::class)
4444
sealed interface AnotherAnimal {
4545
@JvmInline
46-
value class AnotherBirdWrapper(val value: Bird) : AnotherAnimal
46+
value class (val value: Bird) : AnotherAnimal
4747

4848
@JvmInline
49-
value class AnotherRobobirdWrapper(val value: Robobird) : AnotherAnimal
49+
value class (val value: Robobird) : AnotherAnimal
5050

5151
}
5252

@@ -56,12 +56,12 @@ object AnotherAnimalSerializer : KSerializer<AnotherAnimal> {
5656
override fun serialize(encoder: Encoder, value: AnotherAnimal) {
5757
require(encoder is JsonEncoder)
5858
val jsonObject = when (value) {
59-
is AnotherAnimal.AnotherBirdWrapper -> {
59+
is AnotherAnimal. -> {
6060
val jsonMap = encoder.json.encodeToJsonElement(Bird.serializer(), value.value).jsonObject.toMutableMap()
6161
jsonMap["another_discriminator"] = JsonPrimitive("ANOTHER_BIRD")
6262
JsonObject(jsonMap)
6363
}
64-
is AnotherAnimal.AnotherRobobirdWrapper -> {
64+
is AnotherAnimal. -> {
6565
val jsonMap = encoder.json.encodeToJsonElement(Robobird.serializer(), value.value).jsonObject.toMutableMap()
6666
jsonMap["another_discriminator"] = JsonPrimitive("ANOTHER_ROBOBIRD")
6767
JsonObject(jsonMap)
@@ -80,11 +80,11 @@ object AnotherAnimalSerializer : KSerializer<AnotherAnimal> {
8080
return when (discriminatorValue) {
8181
"ANOTHER_BIRD" -> {
8282
val decoded = decoder.json.decodeFromJsonElement(Bird.serializer(), element)
83-
AnotherAnimal.AnotherBirdWrapper(decoded)
83+
AnotherAnimal.(decoded)
8484
}
8585
"ANOTHER_ROBOBIRD" -> {
8686
val decoded = decoder.json.decodeFromJsonElement(Robobird.serializer(), element)
87-
AnotherAnimal.AnotherRobobirdWrapper(decoded)
87+
AnotherAnimal.(decoded)
8888
}
8989
else -> throw SerializationException("Unknown AnotherAnimal another_discriminator: $discriminatorValue")
9090
}

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Bird.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,14 @@ import kotlinx.serialization.encoding.Encoder
2828
/**
2929
*
3030
*
31-
* @param discriminator
32-
* @param anotherDiscriminator
3331
* @param propertyA
3432
* @param sameNameProperty
3533
*/
3634
@Serializable
3735

36+
@SerialName(value = "ANOTHER_BIRD")
3837
data class Bird (
3938

40-
@SerialName(value = "discriminator")
41-
val discriminator: kotlin.String,
42-
43-
@SerialName(value = "another_discriminator")
44-
val anotherDiscriminator: kotlin.String,
45-
4639
@SerialName(value = "propertyA")
4740
val propertyA: kotlin.String? = null,
4841

samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Robobird.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,14 @@ import kotlinx.serialization.encoding.Encoder
2828
/**
2929
*
3030
*
31-
* @param discriminator
32-
* @param anotherDiscriminator
3331
* @param propertyB
3432
* @param sameNameProperty
3533
*/
3634
@Serializable
3735

36+
@SerialName(value = "ANOTHER_ROBOBIRD")
3837
data class Robobird (
3938

40-
@SerialName(value = "discriminator")
41-
val discriminator: kotlin.String,
42-
43-
@SerialName(value = "another_discriminator")
44-
val anotherDiscriminator: kotlin.String,
45-
4639
@SerialName(value = "propertyB")
4740
val propertyB: kotlin.String? = null,
4841

samples/server/petstore/jaxrs-spec-swagger-v3-annotations-jakarta/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
<artifactId>jakarta.annotation-api</artifactId>
7979
<version>${javax.annotation-api-version}</version>
8080
</dependency>
81+
<dependency>
82+
<groupId>io.swagger</groupId>
83+
<artifactId>swagger-annotations</artifactId>
84+
<scope>provided</scope>
85+
<version>1.5.3</version>
86+
</dependency>
8187
<dependency>
8288
<groupId>io.swagger.core.v3</groupId>
8389
<artifactId>swagger-annotations</artifactId>

samples/server/petstore/jaxrs-spec-swagger-v3-annotations-jakarta/src/gen/java/org/openapitools/api/AnotherFakeApi.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import jakarta.ws.rs.*;
66
import jakarta.ws.rs.core.Response;
77

8+
import io.swagger.annotations.*;
89
import io.swagger.v3.oas.annotations.*;
910
import io.swagger.v3.oas.annotations.media.*;
1011
import io.swagger.v3.oas.annotations.responses.*;
@@ -20,13 +21,18 @@
2021
* Represents a collection of functions to interact with the API endpoints.
2122
*/
2223
@Path("/another-fake/dummy")
24+
@Api(description = "the another-fake API")
2325
@Tag(name = "another-fake")
2426
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
2527
public class AnotherFakeApi {
2628

2729
@PATCH
2830
@Consumes({ "application/json" })
2931
@Produces({ "application/json" })
32+
@ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" })
33+
@ApiResponses(value = {
34+
@ApiResponse(code = 200, message = "successful operation", response = Client.class)
35+
})
3036
@Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number")
3137
@ApiResponses(value = {
3238
@ApiResponse(responseCode = "200", description = "successful operation")

0 commit comments

Comments
 (0)