ygot
ygot copied to clipboard
Add `RFC7951JSONConfig.PrependModuleNameNonRootTopLevel` flag
// PrependModuleNameNonRootTopLevel specifies that the top-level field
// names of a non-root ValidatedGoStruct being marshalled should always
// have their belonging-module names prepended in the JSON output,
// instead of only being present when its namespace differs from the
// namespace of its parent.
// NOTE: This flag is used to preserve [email protected] behaviour in
// code that depends on it. This will be deprecated in the future.
PrependModuleNameNonRootTopLevel bool
Coverage increased (+0.003%) to 90.84% when pulling 815da893873fa2ebf018188a24b577466100012f on prepend-nonroot-toplevel into c15884d06738b435020d84e167f7143627bf19ea on master.
@wenovus -- is this request dead at this point? I don't see that we concluded that we needed a change, and it looks like we didn't get asked again?
@wenovus -- is this request dead at this point? I don't see that we concluded that we needed a change, and it looks like we didn't get asked again?
I forgot the background for this PR.
I actually think we did the wrong thing here, and agree with your last comment that https://github.com/openconfig/ygot/issues/637 was a wrong bug report. I can see that prepending the module makes sense because it helps to distinguish between same-named nodes in different namespaces.
I feel like this hasn't caused an issue because in OpenConfig we forbid the occurrence of same-named nodes in different namespaces. I'm ok with just closing this PR, or if there is a need, reverting the fix for https://github.com/openconfig/ygot/issues/637 as you suggested and then adding a flag for the current behaviour.
@robshakir to make sure you received the ping on the previous comment.