Skip to content

[Bug]: Example text is truncated when beginning with numbers #5036

@jz-cp

Description

@jz-cp

Description of the problem/issue

I have a String field annotated with @Schema and contains example text.

@Schema(description = "Primary street address or P.O. box",
        requiredMode = Schema.RequiredMode.REQUIRED,
        example = "123 Main St")
private String street1;

In the generated JSON, the example shows as 123.

Affected Version

e.g. 2.8.15

Earliest version the bug appears in (if known):
Unknown

Steps to Reproduce

  1. Create a class with a String field
  2. Annotate it with @Schema and give example text beginning with numerals followed by plain text
  3. Look at the generated JSON output

Expected Behavior

The example should have been "123 Main St"

Actual Behavior

The example was 123 as a number, sans the remaining text.

Logs / Stack Traces

Additional Context

Checklist

  • I have searched the existing issues and this is not a duplicate.
  • I have provided sufficient information for maintainers to reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions