Skip to content

RESPECT_JSONPROPERTY_ORDER not enabled in JsonSchemaGenerator #5797

@clement-s-bridge

Description

@clement-s-bridge

Hello,

Bug description
I've noticed a difference between the JacksonSchemaModule configuration in BeanOutputConverter.java and JsonSchemaGenerator.java.

In BeanOutputConverter.java there's JacksonOption.RESPECT_JSONPROPERTY_ORDER but not in JsonSchemaGenerator.java.

This setting is useful to set the reflexion property first for MistralAI and have a more accurate response.

IMO we can add the missing settings in JsonSchemaGenerator.java it shouldn't cause any harm.

Environment
Java 25, Spring Boot 4.0.5, SpringAI 2.0.0 M4

Steps to reproduce
Create a json schema with ResponseFormat.jsonSchema(MyExpectedOutput.class). With MyExpectedOutput containing @JsonPropertyOrder(...).

Expected behavior
The json schema should respect the @JsonPropertyOrder(...) annotation but it doesn't.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions