Skip to content

Show media type example changes in reports - #930

Open
MoChiUaena wants to merge 3 commits into
OpenAPITools:masterfrom
MoChiUaena:codex/render-media-type-example-changes
Open

MoChiUaena wants to merge 3 commits into
OpenAPITools:masterfrom
MoChiUaena:codex/render-media-type-example-changes

Conversation

@MoChiUaena

@MoChiUaena MoChiUaena commented Sep 28, 2026 •

Copy link
Copy Markdown

An example or examples update can mark an operation as changed while leaving the report with no details when the schema stays the same.

Add example details to the Console, Markdown, Asciidoc and HTML renderers. Added and removed values are shown directly; updates show the old and new values. For named examples, the complete old and new maps are displayed. HTML values are escaped, and Markdown and Asciidoc values use code blocks. When Jackson reports a serialization error, that detail shows a placeholder and the rest of the report continues. A warning is logged without calling the example object's toString(). Example changes keep their existing metadata classification.

The 91 regression cases cover request and response examples, additions, removals, updates, examples alongside schema changes, unchanged examples, markup escaping, throwing getters, self-references, and serialization failures on either side of an update for both singular and named examples. All pass with this change.

Tested on Windows:

  • ./mvnw.cmd -V -B -ntp -ff clean verify on JDK 8, 11 and 21.
  • ./mvnw.cmd -V -B -ntp -ff -Dmaven.compiler.release=8 clean verify on JDK 17.
  • ./mvnw.cmd -B -ntp com.coveo:fmt-maven-plugin:check.
  • Packaged CLI on JDK 8: all four exported reports include the old and new example values, --state returns metadata, and --fail-on-incompatible exits 0.

Fixes #872.


Summary by cubic

Media type example changes now show up in Console, Markdown, Asciidoc, and HTML reports, so an operation isn't marked changed with no visible detail when only an example value differs.

  • Added and removed values render directly; updates show old and new values.
  • Named examples display as complete old and new maps.
  • HTML escapes values; Markdown and Asciidoc put them in code blocks.
  • Examples that can't be serialized render as a placeholder while the rest of the report still renders.
  • Example changes keep their existing metadata classification.
  • Fixes Renderers should display example changes, not just schema changes #872.

Written for commit 9e41545. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

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.

Renderers should display example changes, not just schema changes

1 participant