Closed kylef closed 7 years ago
Can you add an example for non-selected sample in PR description? I am approving it for now, but not merging yet since @klokane and @w-vi need to take a look too.
:+1:
Ops, we need change description.
Enumeration type. Exclusive list of possible elements. The elements in content's array MUST be interpreted as mutually exclusive.
Enum was designed a little different to other data structure elements. Other Data Structure elements contain a value of the data structure under content, however
enum
doesn't contain a single value that the enum was representing but instead all the possible values (enumerations) that may be inside the enum.This pull request changes
enum
so that the enum content contains the single selected enumeration, and move the available enumerations to the enumerations attribute. This allows the element to follow the normal data structure rules regarding the type fordefault
andsamples
where they would match the same type as the data structure elements content.Examples
To describe an enum with 4 possible string values,
north
,east
,south
,west
we could represent that as an enum element as follows:To describe the same enum with the four directions, and to provide a default value of
north
. We can represent that as an enum as follows:To describe the same enum, but also to provide a selected sample value of
south
: