Skip to content

Add RESPECT_JSONPROPERTY_ORDER to JsonSchemaGenerator #5798

Open
chanani wants to merge 2 commits intospring-projects:mainfrom
chanani:issue-5797
Open

Add RESPECT_JSONPROPERTY_ORDER to JsonSchemaGenerator #5798
chanani wants to merge 2 commits intospring-projects:mainfrom
chanani:issue-5797

Conversation

@chanani
Copy link
Copy Markdown
Contributor

@chanani chanani commented Apr 14, 2026

Problem

JsonSchemaGenerator was missing JacksonOption.RESPECT_JSONPROPERTY_ORDER
in its JacksonSchemaModule configuration, while BeanOutputConverter
already includes it. As a result, @JsonPropertyOrder annotations were
ignored when generating JSON schemas via ResponseFormat.jsonSchema().

Changes

  • Add JacksonOption.RESPECT_JSONPROPERTY_ORDER to JsonSchemaGenerator
  • Add test to verify @JsonPropertyOrder is respected in schema generation

See gh-5797

chanani added 2 commits April 14, 2026 09:42
Align JacksonSchemaModule configuration with BeanOutputConverter
to honor @JsonPropertyOrder when generating JSON
See spring-projectsgh-5797

Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
@chanani
Copy link
Copy Markdown
Contributor Author

chanani commented Apr 14, 2026

The failing test (WebClientStreamableHttpTransportErrorHandlingIT.testSessionRecoveryAfter404)
is unrelated to this change. It appears to be a pre-existing issue in the mcp-spring-webflux module.

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.

1 participant