Open jmacauley opened 4 years ago
Just took a cursory look, it looks like JSON unmarshalling doesn't support instance-identifier
. I'm not familiar with this so it might take me some time to figure this out. @robshakir are you more familiar with this?
I also dug into this last night to see if I could shim in something to get around the error. Syntactically the identifier is a string, but behaviourally it is an identifier that references an instance node in the data tree. Not sure what type of validation you might want to put on this when doing model validation, but from my perspective getting the identifier parsed successfully is about all I need at this moment. In fact, until this fixed I will probably change the YANG to type string
just to get it parsing.
@wenovus thank you for the support.
hi folks!
Yes, today we don't support bits
or instance-identifier
types (supported types are in this table). There's no real reason that they can't be supported -- just we didn't really have folks that were using these types that had thoughts on what the representation in Go would be.
We could generate these as a *string
in the generated code, and then see whether we can re-use the leafref
validation (and when
validation going forward) to see whether they're valid instances in the schema. Adding the first part of this is relatively easy to do with changes to ygen
.
Cheers! r.
@robshakir generating them as strings would be great. Given the YANG I am using has some bugs and fails validation I am really only looking for the ability to parse it at the moment.
@wenovus sorry can I ask a side question.. Does protogenerator support YANG notification statement? I was trying to use protogenerator to convert yang(with notification statement inside) to proto, but got error below:
protogenerator.go:128] unknown type of entry Directory in findMappableEntities for xxxx
Thanks!
It does not. No ygot tool currently supports the YANG Notification or RPC statement.
r.
On Fri, 12 Jun 2020 at 18:52, saintnoah notifications@github.com wrote:
@wenovus https://github.com/wenovus sorry can I ask a side question.. Does protogenerator support YANG notification statement? https://tools.ietf.org/html/rfc6020#section-7.14.1 I was trying to use protogenerator to convert yang(with notification statement inside) to proto, but got error below:
protogenerator.go:128] unknown type of entry Directory in findMappableEntities for xxxx
Thanks!
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/openconfig/ygot/issues/398#issuecomment-643551652, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABE43VMFMQIKQ2UUUIXZGCDRWLLVPANCNFSM4NR4GHJA .
thanks Rob for the confirmation.
I am using a YANG definition from a hardware vendor that makes use of the "instance-identifier" type in a leaf definition. The generator will compile the YANG however I encounter a runtime error when parsing the result of a RESTCONF GET.
Here is the error encountered:
A quickly placed debug print shows this is the field and value causing the issue:
The associated YANG definition is as follows:
Here is the instance causing the failure: