-
Notifications
You must be signed in to change notification settings - Fork 172
fix for issue 814 #836
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
fix for issue 814 #836
Conversation
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.
Pull Request Overview
This PR fixes issue #814 by improving the validation of array examples in OpenAPI specifications. The fix properly handles array comparison for primitive types by using deep equality checks instead of relying on Objects.equals()
alone.
- Adds specialized array comparison logic for changed examples
- Adds test case to verify CSV media type response examples with binary format
- Refactors example validation to handle arrays of primitive types correctly
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
ChangedExample.java | Implements array-specific comparison logic using reflection and deep equality |
ConsoleRenderTest.java | Adds test to verify no differences shown for identical CSV binary examples |
issue-828-binary-example-for-csv-media-type.yaml | Test resource file for CSV media type validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
core/src/main/java/org/openapitools/openapidiff/core/model/ChangedExample.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/openapitools/openapidiff/core/output/ConsoleRenderTest.java
Outdated
Show resolved
Hide resolved
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.
@wexom thank you for your efforts. BTW - we have ChangedExamples.java, seems it will have the same problem.
core/src/main/java/org/openapitools/openapidiff/core/model/ChangedExample.java
Show resolved
Hide resolved
core/src/main/java/org/openapitools/openapidiff/core/model/ChangedExample.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/openapitools/openapidiff/core/output/ConsoleRenderTest.java
Outdated
Show resolved
Hide resolved
…ays of primitive types changed equal validation for changed example to properly validate arrays of primitive types
…hangedExamples.java, Fixed suggestion from copilot, grammatical error
formatting fix
60f9776
to
77dfb93
Compare
fixes #814
changed equal validation for changed example to properly validate arrays of primitive types