Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hardcoded locale for better caching #2836

Closed
martin-tarjanyi opened this issue Jan 7, 2025 · 2 comments
Closed

Support hardcoded locale for better caching #2836

martin-tarjanyi opened this issue Jan 7, 2025 · 2 comments
Labels
wontfix This will not be worked on

Comments

@martin-tarjanyi
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, the caching mechanism uses the locale as the key. This makes sense in some cases but in lots of cases there is no need to support different locales in the API documentation. If there is no locale-specific logic in the API docs, caching is not very effective.

Describe the solution you'd like

Provide the option to hardcode the locale for the API docs and if it is present, use that for docs generation and caching.

Describe alternatives you've considered

Pre-load all expected locales but it would be error-prone and wasteful.

@martin-tarjanyi
Copy link
Contributor Author

martin-tarjanyi commented Jan 7, 2025

Possibly the already existing disableI18n config property could be used for this purpose. If it is true, use the default locale always for resolution and caching.

Although, on second thought, it would be nice to define the locale explicitly instead of relying on the the default system locale in such scenario.

@bnasslahsen
Copy link
Collaborator

@martin-tarjanyi,

Feel free to propose directly a PR for it.

@bnasslahsen bnasslahsen added the wontfix This will not be worked on label Jan 18, 2025
martin-tarjanyi added a commit to martin-tarjanyi/springdoc-openapi that referenced this issue Jan 25, 2025
martin-tarjanyi added a commit to martin-tarjanyi/springdoc-openapi that referenced this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants