one-data-model / language

(Old repo:) Simple Definition Format (SDF) for One Data Model definitions
7 stars 4 forks source link

Allow any type in enums #100

Open mjkoster opened 4 years ago

mjkoster commented 4 years ago

relax numbering requirement as we did for "id" quality

mjkoster commented 4 years ago

PR #101

cabo commented 4 years ago

One problem with making enums just sets of strings is that when an actual string occurs in the interchange, you don't know which of the enums it is from. So "down" might be the from the "state of a server" enum, from the "direction of arrow" enum, from the "filling material of pillow" enum etc. Namespacing the strings helps with that. URIs are one kind of namespacing, which happens to be both well understood and well-supported by RDF.

WAvdBeek commented 4 years ago

enums can be anything, it does not have to be an number. enums in JSON can be a list of strings, list of numbers/integers can even an combination of those (which I do not recommend) hence this is not the C-style enum where each definition can be regarded as an definition of an integer value, using the definition as the description what it means.