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

Refactor Replace hardcoded schema prefix length #2664

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

zinzoddari
Copy link
Contributor

HI πŸ™‹πŸ»β€β™€οΈ

The code was previously hardcoding the length of the string [ #/components/schemas/ ] (21) directly in the code. It has now been modified to use the length of the constant value declared in the [ Components ] class of [ io.swagger.v3.oas.models ].

Thank you πŸ™‡πŸ»β€β™€οΈ

@zinzoddari
Copy link
Contributor Author

The reason for this change was that when I first looked at the code, it took me a while to understand why the number 21 was used. By relying on the constant value, any future changes to the value can be handled without manually finding and updating the code. Additionally, it makes it easier to understand which length of value is being referenced. πŸ’ͺπŸ»πŸ˜ƒ

@bnasslahsen bnasslahsen merged commit 089287d into springdoc:main Sep 17, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants