wkennedy / swagger4spring-web

Swagger support for Spring MVC
89 stars 46 forks source link

Request method from a class level @RequestMapping annotation is not honored #47

Closed MartinAhrer closed 10 years ago

MartinAhrer commented 10 years ago

SwaggerOperation findOne is missing method is reported while the request method should be inherited from the class declaration. I believe there is even a default (GET) when no @RequestMappingspecifies a method.

@Controller
@ExposesResourceFor(UserAccountResource.class)
@RequestMapping(value = UserAccountController.REQUEST_MAPPING_PATH, produces = {"application/json"}, method = RequestMethod.GET)
public class UserAccountController {
    @RequestMapping(value = "/{reference}")
    public ResponseEntity<UserAccountResource> findOne(@NonNull @PathVariable UUID reference) {
wkennedy commented 10 years ago

Added a fix to default to GET when no HttpMethod is supplied. It does not inherit from the class annotation, but I agree it should.