Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
APIWriter opened this issue Dec 9, 2024 · 0 comments

Comments

@APIWriter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant