Skip to content

Better Presentation of Maximum and Minimum String Length of An Optional Field #2631

@APIWriter

Description

@APIWriter

Describe the bug
It is confusing what the minimum string length of an optional field is. By definition, the minimum string length of an optional field should be zero. However, if a value is provided, the minimum string length will by definition change to at least 1. There isn't a way to clearly present that situation now.

In the following example, the null valid value indicates the length could be zero, but the next graphic ([5 .. 10]) seems to contradict that.
Image

Is there a better way to show this condition?

Expected behavior
One simple solution might be to reverse the order and make it "null or string [5 .. 10]".

Or

null
string:
     Minimum string length: 5
     Maximum string length: 10

Minimal reproducible OpenAPI snippet(if possible)

Screenshots
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions