-
Notifications
You must be signed in to change notification settings - Fork 531
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
Fixes issue 1975: bug in const processing, const values of all types now processable #1996
Conversation
@frantuma @gracekarina thank you for your work on swagger-parser. |
ObjectNode objNode = mapper.createObjectNode(); | ||
objNode.put("foo", "bar"); | ||
objNode.put("baz", "bax"); | ||
assertEquals(openAPI.getComponents().getSchemas().get("ConstWithObject").getConst(), objNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a LinkedHashMap instead?
ObjectNode arrayItem = mapper.createObjectNode(); | ||
arrayItem.put("foo", "bar"); | ||
arrayNode.add(arrayItem); | ||
assertEquals(openAPI.getComponents().getSchemas().get("ConstWithArray").getConst(), arrayNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a List or ArrayList instead?
78849f1
to
1b1fa85
Compare
Thanks! |
Thanks you for the review and merge! |
Changes const type from String to Object
Per json schema docs, const stores one values of any json schema type
"schema"
key: https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/const.json#L6Verification:
If merged, this will close out these issues: