contribution #6123: add spring support for SSE conform specs (#16543)

* add spring support for SSE conform specs

see https://github.com/OpenAPITools/openapi-generator/issues/6123 for the ongoing discussion

* extend generator option documentation

* applied review suggestions

* regenerated samples

* regenerated docu

* fix code style: removed tabs
This commit is contained in:
krasv
2023-09-21 11:08:24 +02:00
committed by GitHub
parent 254b359a56
commit 8f8fd85fd6
172 changed files with 1287 additions and 32 deletions

View File

@@ -60,6 +60,7 @@ public interface PetApi {
consumes = { "application/json", "application/xml" }
)
@ResponseStatus(HttpStatus.OK)
default Pet addPet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
) {
@@ -95,6 +96,7 @@ public interface PetApi {
value = "/pet/{petId}"
)
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void deletePet(
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
@@ -134,6 +136,7 @@ public interface PetApi {
produces = { "application/xml", "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default List<Pet> findPetsByStatus(
@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List<String> status
) {
@@ -174,6 +177,7 @@ public interface PetApi {
produces = { "application/xml", "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default List<Pet> findPetsByTags(
@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags
) {
@@ -211,6 +215,7 @@ public interface PetApi {
produces = { "application/xml", "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default Pet getPetById(
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
) {
@@ -256,6 +261,7 @@ public interface PetApi {
consumes = { "application/json", "application/xml" }
)
@ResponseStatus(HttpStatus.OK)
default Pet updatePet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
) {
@@ -293,6 +299,7 @@ public interface PetApi {
consumes = { "application/x-www-form-urlencoded" }
)
@ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
default void updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
@ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
@@ -334,6 +341,7 @@ public interface PetApi {
consumes = { "multipart/form-data" }
)
@ResponseStatus(HttpStatus.OK)
default ModelApiResponse uploadFile(
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
@ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,

View File

@@ -51,6 +51,7 @@ public interface StoreApi {
value = "/store/order/{orderId}"
)
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
) {
@@ -84,6 +85,7 @@ public interface StoreApi {
produces = { "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default Map<String, Integer> getInventory(
) {
@@ -118,6 +120,7 @@ public interface StoreApi {
produces = { "application/xml", "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default Order getOrderById(
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
) {
@@ -151,6 +154,7 @@ public interface StoreApi {
consumes = { "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default Order placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
) {

View File

@@ -53,6 +53,7 @@ public interface UserApi {
consumes = { "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default void createUser(
@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user
) {
@@ -85,6 +86,7 @@ public interface UserApi {
consumes = { "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default void createUsersWithArrayInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user
) {
@@ -117,6 +119,7 @@ public interface UserApi {
consumes = { "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default void createUsersWithListInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user
) {
@@ -150,6 +153,7 @@ public interface UserApi {
value = "/user/{username}"
)
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void deleteUser(
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
) {
@@ -184,6 +188,7 @@ public interface UserApi {
produces = { "application/xml", "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default User getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
) {
@@ -217,6 +222,7 @@ public interface UserApi {
produces = { "application/xml", "application/json" }
)
@ResponseStatus(HttpStatus.OK)
default String loginUser(
@NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
@@ -248,6 +254,7 @@ public interface UserApi {
value = "/user/logout"
)
@ResponseStatus(HttpStatus.OK)
default void logoutUser(
) {
@@ -283,6 +290,7 @@ public interface UserApi {
consumes = { "application/json" }
)
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void updateUser(
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user