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

Support for nullable fields in JSON schemas #129

Open
Non0mnisMoriar opened this issue Sep 11, 2023 · 0 comments
Open

Support for nullable fields in JSON schemas #129

Non0mnisMoriar opened this issue Sep 11, 2023 · 0 comments

Comments

@Non0mnisMoriar
Copy link

Hello,

Thanks for this great toolpack - I'm using it mostly to design and export JSON schemas.

One important feature that I believe might be missing (or at least, I couldn't find how to do it! apologies if that is already supported) would be the support of nullable data types, i.e. something like a field on JSON_Attribute stereotype that once set would modify the attributes' type definition in the exported schema from (example with "string" type) :

"type" : "string"

to:

"type" ["string", "null"]

so that the JSON schema supports validating payloads with corresponding fields that have the null value.

I'm not sure how difficult it would be to support this though, but I believe this is a somewhat important feature of the JSON schema spec.
(reference: http://json-schema.org/draft/2020-12/json-schema-validation.html#name-type)

Thanks again!
Regards

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

No branches or pull requests

1 participant