Repository navigation
fix: OAS 3.0 exclusiveMinimum/Maximum parsing exception - #2137
Conversation
|
👋 @vleon1a Welcome to the Microcks community! 💖 Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly. Hope you have a great time there! |
Thanks @SebastienDegodez ! |
Yes ! |
lbroudoux
left a comment
There was a problem hiding this comment.
Thanks for pushing this! I have 2 concerns:
- One regarding the visibility of
SpecVersion.VersionFlag=> I would prefer to hide the underlying implementation, - One regarding the actual schema version used for OpenAPI 3.0.x => the spes says Draft-05 but it's not supported by the validation library so you proposed fallabcking to Draft-04. Can the differences be neglected?
| * @return The list of validation failure messages. If empty, json object is valid ! | ||
| */ | ||
| public static List<String> validateJson(JsonNode schemaNode, JsonNode jsonNode, String namespace, | ||
| SpecVersion.VersionFlag versionFlag) { |
There was a problem hiding this comment.
Got the same concern here about making SpecVersion.VersionFlag visible as it's an implementation details that may switch in the future... Maybe we can reintroduce the JSON_V4_SCHEMA_IDENTIFIER and others above as an enumerated type and do the conversion to SpecVersion.VersionFlag internally?
I think it would safer for the future.
Yes, I'd like to! |
Thanks for reviewing! |
Signed-off-by: Vincent Leon <[email protected]>
Signed-off-by: Vincent Leon <[email protected]>
lbroudoux
left a comment
There was a problem hiding this comment.
It looks all good to me. Thanks!
Description
When Microcks parses an OAS 3.0 specification with
exclusiveMinimumand/orexclusiveMaximumset asbooleans(as expected for OAS 3.0), it throws aJsonSchemaException.The fix is the following:
JsonSchemaValidatorto allow providing a schema version, keepingV202012as defaultOpenAPISchemaValidatorto extract theopenapifield, and force the schemaV4if it starts with3.0.Fix tested locally using compose, adding my application to it, and triggering the
OPEN API SCHEMAconformance test.Attaching the logs before/after the fix:
Small bonus: The project requires Java 25, but the
BUILDING.mdwas mentioning 21Related issue(s)
Fixes #2129