feat: change Schema.required from List to Set (#5027)#5037
Open
yht0827 wants to merge 1 commit intoswagger-api:masterfrom
Open
feat: change Schema.required from List to Set (#5027)#5037yht0827 wants to merge 1 commit intoswagger-api:masterfrom
yht0827 wants to merge 1 commit intoswagger-api:masterfrom
Conversation
11 tasks
073befa to
88e6aab
Compare
Contributor
|
Hi @yht0827,
They also differ in how they treat empty/null:
|
88e6aab to
74b6c87
Compare
- Change internal storage from List<String> to Set<String> using TreeSet - Keep public API compatible (getRequired() returns a defensive copy as List<String>) - Make addRequiredItem() consistent with setRequired(): ignore items not present in properties - Add JavaDoc to getRequired() explaining the defensive copy behavior - Add unit tests for duplicate handling, sorting, and consisteny
ff8fc26 to
d9cf8b5
Compare
Author
|
Hi @ewaostrowska, thank you for the detailed review! I've addressed all the feedback:
Please take another look when you have a chance. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Thank you for contributing to swagger-core!
Please fill out the following information to help us review your PR efficiently.
Description
Change
Schema.requiredfield type fromList<String>toSet<String>to prevent duplicate required properties.Fixes: #5027
Type of Change
Checklist
Screenshots / Additional Context