-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error out for Go code generation if list key contains binary (#459)
Error out for Go code generation if list key contains binary
- Loading branch information
Showing
9 changed files
with
289 additions
and
32 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module openconfig-binary-list { | ||
namespace "urn:ocblist"; | ||
prefix "oc"; | ||
|
||
description | ||
"A simple test module that is used to verify code generation for a | ||
schema that contains a list with a binary key"; | ||
|
||
grouping single-key-config { | ||
leaf key { type binary; } | ||
} | ||
|
||
grouping lists-top { | ||
container model { | ||
container a { | ||
list single-key { | ||
key "key"; | ||
|
||
leaf key { | ||
type leafref { | ||
path "../config/key"; | ||
} | ||
} | ||
|
||
container config { | ||
uses single-key-config; | ||
} | ||
|
||
container state { | ||
config false; | ||
uses single-key-config; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
uses lists-top; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module openconfig-binary-multi-list { | ||
namespace "urn:ocbmlist"; | ||
prefix "oc"; | ||
|
||
description | ||
"A simple test module that is used to verify code generation for a | ||
schema that contains a multi-keyed list with a binary key"; | ||
|
||
grouping multi-key-config { | ||
leaf key1 { type uint32; } | ||
leaf key2 { type binary; } | ||
} | ||
|
||
grouping lists-top { | ||
container model { | ||
container b { | ||
list multi-key { | ||
key "key1 key2"; | ||
|
||
leaf key1 { | ||
type leafref { | ||
path "../config/key1"; | ||
} | ||
} | ||
|
||
leaf key2 { | ||
type leafref { | ||
path "../config/key2"; | ||
} | ||
} | ||
|
||
container config { | ||
uses multi-key-config; | ||
} | ||
|
||
container state { | ||
config false; | ||
uses multi-key-config; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
uses lists-top; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module openconfig-union-binary-list { | ||
namespace "urn:ocublist"; | ||
prefix "oc"; | ||
|
||
description | ||
"A simple test module that is used to verify code generation for a | ||
schema that contains a list with a union key containing a binary"; | ||
|
||
grouping single-key-config { | ||
leaf key { | ||
type union { | ||
type string; | ||
type binary; | ||
} | ||
} | ||
} | ||
|
||
grouping lists-top { | ||
container model { | ||
container a { | ||
list single-key { | ||
key "key"; | ||
|
||
leaf key { | ||
type leafref { | ||
path "../config/key"; | ||
} | ||
} | ||
|
||
container config { | ||
uses single-key-config; | ||
} | ||
|
||
container state { | ||
config false; | ||
uses single-key-config; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
uses lists-top; | ||
|
||
} |
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
Oops, something went wrong.