Skip to content

Commit b3a8460

Browse files
committed
updated cxf-cdi-server sample
1 parent 492d035 commit b3a8460

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0-SNAPSHOT
1+
3.0.1-SNAPSHOT

samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public class PetApi {
4646

4747
@Consumes({ "application/json", "application/xml" })
4848

49-
@Operation(summary = "Add a new pet to the store", description = "", tags={ "pet" })
49+
@Operation(summary = "Add a new pet to the store", description = "", security = {
50+
@SecurityRequirement(name = "petstore_auth", scopes = {
51+
"" }) }, tags={ "pet" })
5052
@ApiResponses(value = {
5153
@ApiResponse(responseCode = "405", description = "Invalid input") })
5254
public Response addPet(
@@ -59,7 +61,9 @@ public Response addPet(
5961
@Path("/{petId}")
6062

6163

62-
@Operation(summary = "Deletes a pet", description = "", tags={ "pet" })
64+
@Operation(summary = "Deletes a pet", description = "", security = {
65+
@SecurityRequirement(name = "petstore_auth", scopes = {
66+
"" }) }, tags={ "pet" })
6367
@ApiResponses(value = {
6468
@ApiResponse(responseCode = "400", description = "Invalid pet value") })
6569
public Response deletePet(
@@ -74,7 +78,9 @@ public Response deletePet(
7478
@Path("/findByStatus")
7579

7680
@Produces({ "application/xml", "application/json" })
77-
@Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", tags={ "pet" })
81+
@Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", security = {
82+
@SecurityRequirement(name = "petstore_auth", scopes = {
83+
"" }) }, tags={ "pet" })
7884
@ApiResponses(value = {
7985
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))),
8086
@ApiResponse(responseCode = "400", description = "Invalid status value") })
@@ -89,7 +95,9 @@ public Response findPetsByStatus( @NotNull
8995
@Path("/findByTags")
9096

9197
@Produces({ "application/xml", "application/json" })
92-
@Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet" })
98+
@Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", security = {
99+
@SecurityRequirement(name = "petstore_auth", scopes = {
100+
"" }) }, tags={ "pet" })
93101
@ApiResponses(value = {
94102
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Pet.class)))),
95103
@ApiResponse(responseCode = "400", description = "Invalid tag value") })
@@ -103,7 +111,8 @@ public Response findPetsByTags( @NotNull
103111
@Path("/{petId}")
104112

105113
@Produces({ "application/xml", "application/json" })
106-
@Operation(summary = "Find pet by ID", description = "Returns a single pet", tags={ "pet" })
114+
@Operation(summary = "Find pet by ID", description = "Returns a single pet", security = {
115+
@SecurityRequirement(name = "api_key") }, tags={ "pet" })
107116
@ApiResponses(value = {
108117
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))),
109118
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@@ -118,7 +127,9 @@ public Response getPetById(
118127

119128
@Consumes({ "application/json", "application/xml" })
120129

121-
@Operation(summary = "Update an existing pet", description = "", tags={ "pet" })
130+
@Operation(summary = "Update an existing pet", description = "", security = {
131+
@SecurityRequirement(name = "petstore_auth", scopes = {
132+
"" }) }, tags={ "pet" })
122133
@ApiResponses(value = {
123134
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
124135
@ApiResponse(responseCode = "404", description = "Pet not found"),
@@ -133,7 +144,9 @@ public Response updatePet(
133144
@Path("/{petId}")
134145
@Consumes({ "application/x-www-form-urlencoded" })
135146

136-
@Operation(summary = "Updates a pet in the store with form data", description = "", tags={ "pet" })
147+
@Operation(summary = "Updates a pet in the store with form data", description = "", security = {
148+
@SecurityRequirement(name = "petstore_auth", scopes = {
149+
"" }) }, tags={ "pet" })
137150
@ApiResponses(value = {
138151
@ApiResponse(responseCode = "405", description = "Invalid input") })
139152
public Response updatePetWithForm(
@@ -146,7 +159,9 @@ public Response updatePetWithForm(
146159
@Path("/{petId}/uploadImage")
147160
@Consumes({ "multipart/form-data" })
148161
@Produces({ "application/json" })
149-
@Operation(summary = "uploads an image", description = "", tags={ "pet" })
162+
@Operation(summary = "uploads an image", description = "", security = {
163+
@SecurityRequirement(name = "petstore_auth", scopes = {
164+
"" }) }, tags={ "pet" })
150165
@ApiResponses(value = {
151166
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) })
152167
public Response uploadFile(

samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public Response deleteOrder(
5959
@Path("/inventory")
6060

6161
@Produces({ "application/json" })
62-
@Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", tags={ "store" })
62+
@Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", security = {
63+
@SecurityRequirement(name = "api_key") }, tags={ "store" })
6364
@ApiResponses(value = {
6465
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Map.class)))) })
6566
public Response getInventory() {

samples/server/petstore/jaxrs-cxf-cdi/swagger.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@
120120
"in" : "query",
121121
"description" : "Status values that need to be considered for filter",
122122
"required" : true,
123+
"style" : "form",
123124
"explode" : false,
124125
"schema" : {
125126
"type" : "array",
126127
"items" : {
127128
"type" : "string",
128-
"default" : "available",
129-
"enum" : [ "available", "pending", "sold" ]
129+
"enum" : [ "available", "pending", "sold" ],
130+
"default" : "available"
130131
}
131132
}
132133
} ],
@@ -173,6 +174,7 @@
173174
"in" : "query",
174175
"description" : "Tags to filter by",
175176
"required" : true,
177+
"style" : "form",
176178
"explode" : false,
177179
"schema" : {
178180
"type" : "array",

0 commit comments

Comments
 (0)