Show changed enum values in console output
Fixes #620
What changed
MarkdownRender reports added and removed enum values, but the default CLI (console) output stayed silent about them. Following the example from the issue, diffing two specs where an enum value is added to a response schema used to print only:
Return Type:
- Changed 200 OK
Media types:
- Changed application/json
Schema: Broken compatibility
with no hint about what actually broke backward compatibility.
ConsoleRender now mirrors the enum change reporting of MarkdownRender inside its existing incompatibilities listing, keeping the terse style of the neighboring console rows and the dotted property-path prefix convention:
Return Type:
- Changed 200 OK
Media types:
- Changed application/json
Schema: Broken compatibility
Added enum value: [n].someProperty ENUM_VALUE_3
Removed enum values are reported the same way (Removed enum value: ...), e.g. when a value disappears from a request schema.
Fixtures and tests
- New fixture pair
enum_diff_1.yaml/enum_diff_2.yamlreproducing the scenario from the issue (response array items with an enum property that gainsENUM_VALUE_3). ConsoleRenderTest: asserts the console output reports the added enum value underSchema: Broken compatibility.MarkdownRenderTest: asserts the equivalent markdown output (Added enum value/ENUM_VALUE_3) on the same fixture pair, guarding existing markdown behavior.
Scope note
This PR is a first slice of the renderer parity work sketched in the issue: it covers schema enum-value changes in ConsoleRender only, no renderer rewrite. The gaps mentioned in the issue discussion remain possible follow-ups:
- ConsoleRender does not walk
getOneOfSchema()the way MarkdownRender does (reported by the community in the issue comments). - Compatible schema changes (e.g. an enum value removed from a response) still print no details in the console, since its detail listing is scoped to broken compatibility.
Validation
mvnw -pl core test: 272 tests, 0 failuresmvnw -pl cli test: build success (module has no test sources)
Summary by cubic
Fixes the console (ConsoleRender) staying silent about added and removed enum values, so the default CLI output now prints rows like Added enum value: [n].someProperty ENUM_VALUE_3 under the broken-compatibility listing, matching what MarkdownRender already reports. Compatible schema changes still print no details, and getOneOfSchema() is still not walked; this is a first slice of renderer parity with no renderer rewrite.
Adds a fixture pair (enum_diff_1.yaml / enum_diff_2.yaml) that adds an enum value to a response schema, plus matching assertions in ConsoleRenderTest and MarkdownRenderTest.