-
Notifications
You must be signed in to change notification settings - Fork 8
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
JSON Schema enums should have at least 1 item #85
Comments
What if I turn field back into a string value rather than an enumeration if no permitted values are provided? I could also emit a warning so we know to fix this on the Terminology Service (or the Google Sheet model, if that's where the enumeration is defined). |
I think it's good to get the enum names/schemas in the overall schema even
if they are empty. I think that's a more meaningful schema even if the
enum's content is just one "NULL" entry for now. Not sure what others
think. The change in the overall schema will be minimized as these emums
are implemented prosperity. That way, I can also show JSON Schema based
"validation rules/logic" that points to and uses those enums and this logic
won't change later even if the content of the enums changes.
|
Being able to $ref the enums is more valuable than their content, as long as the enum names are somewhat stable, or can be updated with a regex. |
I am not sure I fully understand the context. Enums should only be used if you have an enumeration. If that enumeration is empty, then it's invalid. We could potentially have a property on an enum that states whether it is open or closed, but open enums would have the same semantics as string so I am not really seeing the advantage |
Another option would be to declare specific types and map these to strings |
@gaurav @ShahimEssaid: what do you think the right course of implementation would be based on @cmungall's suggestions above? |
True! It would be convenient if Primarily, though, I think we should fix this at the sheet2linkml level by -- as Shahim suggested -- we turn an enumeration without any permissible values into an enumeration with a single permissible value, "null". Does everybody think that would be fine for now? |
The stub enums in the schema file need at least one item for the schema to be valid. Maybe some temporary "Null" value?
The text was updated successfully, but these errors were encountered: