Closed
Description
For some projects the object properties order is not preservered in the schema.
I checked the sample-springdoc-openapi-person-service if I change the Person properties order it's reflected in the swagger specification.
I created a minimalistic project which shows that the properties order is not preserved https://github.com/jawpio/springdoc-property-ordering-test.
In above project you can see that the SampleResponseClass looks as follows:
public class SampleResponseClass {
private String id;
private String name;
private String lastName;
private boolean aValue;
but it's generated as:
"SampleResponseClass": {
"type": "object",
"properties": {
"lastName": {
"type": "string"
},
"name": {
"type": "string"
},
"id": {
"type": "string"
},
"isaValue": {
"type": "boolean"
}
}
}
I tired to find what's causing that issue, but I was unable to find the reason yet.