You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue with SpringDoc OpenAPI when using a Java record named Item. The generated schema incorrectly places the reason field from the Serial record as a direct field of Item, while the serial field is completely ignored. Additionally, the Serial record is not documented as a separate schema at all.
Example record definition:
public record Item(
String itemNo,
String material,
String quantity,
List<Serial> serials
) {}
public record Serial(
String serial,
String reason
) {}
However, when I rename Item to Item2, the schema is generated correctly. This suggests a possible naming conflict affecting schema generation.
Could you please confirm whether this is a bug or an expected limitation?
Let me know if you need more details or sample output.
Below are the sample records and the controller that uses the wrapper one. (Item)
public record Item(
String itemNo,
String material,
String quantity,
List<Serial> serials
) {}
public record Serial(
String serial,
String reason
) {}
@RestController
public class ItemsController{
public void add(@RequestBody Item item){
}
}
The text was updated successfully, but these errors were encountered:
Describe the bug
I encountered an issue with SpringDoc OpenAPI when using a Java record named Item. The generated schema incorrectly places the reason field from the Serial record as a direct field of Item, while the serial field is completely ignored. Additionally, the Serial record is not documented as a separate schema at all.
Example record definition:
However, when I rename Item to Item2, the schema is generated correctly. This suggests a possible naming conflict affecting schema generation.
Could you please confirm whether this is a bug or an expected limitation?
Let me know if you need more details or sample output.
To Reproduce
Steps to reproduce the behavior:
actual.txt
expected.txt
Below are the sample records and the controller that uses the wrapper one. (Item)
The text was updated successfully, but these errors were encountered: