-
-
Notifications
You must be signed in to change notification settings - Fork 544
Closed
swagger-api/swagger-core
#4954Labels
invalidThis doesn't seem rightThis doesn't seem right
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).
kememex
Metadata
Metadata
Assignees
Labels
invalidThis doesn't seem rightThis doesn't seem right