Skip to content

Conversation

wexom
Copy link
Contributor

@wexom wexom commented Sep 23, 2025

fixes #814

changed equal validation for changed example to properly validate arrays of primitive types

@DrSatyr DrSatyr requested a review from Copilot September 24, 2025 10:42
Copy link

@Copilot Copilot AI left a 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.

Copy link
Collaborator

@DrSatyr DrSatyr left a 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.

…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
@wexom wexom force-pushed the bugfix/issue-814-false-positive-diff-change-example-byte-array branch from 60f9776 to 77dfb93 Compare September 25, 2025 19:11
@DrSatyr DrSatyr merged commit 7d62852 into OpenAPITools:master Sep 26, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive diff change when example used
2 participants