forked from snabbco/snabb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib.yang.schema: implement semantics for enumeration type
Implement semantics according to RFC6020, 9.6. When validating a configuration against a schema which contains leaf foo { type enumeratoion { enum bar; enum baz; } } the resulting Lua table will contain the key "foo" whose value is the string of the chosen enum in the configuration, e.g. { foo = "baz" } It is debatable whether this should actually result in the numerical value assigned to the name in the schema.
- Loading branch information
1 parent
771b55c
commit 623aff0
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 comments
on commit 623aff0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could you also add a test case in lib.yang.data
? The test case you posted at snabbco#1415 should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I accidentally rebased this branch :( Will post a PR with the rebased branch.
Nit: s/enumeraion/enumeration/