Skip to content

Commit 9ed1d01

Browse files
committed
adding generated samples and documentation
1 parent 25a7873 commit 9ed1d01

10 files changed

Lines changed: 142 additions & 10 deletions

File tree

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import javax.ws.rs.*;
88
import javax.ws.rs.core.Response;
99

10-
10+
import org.jboss.resteasy.reactive.ResponseStatus;
1111

1212

1313

@@ -68,10 +68,12 @@ public class PetApi {
6868
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
6969
})
7070
})
71+
@ResponseStatus(200)
7172
public Response addPet(@Valid @NotNull Pet pet) {
7273
return Response.ok().entity("magic!").build();
7374
}
7475

76+
7577
@DELETE
7678
@Path("/{petId}")
7779
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@@ -84,10 +86,12 @@ public Response addPet(@Valid @NotNull Pet pet) {
8486

8587
})
8688
})
89+
8790
public Response deletePet(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Pet id to delete") Long petId) {
8891
return Response.ok().entity("magic!").build();
8992
}
9093

94+
9195
@GET
9296
@Path("/findByStatus")
9397
@Produces({ "application/xml", "application/json" })
@@ -106,10 +110,12 @@ public Response deletePet(@PathParam("petId") @org.eclipse.microprofile.openapi.
106110
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
107111
})
108112
})
113+
@ResponseStatus(200)
109114
public Response findPetsByStatus(@Deprecated @QueryParam("status") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Status values that need to be considered for filter") List<String> status) {
110115
return Response.ok().entity("magic!").build();
111116
}
112117

118+
113119
@Deprecated
114120
@GET
115121
@Path("/findByTags")
@@ -129,10 +135,12 @@ public Response findPetsByStatus(@Deprecated @QueryParam("status") @NotNull @or
129135
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
130136
})
131137
})
138+
@ResponseStatus(200)
132139
public Response findPetsByTags(@QueryParam("tags") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Tags to filter by") List<String> tags) {
133140
return Response.ok().entity("magic!").build();
134141
}
135142

143+
136144
@GET
137145
@Path("/{petId}")
138146
@Produces({ "application/xml", "application/json" })
@@ -155,10 +163,12 @@ public Response findPetsByTags(@QueryParam("tags") @NotNull @org.eclipse.microp
155163
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
156164
})
157165
})
166+
@ResponseStatus(200)
158167
public Response getPetById(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) {
159168
return Response.ok().entity("magic!").build();
160169
}
161170

171+
162172
@PUT
163173
@Consumes({ "application/json", "application/xml" })
164174
@Produces({ "application/xml", "application/json" })
@@ -185,10 +195,12 @@ public Response getPetById(@PathParam("petId") @org.eclipse.microprofile.openapi
185195
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
186196
})
187197
})
198+
@ResponseStatus(200)
188199
public Response updatePet(@Valid @NotNull Pet pet) {
189200
return Response.ok().entity("magic!").build();
190201
}
191202

203+
192204
@POST
193205
@Path("/{petId}")
194206
@Consumes({ "application/x-www-form-urlencoded" })
@@ -202,10 +214,12 @@ public Response updatePet(@Valid @NotNull Pet pet) {
202214

203215
})
204216
})
217+
205218
public Response updatePetWithForm(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) {
206219
return Response.ok().entity("magic!").build();
207220
}
208221

222+
209223
@POST
210224
@Path("/{petId}/uploadImage")
211225
@Consumes({ "multipart/form-data" })
@@ -220,7 +234,9 @@ public Response updatePetWithForm(@PathParam("petId") @org.eclipse.microprofile.
220234
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class))
221235
})
222236
})
237+
@ResponseStatus(200)
223238
public Response uploadFile(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata,@FormParam(value = "file") InputStream _fileInputStream) {
224239
return Response.ok().entity("magic!").build();
225240
}
241+
226242
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import javax.ws.rs.*;
77
import javax.ws.rs.core.Response;
88

9-
9+
import org.jboss.resteasy.reactive.ResponseStatus;
1010

1111

1212

@@ -62,10 +62,12 @@ public class StoreApi {
6262

6363
})
6464
})
65+
6566
public Response deleteOrder(@PathParam("orderId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of the order that needs to be deleted") String orderId) {
6667
return Response.ok().entity("magic!").build();
6768
}
6869

70+
6971
@GET
7072
@Path("/inventory")
7173
@Produces({ "application/json" })
@@ -79,10 +81,12 @@ public Response deleteOrder(@PathParam("orderId") @org.eclipse.microprofile.open
7981
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Map.class))
8082
})
8183
})
84+
@ResponseStatus(200)
8285
public Response getInventory() {
8386
return Response.ok().entity("magic!").build();
8487
}
8588

89+
8690
@GET
8791
@Path("/order/{orderId}")
8892
@Produces({ "application/xml", "application/json" })
@@ -103,10 +107,12 @@ public Response getInventory() {
103107
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
104108
})
105109
})
110+
@ResponseStatus(200)
106111
public Response getOrderById(@PathParam("orderId") @Min(1L) @Max(5L) @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be fetched") Long orderId) {
107112
return Response.ok().entity("magic!").build();
108113
}
109114

115+
110116
@POST
111117
@Path("/order")
112118
@Consumes({ "application/json" })
@@ -124,7 +130,9 @@ public Response getOrderById(@PathParam("orderId") @Min(1L) @Max(5L) @org.eclips
124130
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
125131
})
126132
})
133+
@ResponseStatus(200)
127134
public Response placeOrder(@Valid @NotNull Order order) {
128135
return Response.ok().entity("magic!").build();
129136
}
137+
130138
}

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import javax.ws.rs.*;
77
import javax.ws.rs.core.Response;
88

9-
9+
import org.jboss.resteasy.reactive.ResponseStatus;
1010

1111

1212

@@ -61,10 +61,12 @@ public class UserApi {
6161

6262
})
6363
})
64+
6465
public Response createUser(@Valid @NotNull User user) {
6566
return Response.ok().entity("magic!").build();
6667
}
6768

69+
6870
@POST
6971
@Path("/createWithArray")
7072
@Consumes({ "application/json" })
@@ -78,10 +80,12 @@ public Response createUser(@Valid @NotNull User user) {
7880

7981
})
8082
})
83+
8184
public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user) {
8285
return Response.ok().entity("magic!").build();
8386
}
8487

88+
8589
@POST
8690
@Path("/createWithList")
8791
@Consumes({ "application/json" })
@@ -95,10 +99,12 @@ public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user
9599

96100
})
97101
})
102+
98103
public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user) {
99104
return Response.ok().entity("magic!").build();
100105
}
101106

107+
102108
@DELETE
103109
@Path("/{username}")
104110
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@@ -114,10 +120,12 @@ public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user)
114120

115121
})
116122
})
123+
117124
public Response deleteUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be deleted") String username) {
118125
return Response.ok().entity("magic!").build();
119126
}
120127

128+
121129
@GET
122130
@Path("/{username}")
123131
@Produces({ "application/xml", "application/json" })
@@ -138,10 +146,12 @@ public Response deleteUser(@PathParam("username") @org.eclipse.microprofile.open
138146
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
139147
})
140148
})
149+
@ResponseStatus(200)
141150
public Response getUserByName(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be fetched. Use user1 for testing.") String username) {
142151
return Response.ok().entity("magic!").build();
143152
}
144153

154+
145155
@GET
146156
@Path("/login")
147157
@Produces({ "application/xml", "application/json" })
@@ -162,10 +172,12 @@ public Response getUserByName(@PathParam("username") @org.eclipse.microprofile.o
162172
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json")
163173
})
164174
})
175+
@ResponseStatus(200)
165176
public Response loginUser(@QueryParam("username") @NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The user name for login") String username,@QueryParam("password") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The password for login in clear text") String password) {
166177
return Response.ok().entity("magic!").build();
167178
}
168179

180+
169181
@GET
170182
@Path("/logout")
171183
@org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={
@@ -178,10 +190,12 @@ public Response loginUser(@QueryParam("username") @NotNull @Pattern(regexp="^[a-
178190

179191
})
180192
})
193+
181194
public Response logoutUser() {
182195
return Response.ok().entity("magic!").build();
183196
}
184197

198+
185199
@PUT
186200
@Path("/{username}")
187201
@Consumes({ "application/json" })
@@ -198,7 +212,9 @@ public Response logoutUser() {
198212

199213
})
200214
})
215+
201216
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) {
202217
return Response.ok().entity("magic!").build();
203218
}
219+
204220
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import javax.ws.rs.*;
66
import javax.ws.rs.core.Response;
77

8-
8+
import org.jboss.resteasy.reactive.ResponseStatus;
99

1010

1111

@@ -75,7 +75,9 @@ public class AnotherFakeApi {
7575
@org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class))
7676
})
7777
})
78+
@ResponseStatus(200)
7879
public Response call123testSpecialTags(@Valid @NotNull Client client) {
7980
return Response.ok().entity("magic!").build();
8081
}
82+
8183
}

0 commit comments

Comments
 (0)