Description
Describe the bug
No annotations that I add to @repository interfaces are used to guide the config creation
To Reproduce
Steps to reproduce the behavior:
- new Spring Boot 2.2.9-RELEASE
- springdoc-openapi-ui 1.4.4
- springdoc-openapi-data-rest 1.4.4
- Create a standard @RestController and annotate it with @tag and @securityrequirement
- Apply the same annotations to a @repository interface
- The generation for the controller works as expected, but the Repository interface annotations are ignored
`@RestController
@RequestMapping(
value = "/api/v1/integration/hawksearch",
produces = MediaType.APPLICATION_JSON_VALUE
)
@tag(name = "hawksearch-admin-controller", description = "Manage Hawksearch Data through the API")
@securityrequirement(name = "EntityAPIs")
public class HawksearchAdminController {
private final HawksearchFieldService fieldService;
private final HawksearchProductService hawksearchProductService;
private final HawksearchIndexService hawksearchIndexService;
@Autowired
public HawksearchAdminController(HawksearchFieldService fieldService,
HawksearchProductService hawksearchProductService,
HawksearchIndexService hawksearchIndexService) {
this.fieldService = fieldService;
this.hawksearchProductService = hawksearchProductService;
this.hawksearchIndexService = hawksearchIndexService;
}
@GetMapping( "/fields")
@operation(summary = "Get All Fields")
public ResponseEntity<?> getAllFields(@RequestParam Map<String, Object> parameters) {
try {
Preconditions.checkNotNull(parameters.get("instance"), "Parameter (instance) is required");
return new ResponseEntity<>(fieldService.getFields((String) parameters.get("instance")), HttpStatus.OK);
}
catch (Exception e) {
throw new RemoteServiceException(e.getMessage(), e);
}
}
@PostMapping( "/fields")
@operation(summary = "Create a new Field")
public ResponseEntity<?> createField(@RequestBody NewFieldRequest newFieldRequest) {
try {
Preconditions.checkArgument(StringUtils.isNotEmpty(newFieldRequest.getInstance()), "instance is required");
Preconditions.checkArgument(Objects.nonNull(newFieldRequest.getField()), "field is required");
return new ResponseEntity<>(fieldService.createField(newFieldRequest.getInstance(), newFieldRequest.getField()), HttpStatus.OK);
}
catch (Exception e) {
throw new RemoteServiceException(e.getMessage(), e);
}
}
}`
`@Tag(name = "Address Entity", description = "Address objects attached to Users")
@securityrequirement(name = "EntityAPIs")
@repository
public interface AddressRepository extends JpaRepository<Address, Long>, JpaSpecificationExecutor
Optional
findOneById(Long id);@query("select ua from UserAddress ua JOIN FETCH ua.address a JOIN FETCH ua.user u where u = ?1")
Collection findAllAddressesByUser(User user);
}`
Expected behavior
- The lock on the operation in swagger-ui should reference the correct authorization method to use for that path
- The Tags array at the path/operation, and the global config should contain an entry with the annotation Tag name and description
- The operation security array should contain the define security requirement
Screenshots
Additional context
Attached example of generated json from above two classes
springdoc.json.zip