This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
Move enumerations to enumerations attribute in enum #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
: