[Java][Spring] fix Spring RequestMapping (#9900)

This commit is contained in:
Oleh Kurpiak
2021-07-27 09:27:47 +03:00
committed by GitHub
parent fcdc9d49f7
commit b1cc7445a0
139 changed files with 1688 additions and 832 deletions

View File

@@ -42,7 +42,8 @@ public interface AnotherFakeApi {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
@ApiImplicitParams({
})
@PatchMapping(
@RequestMapping(
method = RequestMethod.PATCH,
value = "/another-fake/dummy",
produces = { "application/json" },
consumes = { "application/json" }

View File

@@ -51,7 +51,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/create_xml_item",
consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }
)
@@ -73,7 +74,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/boolean",
produces = { "*/*" }
)
@@ -95,7 +97,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/composite",
produces = { "*/*" }
)
@@ -126,7 +129,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/number",
produces = { "*/*" }
)
@@ -148,7 +152,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Output string", response = String.class) })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/string",
produces = { "*/*" }
)
@@ -170,7 +175,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Success") })
@ApiImplicitParams({
})
@PutMapping(
@RequestMapping(
method = RequestMethod.PUT,
value = "/fake/body-with-file-schema",
consumes = { "application/json" }
)
@@ -192,7 +198,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Success") })
@ApiImplicitParams({
})
@PutMapping(
@RequestMapping(
method = RequestMethod.PUT,
value = "/fake/body-with-query-params",
consumes = { "application/json" }
)
@@ -214,7 +221,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
@ApiImplicitParams({
})
@PatchMapping(
@RequestMapping(
method = RequestMethod.PATCH,
value = "/fake",
produces = { "application/json" },
consumes = { "application/json" }
@@ -264,7 +272,8 @@ public interface FakeApi {
@ApiResponse(code = 404, message = "User not found") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake",
consumes = { "application/x-www-form-urlencoded" }
)
@@ -295,7 +304,8 @@ public interface FakeApi {
@ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List<String>", paramType = "header"),
@ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header")
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/fake",
consumes = { "application/x-www-form-urlencoded" }
)
@@ -322,7 +332,8 @@ public interface FakeApi {
@ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required=true, dataType = "Boolean", paramType = "header"),
@ApiImplicitParam(name = "booleanGroup", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header")
})
@DeleteMapping(
@RequestMapping(
method = RequestMethod.DELETE,
value = "/fake"
)
default ResponseEntity<Void> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) {
@@ -342,7 +353,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/inline-additionalProperties",
consumes = { "application/json" }
)
@@ -364,7 +376,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/fake/jsonFormData",
consumes = { "application/x-www-form-urlencoded" }
)
@@ -390,7 +403,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "Success") })
@ApiImplicitParams({
})
@PutMapping(
@RequestMapping(
method = RequestMethod.PUT,
value = "/fake/test-query-paramters"
)
default ResponseEntity<Void> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List<String> http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List<String> url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List<String> context) {
@@ -416,7 +430,8 @@ public interface FakeApi {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/{petId}/uploadImageWithRequiredFile",
produces = { "application/json" },
consumes = { "multipart/form-data" }

View File

@@ -45,7 +45,8 @@ public interface FakeClassnameTestApi {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
@ApiImplicitParams({
})
@PatchMapping(
@RequestMapping(
method = RequestMethod.PATCH,
value = "/fake_classname_test",
produces = { "application/json" },
consumes = { "application/json" }

View File

@@ -49,7 +49,8 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/pet",
consumes = { "application/json", "application/xml" }
)
@@ -77,7 +78,8 @@ public interface PetApi {
@ApiImplicitParams({
@ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header")
})
@DeleteMapping(
@RequestMapping(
method = RequestMethod.DELETE,
value = "/pet/{petId}"
)
default ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId) {
@@ -104,7 +106,8 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid status value") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByStatus",
produces = { "application/xml", "application/json" }
)
@@ -147,7 +150,8 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid tag value") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByTags",
produces = { "application/xml", "application/json" }
)
@@ -190,7 +194,8 @@ public interface PetApi {
@ApiResponse(code = 404, message = "Pet not found") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/{petId}",
produces = { "application/xml", "application/json" }
)
@@ -235,7 +240,8 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Validation exception") })
@ApiImplicitParams({
})
@PutMapping(
@RequestMapping(
method = RequestMethod.PUT,
value = "/pet",
consumes = { "application/json", "application/xml" }
)
@@ -262,7 +268,8 @@ public interface PetApi {
@ApiResponse(code = 405, message = "Invalid input") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}",
consumes = { "application/x-www-form-urlencoded" }
)
@@ -289,7 +296,8 @@ public interface PetApi {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage",
produces = { "application/json" },
consumes = { "multipart/form-data" }

View File

@@ -45,7 +45,8 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") })
@ApiImplicitParams({
})
@DeleteMapping(
@RequestMapping(
method = RequestMethod.DELETE,
value = "/store/order/{order_id}"
)
default ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) {
@@ -68,7 +69,8 @@ public interface StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/store/inventory",
produces = { "application/json" }
)
@@ -94,7 +96,8 @@ public interface StoreApi {
@ApiResponse(code = 404, message = "Order not found") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/store/order/{order_id}",
produces = { "application/xml", "application/json" }
)
@@ -131,7 +134,8 @@ public interface StoreApi {
@ApiResponse(code = 400, message = "Invalid Order") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/store/order",
produces = { "application/xml", "application/json" }
)

View File

@@ -43,7 +43,8 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/user"
)
default ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) {
@@ -63,7 +64,8 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithArray"
)
default ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
@@ -83,7 +85,8 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@PostMapping(
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithList"
)
default ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
@@ -106,7 +109,8 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") })
@ApiImplicitParams({
})
@DeleteMapping(
@RequestMapping(
method = RequestMethod.DELETE,
value = "/user/{username}"
)
default ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) {
@@ -130,7 +134,8 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/user/{username}",
produces = { "application/xml", "application/json" }
)
@@ -168,7 +173,8 @@ public interface UserApi {
@ApiResponse(code = 400, message = "Invalid username/password supplied") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/user/login",
produces = { "application/xml", "application/json" }
)
@@ -188,7 +194,8 @@ public interface UserApi {
@ApiResponse(code = 200, message = "successful operation") })
@ApiImplicitParams({
})
@GetMapping(
@RequestMapping(
method = RequestMethod.GET,
value = "/user/logout"
)
default ResponseEntity<Void> logoutUser() {
@@ -212,7 +219,8 @@ public interface UserApi {
@ApiResponse(code = 404, message = "User not found") })
@ApiImplicitParams({
})
@PutMapping(
@RequestMapping(
method = RequestMethod.PUT,
value = "/user/{username}"
)
default ResponseEntity<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 body) {