Skip to content

feat: compare OpenAPI response examples - #2244

Open
ME-Massine wants to merge 1 commit into
microcks:masterfrom
ME-Massine:issue-2243-json-response-example-comparison
Open

feat: compare OpenAPI response examples#2244
ME-Massine wants to merge 1 commit into
microcks:masterfrom
ME-Massine:issue-2243-json-response-example-comparison

Conversation

@ME-Massine

@ME-Massine ME-Massine commented Jul 30, 2026

Copy link
Copy Markdown

What does this PR do?

Adds optional JSON response-example comparison to the /tests API for OPEN_API_SCHEMA tests.

Two comparison modes are supported:

  • STRICT: requires the same JSON structure and values while ignoring array ordering.
  • LENIENT: requires all expected values while allowing additional object fields and array elements.

The comparison runs after the existing status-code, content-type, and schema validation. When the option is omitted, existing behavior remains unchanged.

The OpenAPI specification and frontend TypeScript model are also updated.

Closes #2243

How was this tested?

  • Added matcher tests covering strict matching, lenient matching, unordered arrays, duplicate elements, and ambiguous array matches.
  • Added OpenAPI runner tests covering both modes and backward compatibility.
  • Added controller tests covering JSON deserialization and option propagation.
  • Java 25 Maven reactor build completed successfully.
  • 11 focused tests passed with 0 failures.
  • Spotless formatting and checks passed.
  • OpenAPI YAML parsing passed.

FOSSA reports 5 License Compliance issues, but the same check also fails on the PR’s base commit. This PR does not modify any dependency manifests or introduce new dependencies, so the findings appear to be pre-existing baseline issues.

Signed-off-by: ME-Massine <massine268@gmail.com>
@github-actions

Copy link
Copy Markdown

👋 @ME-Massine

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!

@SebastienDegodez

Copy link
Copy Markdown
Member

I think it would be ideal if the 'enum' were never null. That would simplify passing arguments to constructors by initializing it directly to the default behavior.

What do you think?

@lbroudoux

Copy link
Copy Markdown
Member

Thanks for jumping on this but the request for enhancement has to be carefully analysed first. As described here: #2243 (comment) I'm not sure this is the right approach and I'm opening the discussion on other (IMHO better) alternatives. Please join us on the issue threads if you have some opinion on this!

@ME-Massine

Copy link
Copy Markdown
Author

I think it would be ideal if the 'enum' were never null. That would simplify passing arguments to constructors by initializing it directly to the default behavior.

What do you think?

@SebastienDegodez Good point. null currently means “disabled” to preserve existing behavior. If we keep this approach, I can replace it with an explicit DISABLED default.

@ME-Massine

Copy link
Copy Markdown
Author

Thanks for jumping on this but the request for enhancement has to be carefully analysed first. As described here: #2243 (comment) I'm not sure this is the right approach and I'm opening the discussion on other (IMHO better) alternatives. Please join us on the issue threads if you have some opinion on this!

@lbroudoux Thanks for the context. I see the distinction now. I’ll pause changes here and continue the discussion in #2243 first.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions Bot added the stale State due to inactivity label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale State due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON comparison of OpenAPI response examples with actual

3 participants