Open
Description
Background
After upgrading swagger to 3.1 we face the issue that our schema annotations which have numbers in their examples gets interpreted as integers even though the type is a string.
Example
record TestDto (@Schema(example = "notANumber") String name, int age) {} //works perfectly fine
record TestDtoClone (@Schema(example = "1234", type = "string") String name, int age) {} //interpreted as integer even with type="string"
I created a small demo project with a basic test:
https://github.com/EAlf91/swagger-issue/blob/main/src/test/java/org/example/MainTest.java
Expected Behaviour
String examples are correctly interpreted as string when typing is provided
Metadata
Assignees
Labels
No labels