Skip to content

Configurable cache'ing of OpenAPI instances #1554

Closed
@piotrp

Description

@piotrp

Is your feature request related to a problem? Please describe.
I want to filter returned OpenAPI operations by using logged-in user's permissions - hide administrative endpoints from end-users, while still allowing application administrators to view them. Currently I'm running with disabled cache, but building OpenAPI definitions is expensive ("Init duration for springdoc-openapi" reports between 500 and 1000ms on my laptop) and I'd like to optimize this.

Describe the solution you'd like
A way to customize cache'ing, basically override get/set methods on OpenAPIService.cachedOpenAPI. Or making constructor of OpenAPIService public so that I can provide custom implementation.

Describe alternatives you've considered
A separate GroupedOpenApi instances, but this would require dynamic filtering of /metadata/{group} (MultipleOpenApiWebMvcResource) and /metadata (SwaggerConfigResource).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions