Skip to content

Commit 212d561

Browse files
committed
Revert "re-gen samples"
This reverts commit 1b4d85d.
1 parent 1b4d85d commit 212d561

114 files changed

Lines changed: 78 additions & 1162 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
## Properties
55
| Name | Type | Description | Notes |
66
| ------------ | ------------- | ------------- | ------------- |
7+
| **discriminator** | **kotlin.String** | | |
78
| **anotherDiscriminator** | **kotlin.String** | | |
89
| **propertyA** | **kotlin.String** | | [optional] |
910
| **sameNameProperty** | **kotlin.String** | | [optional] |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| Name | Type | Description | Notes |
66
| ------------ | ------------- | ------------- | ------------- |
77
| **discriminator** | **kotlin.String** | | |
8+
| **anotherDiscriminator** | **kotlin.String** | | |
89
| **propertyA** | **kotlin.String** | | [optional] |
910
| **sameNameProperty** | **kotlin.String** | | [optional] |
1011
| **propertyB** | **kotlin.String** | | [optional] |

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

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

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

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

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 (val value: Bird) : Animal
46+
value class BirdWrapper(val value: Bird) : Animal
4747

4848
@JvmInline
49-
value class (val value: Robobird) : Animal
49+
value class RobobirdWrapper(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. -> {
59+
is Animal.BirdWrapper -> {
6060
val jsonMap = encoder.json.encodeToJsonElement(Bird.serializer(), value.value).jsonObject.toMutableMap()
6161
jsonMap["discriminator"] = JsonPrimitive("BIRD")
6262
JsonObject(jsonMap)
6363
}
64-
is Animal. -> {
64+
is Animal.RobobirdWrapper -> {
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.(decoded)
83+
Animal.BirdWrapper(decoded)
8484
}
8585
"ROBOBIRD" -> {
8686
val decoded = decoder.json.decodeFromJsonElement(Robobird.serializer(), element)
87-
Animal.(decoded)
87+
Animal.RobobirdWrapper(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 (val value: Bird) : AnotherAnimal
46+
value class AnotherBirdWrapper(val value: Bird) : AnotherAnimal
4747

4848
@JvmInline
49-
value class (val value: Robobird) : AnotherAnimal
49+
value class AnotherRobobirdWrapper(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. -> {
59+
is AnotherAnimal.AnotherBirdWrapper -> {
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. -> {
64+
is AnotherAnimal.AnotherRobobirdWrapper -> {
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.(decoded)
83+
AnotherAnimal.AnotherBirdWrapper(decoded)
8484
}
8585
"ANOTHER_ROBOBIRD" -> {
8686
val decoded = decoder.json.decodeFromJsonElement(Robobird.serializer(), element)
87-
AnotherAnimal.(decoded)
87+
AnotherAnimal.AnotherRobobirdWrapper(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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ import kotlinx.serialization.encoding.Encoder
2828
/**
2929
*
3030
*
31+
* @param discriminator
32+
* @param anotherDiscriminator
3133
* @param propertyA
3234
* @param sameNameProperty
3335
*/
3436
@Serializable
3537

36-
@SerialName(value = "ANOTHER_BIRD")
3738
data class Bird (
3839

40+
@SerialName(value = "discriminator")
41+
val discriminator: kotlin.String,
42+
43+
@SerialName(value = "another_discriminator")
44+
val anotherDiscriminator: kotlin.String,
45+
3946
@SerialName(value = "propertyA")
4047
val propertyA: kotlin.String? = null,
4148

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ import kotlinx.serialization.encoding.Encoder
2828
/**
2929
*
3030
*
31+
* @param discriminator
32+
* @param anotherDiscriminator
3133
* @param propertyB
3234
* @param sameNameProperty
3335
*/
3436
@Serializable
3537

36-
@SerialName(value = "ANOTHER_ROBOBIRD")
3738
data class Robobird (
3839

40+
@SerialName(value = "discriminator")
41+
val discriminator: kotlin.String,
42+
43+
@SerialName(value = "another_discriminator")
44+
val anotherDiscriminator: kotlin.String,
45+
3946
@SerialName(value = "propertyB")
4047
val propertyB: kotlin.String? = null,
4148

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@
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>
8781
<dependency>
8882
<groupId>io.swagger.core.v3</groupId>
8983
<artifactId>swagger-annotations</artifactId>

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

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

8-
import io.swagger.annotations.*;
98
import io.swagger.v3.oas.annotations.*;
109
import io.swagger.v3.oas.annotations.media.*;
1110
import io.swagger.v3.oas.annotations.responses.*;
@@ -21,18 +20,13 @@
2120
* Represents a collection of functions to interact with the API endpoints.
2221
*/
2322
@Path("/another-fake/dummy")
24-
@Api(description = "the another-fake API")
2523
@Tag(name = "another-fake")
2624
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
2725
public class AnotherFakeApi {
2826

2927
@PATCH
3028
@Consumes({ "application/json" })
3129
@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-
})
3630
@Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number")
3731
@ApiResponses(value = {
3832
@ApiResponse(responseCode = "200", description = "successful operation")

0 commit comments

Comments
 (0)