Skip to content

Commit 58fe32b

Browse files
committed
add to compiled samples
1 parent c751e31 commit 58fe32b

File tree

5 files changed

+21
-40
lines changed
  • samples/server
    • others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix
    • petstore/kotlin-springboot-sort-validation/.openapi-generator

5 files changed

+21
-40
lines changed

samples/server/others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# org.openapitools.server - Kotlin Server library for Polymorphism example with allOf and discriminator
1+
# org.openapitools.server - Kotlin Server library for Basic polymorphism example with discriminator
22

33
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44

samples/server/others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix/src/main/kotlin/org/openapitools/server/models/Cat.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Polymorphism example with allOf and discriminator
2+
* Basic polymorphism example with discriminator
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
55
* The version of the OpenAPI document: 1.0
@@ -11,24 +11,21 @@
1111
*/
1212
package org.openapitools.server.models
1313

14-
import org.openapitools.server.models.Pet
1514

1615
/**
17-
* A representation of a cat
16+
* A pet cat
1817
* @param huntingSkill The measured skill for hunting
18+
* @param petType
1919
*/
2020
data class Cat(
2121
/* The measured skill for hunting */
2222

2323
@field:com.fasterxml.jackson.annotation.JsonProperty("huntingSkill")
2424
val huntingSkill: Cat.HuntingSkill,
2525

26-
@field:com.fasterxml.jackson.annotation.JsonProperty("name")
27-
override val name: kotlin.String,
28-
2926
@field:com.fasterxml.jackson.annotation.JsonProperty("petType")
30-
override val petType: kotlin.String
31-
) : Pet(name = name, petType = petType)
27+
val petType: kotlin.Any? = null
28+
) : Pet()
3229
{
3330
/**
3431
* The measured skill for hunting
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Polymorphism example with allOf and discriminator
2+
* Basic polymorphism example with discriminator
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
55
* The version of the OpenAPI document: 1.0
@@ -11,24 +11,19 @@
1111
*/
1212
package org.openapitools.server.models
1313

14-
import org.openapitools.server.models.Pet
1514

1615
/**
17-
* A representation of a dog
16+
* A pet dog
17+
* @param petType
1818
* @param packSize the size of the pack the dog is from
1919
*/
2020
data class Dog(
21+
22+
@field:com.fasterxml.jackson.annotation.JsonProperty("petType")
23+
val petType: kotlin.Any?,
2124
/* the size of the pack the dog is from */
2225

2326
@field:com.fasterxml.jackson.annotation.JsonProperty("packSize")
24-
val packSize: kotlin.Int = 0,
25-
26-
@field:com.fasterxml.jackson.annotation.JsonProperty("name")
27-
override val name: kotlin.String,
28-
29-
@field:com.fasterxml.jackson.annotation.JsonProperty("petType")
30-
override val petType: kotlin.String
31-
) : Pet(name = name, petType = petType)
32-
{
33-
}
27+
val packSize: kotlin.Int = 0
28+
) : Pet()
3429

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Polymorphism example with allOf and discriminator
2+
* Basic polymorphism example with discriminator
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
55
* The version of the OpenAPI document: 1.0
@@ -11,25 +11,16 @@
1111
*/
1212
package org.openapitools.server.models
1313

14+
import org.openapitools.server.models.Cat
15+
import org.openapitools.server.models.Dog
1416

1517
/**
1618
*
17-
* @param name
18-
* @param petType
1919
*/
20-
@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY, property = "petType", visible = true)
20+
@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY, property = "petType", visible = false)
2121
@com.fasterxml.jackson.annotation.JsonSubTypes(
22-
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Cat::class, name = "Cat"),
23-
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Dog::class, name = "Dog")
24-
)
25-
sealed class Pet(
26-
27-
@field:com.fasterxml.jackson.annotation.JsonProperty("name")
28-
open val name: kotlin.String
29-
,
30-
31-
@field:com.fasterxml.jackson.annotation.JsonProperty("petType")
32-
open val petType: kotlin.String
33-
22+
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Cat::class, name = "cat"),
23+
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Dog::class, name = "dog")
3424
)
25+
sealed class Pet
3526

samples/server/petstore/kotlin-springboot-sort-validation/.openapi-generator/FILES

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.openapi-generator-ignore
21
README.md
32
build.gradle.kts
43
gradle/wrapper/gradle-wrapper.jar
@@ -18,4 +17,3 @@ src/main/kotlin/org/openapitools/configuration/ValidSort.kt
1817
src/main/kotlin/org/openapitools/model/Pet.kt
1918
src/main/kotlin/org/openapitools/model/PetSort.kt
2019
src/main/resources/application.yaml
21-
src/test/kotlin/org/openapitools/api/PetApiTest.kt

0 commit comments

Comments
 (0)