forked from loafle/openapi-generator-original
[Java][Spring] fix Spring RequestMapping (#9900)
This commit is contained in:
@@ -32,7 +32,8 @@ public interface AnotherFakeApi {
|
||||
@ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@PatchMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PATCH,
|
||||
value = "/another-fake/dummy",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" }
|
||||
|
||||
@@ -41,7 +41,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@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" }
|
||||
)
|
||||
@@ -58,7 +59,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake/outer/boolean",
|
||||
produces = { "*/*" }
|
||||
)
|
||||
@@ -75,7 +77,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake/outer/composite",
|
||||
produces = { "*/*" }
|
||||
)
|
||||
@@ -92,7 +95,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake/outer/number",
|
||||
produces = { "*/*" }
|
||||
)
|
||||
@@ -109,7 +113,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Output string", response = String.class) })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake/outer/string",
|
||||
produces = { "*/*" }
|
||||
)
|
||||
@@ -126,7 +131,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Success") })
|
||||
@PutMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PUT,
|
||||
value = "/fake/body-with-file-schema",
|
||||
consumes = { "application/json" }
|
||||
)
|
||||
@@ -143,7 +149,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Success") })
|
||||
@PutMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PUT,
|
||||
value = "/fake/body-with-query-params",
|
||||
consumes = { "application/json" }
|
||||
)
|
||||
@@ -160,7 +167,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@PatchMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PATCH,
|
||||
value = "/fake",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" }
|
||||
@@ -196,7 +204,8 @@ public interface FakeApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake",
|
||||
consumes = { "application/x-www-form-urlencoded" }
|
||||
)
|
||||
@@ -222,7 +231,8 @@ public interface FakeApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid request"),
|
||||
@ApiResponse(code = 404, message = "Not found") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/fake",
|
||||
consumes = { "application/x-www-form-urlencoded" }
|
||||
)
|
||||
@@ -244,7 +254,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Someting wrong") })
|
||||
@DeleteMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.DELETE,
|
||||
value = "/fake"
|
||||
)
|
||||
ResponseEntity<Void> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@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 = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group);
|
||||
@@ -259,7 +270,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake/inline-additionalProperties",
|
||||
consumes = { "application/json" }
|
||||
)
|
||||
@@ -276,7 +288,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/fake/jsonFormData",
|
||||
consumes = { "application/x-www-form-urlencoded" }
|
||||
)
|
||||
@@ -297,7 +310,8 @@ public interface FakeApi {
|
||||
@ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "Success") })
|
||||
@PutMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PUT,
|
||||
value = "/fake/test-query-paramters"
|
||||
)
|
||||
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);
|
||||
@@ -318,7 +332,8 @@ public interface FakeApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/fake/{petId}/uploadImageWithRequiredFile",
|
||||
produces = { "application/json" },
|
||||
consumes = { "multipart/form-data" }
|
||||
|
||||
@@ -35,7 +35,8 @@ public interface FakeClassnameTestApi {
|
||||
}, tags={ "fake_classname_tags 123#$%^", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@PatchMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PATCH,
|
||||
value = "/fake_classname_test",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" }
|
||||
|
||||
@@ -38,7 +38,8 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/pet",
|
||||
consumes = { "application/json", "application/xml" }
|
||||
)
|
||||
@@ -61,7 +62,8 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@DeleteMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.DELETE,
|
||||
value = "/pet/{petId}"
|
||||
)
|
||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey);
|
||||
@@ -83,7 +85,8 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid status value") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/findByStatus",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
@@ -107,7 +110,8 @@ public interface PetApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/findByTags",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
@@ -131,7 +135,8 @@ public interface PetApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/{petId}",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
@@ -157,7 +162,8 @@ public interface PetApi {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
@PutMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PUT,
|
||||
value = "/pet",
|
||||
consumes = { "application/json", "application/xml" }
|
||||
)
|
||||
@@ -179,7 +185,8 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/pet/{petId}",
|
||||
consumes = { "application/x-www-form-urlencoded" }
|
||||
)
|
||||
@@ -201,7 +208,8 @@ public interface PetApi {
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/pet/{petId}/uploadImage",
|
||||
produces = { "application/json" },
|
||||
consumes = { "multipart/form-data" }
|
||||
|
||||
@@ -35,7 +35,8 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Order not found") })
|
||||
@DeleteMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.DELETE,
|
||||
value = "/store/order/{order_id}"
|
||||
)
|
||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId);
|
||||
@@ -53,7 +54,8 @@ public interface StoreApi {
|
||||
}, tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/store/inventory",
|
||||
produces = { "application/json" }
|
||||
)
|
||||
@@ -74,7 +76,8 @@ public interface StoreApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Order not found") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/store/order/{order_id}",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
@@ -92,7 +95,8 @@ public interface StoreApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/store/order",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
|
||||
@@ -33,7 +33,8 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/user"
|
||||
)
|
||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body);
|
||||
@@ -48,7 +49,8 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/user/createWithArray"
|
||||
)
|
||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
@@ -63,7 +65,8 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@PostMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.POST,
|
||||
value = "/user/createWithList"
|
||||
)
|
||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
||||
@@ -81,7 +84,8 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
@DeleteMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.DELETE,
|
||||
value = "/user/{username}"
|
||||
)
|
||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username);
|
||||
@@ -100,7 +104,8 @@ public interface UserApi {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/user/{username}",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
@@ -119,7 +124,8 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/user/login",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
@@ -134,7 +140,8 @@ public interface UserApi {
|
||||
@ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
@GetMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/user/logout"
|
||||
)
|
||||
ResponseEntity<Void> logoutUser();
|
||||
@@ -153,7 +160,8 @@ public interface UserApi {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
@PutMapping(
|
||||
@RequestMapping(
|
||||
method = RequestMethod.PUT,
|
||||
value = "/user/{username}"
|
||||
)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user