Question/Bug: Path-Parameter should be specified as required when @RequestMapping has multiple paths.
See original GitHub issueSpringfox Swagger version 2.9.2
when Request Mapping has multiple paths like this.
@ApiOperation(value = "Creates a client application")
@RequestMapping(method = POST,
value = {
"path1",
"path2/{optionalSamplePathParam}/path"
},
produces = APPLICATION_JSON_VALUE)
public Response someControllerMethod(@PathVariable optionalSamplePathParam, @RequestBody someObject)
{
//some code within ApiOperation
}
Swagger UI though shows 2 different listing for each of the path, it still shows SamplePathParam in listing of “path1” where it is not applicable, It should ideally not show that at all.
What is the solution or work-around for this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to use multiple @RequestMapping annotations in spring?
@RequestMapping has a String[] value parameter, so you should be able to specify multiple values like this: @RequestMapping(value={"", "/" ...
Read more >Spring @RequestMapping - Baeldung
Multiple @PathVariable. A more complex URI may need to map multiple parts of the URI to multiple values: @RequestMapping(value ...
Read more >Spring MVC @RequestMapping Annotation Example with ...
RequestMapping annotation is used to map web requests onto specific handler classes and/or handler methods. Spring @RequestMapping @RequestParam ...
Read more >Using the Spring @RequestMapping Annotation - DZone
You can have multiple request mappings for a method. For that add one @RequestMapping annotation with a list of values.
Read more >RequestMapping and @PathVariable Annotations - Code by ...
This annotation can be applied at the class or method level. It maps a specific request path or pattern onto a controller. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No there isnt unfortunately. Not to say that it wont be fixed, but at the moment that is the level of support that we have for multiple request mapping paths
This issue has been automatically closed because it has not had recent activity. Please re-open a new issue if this is still an issue.