-
Notifications
You must be signed in to change notification settings - Fork 19
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
Nullable on required lists #173
Comments
Hello, in my understanding So, And Given many issues around nullability, I think it makes sense to introduce a new field tag |
Hello @vearutop I agree with you in the Anyway, having a field tag |
Related #120 |
As per JSON schema semantics, Constraint keywords like |
It depends on the viewpoint. In go-semantics it's a bit odd to accept null as valid outside of a pointer in a struct. In json schema semantics it seems to be correct. In my world, the ideal solution would be a global config-switch to switch default-behaviours between go and json schema and a additional struct-tag for finer control. This wouldn't be a breaking change and give everyone the semantics they may expect to not get confused. |
Not to argue with the necessity of flexible nullability behavior, but I think having nulls for maps and slices is within expectations. At least std JSON encoder in Go treats nil maps/slices this way (without having a ptr). |
Describe the bug
When declaring struct with list i.e.
final openapi.json has
nullable: true
on these fields. Usingusecase.Interactor
it seems that there is no way to indicate those fields as non-nullable.Expected behavior
Required lists should not be nullable.
The text was updated successfully, but these errors were encountered: