Describe the bug
If examples start with a number and not wrapped to double quotes, only number is preserved and rest part is omitted.
To Reproduce
Steps to reproduce the behavior:
- Add some DTO with field like:
@Schema(description = "Address line 1", example = "170 Oaklands Grove")
String addressLine1
- Check yaml:
address_line1:
type: "string"
description: "Address line 1"
example: 170
- What version of spring-boot you are using?
Spring Boot 4.0.2
- What modules and versions of springdoc-openapi are you using?
Springdoc 3.0.1
- What is the actual and the expected result using OpenAPI Description (yml or json)?
Actual:
address_line1:
type: "string"
description: "Address line 1"
example: 170
Expected:
address_line1:
type: "string"
description: "Address line 1"
example: "170 Oaklands Grove"
Expected behavior
Example in yml should have the value defined in annotation 170 Oaklands Grove, not just 170.
Expected:
address_line1:
type: "string"
description: "Address line 1"
example: "170 Oaklands Grove"
Additional context
If wrapped to double quotes it works fine
@Schema(description = "Address line 1", example = "\"170 Oaklands Grove\"")
String addressLine1,
Describe the bug
If examples start with a number and not wrapped to double quotes, only number is preserved and rest part is omitted.
To Reproduce
Steps to reproduce the behavior:
Spring Boot 4.0.2
Springdoc 3.0.1
Actual:
Expected:
Expected behavior
Example in yml should have the value defined in annotation
170 Oaklands Grove, not just170.Expected:
Additional context
If wrapped to double quotes it works fine