-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Generating labels of validate.OneOf(labels=[..]) in the json schema #679
Comments
This is actually a bug I came here to report. We have enum values in the The |
Thanks for reporting. Anyone willing to propose a PR for this? Thanks. |
I haven’t yet made a PR because I am not 100% certain that using the labels is the canonical solution here. the other option is to use the field to serialise the choices; after all, the OpenAPI spec needs serialised values, while the Labels on the other hand are intended to serve as UI depictions of each value, which doesn’t necessarily mean that they are the exact same thing as the serialised version for each choice. To illustrate: a TimeDelta field could be constrained with OneOf values for 1 hour, 1 day, 1 week, etc. with the values being So, if I’m creating a PR, I’d be leaning towards explicit conversion of the OneOf choices values. |
Hi,
I have the following field in marshmallow:
And the resulting json:
Is there a way to also print the labels
['one', 'two', 'three']
in the json ?The text was updated successfully, but these errors were encountered: