Closed
Description
Describe the bug
When disabling all single entity access methods and only allowing whole collection endpoints like in the repository bellow. Spring doc will still show a GET method endpoint for a single entity via an ID. The corresponding endpoint will return 405 (Method not allowed) because it is disabled.
generated yaml:
/notifications:
get:
description: get-notification
......
/notifications/{id}:
get:
description: get-notification
......
To Reproduce
Using springdoc 1.5.4
@RepositoryRestResource
public interface NotificationRepository extends PagingAndSortingRepository<Notification, Long> {
//This should be the only available endpoint
@Override
@RestResource
List<Notification> findAll();
@Override
@RestResource(exported = false)
Optional<Notification> findById(Long aLong);
@Override
@RestResource(exported = false)
<S extends Notification> S save(S entity);
@Override
@RestResource(exported = false)
void deleteById(Long aLong);
}
Expected behavior
Because the single entity methods are disabled it should not be added to the docs.
/notifications:
get:
description: get-notification
......
Additional context
The endpoint is considered enabled because the collection methods are added to the item access methods.
I lack the insight of why this is done in the first place.