Skip to content

fix: OAS 3.0 exclusiveMinimum/Maximum parsing exception - #2137

Merged
lbroudoux merged 2 commits into
microcks:masterfrom
vleon1a:feat/oas30
Jun 1, 2026
Merged

lbroudoux merged 2 commits into
microcks:masterfrom
vleon1a:feat/oas30

Conversation

@vleon1a

@vleon1a vleon1a commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

When Microcks parses an OAS 3.0 specification with exclusiveMinimum and/or exclusiveMaximum set as booleans (as expected for OAS 3.0), it throws a JsonSchemaException.

The fix is the following:

  • Update JsonSchemaValidator to allow providing a schema version, keeping V202012 as default
  • Update OpenAPISchemaValidator to extract the openapi field, and force the schema V4 if it starts with 3.0.

Fix tested locally using compose, adding my application to it, and triggering the OPEN API SCHEMA conformance test.
Attaching the logs before/after the fix:

Small bonus: The project requires Java 25, but the BUILDING.md was mentioning 21

Related issue(s)

Fixes #2129

@github-actions

Copy link
Copy Markdown

👋 @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!

@vleon1a
vleon1a marked this pull request as ready for review May 27, 2026 12:40
@SebastienDegodez SebastienDegodez added java Pull requests that update Java code kind/task labels May 27, 2026

@SebastienDegodez SebastienDegodez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vleon1a

vleon1a commented May 28, 2026 •

Copy link
Copy Markdown
Contributor Author

LGTM

Thanks @SebastienDegodez !
Is it possible to include it in the 1.15.0 milestone?

@SebastienDegodez SebastienDegodez added this to the 1.15.0 milestone May 28, 2026
@SebastienDegodez

Copy link
Copy Markdown
Member

LGTM

Thanks @SebastienDegodez ! Is it possible to include it in the 1.15.0 milestone?

Yes !
Another review @lbroudoux ?

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed some changes in 0abf8d4

Comment thread BUILDING.md Resolved
@lbroudoux

Copy link
Copy Markdown
Member

Is it possible to include it in the 1.15.0 milestone?

Yes, I'd like to!

@vleon1a

vleon1a commented May 28, 2026 •

Copy link
Copy Markdown
Contributor Author

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?

Thanks for reviewing!
Let me see how I can rework the visibility aspect, it makes sense
As for the draft version, I did not see any any issue but I can't claim that this is exhaustive, I'll try to do some research on that, but for sure the V4 is the only one working from the library perspective

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks all good to me. Thanks!

@lbroudoux
lbroudoux merged commit 879d725 into microcks:master Jun 1, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/tests java Pull requests that update Java code kind/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OAS 3.0 exclusiveMinimum/Maximum parsing exception

3 participants