-
-
Notifications
You must be signed in to change notification settings - Fork 537
Open
Description
Describe the bug
The type
property of @Schema
has no effect for objects in the "Schemas" section of the Swagger page.
To Reproduce
Can be reproduced by cloning this repository, running mvn spring-boot:run
, and navigating to http://localhost:8081/swagger-ui.html.
The UserModel
class is explicitly defined as type = "integer"
:
public class UserModel {
...
/** User's age */
@Schema(type = "integer", format = "int8")
private byte age;
}
yet the default type (string
for byte
s in Java) is not overriden:

I've tested this with type = "integer"
on both Java String
s and byte
s, both with the same result.
Expected behavior
The integer
type being applied to the field in Swagger.
Screenshots
See above
Additional context
Using SpringDocs 2.8.9 and Spring Boot 3.5.4 (see POM of linked repo reproducing issue for other version info).
Metadata
Metadata
Assignees
Labels
No labels