You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
Thank you @bnasslahsen .. sorry, I searched for @SecurityRequirement and went through the first two pages of issues and didn't see anything relevant. Appreciate the response
bnasslahsen
changed the title
Annotations don't seem to have any effect on @Repository interface
Add support of swagger annotations on @Repository interface
Aug 26, 2020
We hopefully will add the support for @SecurityRequirement and @Tags (on the Repository level) for the next release v1.4.5;
bnasslahsen
changed the title
Add support of swagger annotations on @Repository interface
Add support of swagger annotations @SecurityRequirement and @Tag on @Repository interface
Aug 26, 2020
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:
`@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
Screenshots
Additional context
Attached example of generated json from above two classes
springdoc.json.zip
The text was updated successfully, but these errors were encountered: