Skip to content

Commit 622ad79

Browse files
committed
Fix test case
1 parent b04617d commit 622ad79

11 files changed

Lines changed: 43 additions & 21 deletions

File tree

samples/server/others/kotlin-server/polymorphism-allof-and-discriminator/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 Basic polymorphism example with discriminator
1+
# org.openapitools.server - Kotlin Server library for Polymorphism example with allOf and discriminator
22

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

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Basic polymorphism example with discriminator
2+
* Polymorphism example with allOf and 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,22 +11,24 @@
1111
*/
1212
package org.openapitools.server.models
1313

14+
import org.openapitools.server.models.Pet
1415

1516
/**
16-
* A pet cat
17+
* A representation of a cat
1718
* @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+
2629
@field:com.fasterxml.jackson.annotation.JsonProperty("petType")
27-
override val petType: kotlin.String = "cat",
28-
29-
) : Pet(petType = petType)
30+
override val petType: kotlin.String
31+
) : Pet(name = name, petType = petType)
3032
{
3133
/**
3234
* The measured skill for hunting
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Basic polymorphism example with discriminator
2+
* Polymorphism example with allOf and 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,19 +11,24 @@
1111
*/
1212
package org.openapitools.server.models
1313

14+
import org.openapitools.server.models.Pet
1415

1516
/**
16-
* A pet dog
17-
* @param petType
17+
* A representation of a dog
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-
override val petType: kotlin.String = "dog",
2421
/* the size of the pack the dog is from */
2522

2623
@field:com.fasterxml.jackson.annotation.JsonProperty("packSize")
27-
val packSize: kotlin.Int = 0
28-
) : Pet(petType = petType)
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+
}
2934

samples/server/others/kotlin-server/polymorphism-allof-and-discriminator/src/main/kotlin/org/openapitools/server/models/Pet.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Basic polymorphism example with discriminator
2+
* Polymorphism example with allOf and 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,20 +11,23 @@
1111
*/
1212
package org.openapitools.server.models
1313

14-
import org.openapitools.server.models.Cat
15-
import org.openapitools.server.models.Dog
1614

1715
/**
18-
* A pet
16+
*
17+
* @param name
1918
* @param petType
2019
*/
2120
@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)
2221
@com.fasterxml.jackson.annotation.JsonSubTypes(
23-
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Cat::class, name = "cat"),
24-
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Dog::class, name = "dog")
22+
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Cat::class, name = "Cat"),
23+
com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Dog::class, name = "Dog")
2524
)
2625
sealed class Pet(
2726

27+
@field:com.fasterxml.jackson.annotation.JsonProperty("name")
28+
open val name: kotlin.String
29+
,
30+
2831
@field:com.fasterxml.jackson.annotation.JsonProperty("petType")
2932
open val petType: kotlin.String
3033

samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public Response findPetsByTags(@QueryParam("tags") @NotNull @org.eclipse.microp
155155
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
156156
})
157157
})
158+
@io.quarkus.security.Authenticated
158159
public Response getPetById(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) {
159160
return Response.ok().entity("magic!").build();
160161
}

samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public Response deleteOrder(@PathParam("orderId") @org.eclipse.microprofile.open
7979
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Map.class))
8080
})
8181
})
82+
@io.quarkus.security.Authenticated
8283
public Response getInventory() {
8384
return Response.ok().entity("magic!").build();
8485
}

samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public class UserApi {
6161

6262
})
6363
})
64+
@io.quarkus.security.Authenticated
6465
public Response createUser(@Valid @NotNull User user) {
6566
return Response.ok().entity("magic!").build();
6667
}
@@ -78,6 +79,7 @@ public Response createUser(@Valid @NotNull User user) {
7879

7980
})
8081
})
82+
@io.quarkus.security.Authenticated
8183
public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user) {
8284
return Response.ok().entity("magic!").build();
8385
}
@@ -95,6 +97,7 @@ public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user
9597

9698
})
9799
})
100+
@io.quarkus.security.Authenticated
98101
public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user) {
99102
return Response.ok().entity("magic!").build();
100103
}
@@ -114,6 +117,7 @@ public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user)
114117

115118
})
116119
})
120+
@io.quarkus.security.Authenticated
117121
public Response deleteUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be deleted") String username) {
118122
return Response.ok().entity("magic!").build();
119123
}
@@ -178,6 +182,7 @@ public Response loginUser(@QueryParam("username") @NotNull @Pattern(regexp="^[a-
178182

179183
})
180184
})
185+
@io.quarkus.security.Authenticated
181186
public Response logoutUser() {
182187
return Response.ok().entity("magic!").build();
183188
}
@@ -198,6 +203,7 @@ public Response logoutUser() {
198203

199204
})
200205
})
206+
@io.quarkus.security.Authenticated
201207
public Response updateUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="name that need to be deleted") String username,@Valid @NotNull User user) {
202208
return Response.ok().entity("magic!").build();
203209
}

samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ public Response testClientModel(@Valid @NotNull Client client) {
297297

298298
})
299299
})
300+
@io.quarkus.security.Authenticated
300301
public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") LocalDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) {
301302
return Response.ok().entity("magic!").build();
302303
}

samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class FakeClassnameTestApi {
7777
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class))
7878
})
7979
})
80+
@io.quarkus.security.Authenticated
8081
public Response testClassname(@Valid @NotNull Client client) {
8182
return Response.ok().entity("magic!").build();
8283
}

samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public Response findPetsByTags(@QueryParam("tags") @NotNull @org.eclipse.microp
172172
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
173173
})
174174
})
175+
@io.quarkus.security.Authenticated
175176
public Response getPetById(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) {
176177
return Response.ok().entity("magic!").build();
177178
}

0 commit comments

Comments
 (0)