Adding the @ApiOperation to an @Api annotated controller is messing with the path of the resource. Basically the @Api.value attribute is mapped into the resource path. While the JavaDoc of @Api is just saying that the value (default) attribute is a "Short descriptions" it really turns out that it is used as request path here. @Api always requires the value attribute when specifying the description attribute. Also, this effect only shows up after adding a @ApiOperation annotation.
Looks like a clash of swagger core and swagger4spring. Maybe swagger4spring can come up with dedicated @ApiDescription annotations that allow just adding the description without the request mapping?
// swagger4spring takes the description, but value is mandatory
@Api(value = "User Account resource API", description = "User Account resource API")
@Controller
@ExposesResourceFor(UserAccountResource.class)
@RequestMapping(value = UserAccountController.REQUEST_MAPPING_PATH, produces = {"application/json"})
public class UserAccountController {
public static final String REQUEST_MAPPING_PATH = "/userAccounts";
@Autowired
private UserAccountFacade userAccountFacade;
@ApiOperation(value="Find all user accounts", notes="Find all user accounts")
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public PagedResources<UserAccountResource> findAll(@NonNull Pageable pageable, @NonNull PagedResourcesAssembler pagedAssembler) {
return userAccountFacade.findAll(pageable, pagedAssembler);
}
This turns the output of ...userAccount/resourceList/doc/userAccountsinto
Adding the @ApiOperation to an @Api annotated controller is messing with the path of the resource. Basically the @Api.value attribute is mapped into the resource path. While the JavaDoc of @Api is just saying that the value (default) attribute is a "Short descriptions" it really turns out that it is used as request path here. @Api always requires the value attribute when specifying the description attribute. Also, this effect only shows up after adding a @ApiOperation annotation.
Looks like a clash of swagger core and swagger4spring. Maybe swagger4spring can come up with dedicated @ApiDescription annotations that allow just adding the description without the request mapping?
This turns the output of
...userAccount/resourceList/doc/userAccounts
intoUsing 0.3.4-SNAPSHOT (today)