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

openapi::schema::empty is confusing or wrong #647

Closed
jayvdb opened this issue Jun 12, 2023 · 0 comments · Fixed by #648
Closed

openapi::schema::empty is confusing or wrong #647

jayvdb opened this issue Jun 12, 2023 · 0 comments · Fixed by #648

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Jun 12, 2023

https://docs.rs/utoipa/latest/utoipa/openapi/schema/fn.empty.html says

Create an empty Schema that serializes to null.
Can be used in places where an item can be serialized as null. This is used with unit type enum variants and tuple unit types.

It becomes a jsonschema

type: object
default: ~
nullable: true

Because it has type: object in there, it can not be used to describe an empty string, int, or any other type. It can only be used to describe an empty object.

It should be changed to use the new Value support added in #568

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

Successfully merging a pull request may close this issue.

1 participant