@@ -2769,15 +2769,15 @@ func TestConstructJSON(t *testing.T) {
27692769 },
27702770 inAppendMod : true ,
27712771 wantIETF : map [string ]interface {}{
2772- "f1" : "foo" ,
2773- "config" : map [string ]interface {}{
2772+ "f1mod: f1" : "foo" ,
2773+ "f1mod: config" : map [string ]interface {}{
27742774 "f2mod:f6" : "mat" ,
27752775 },
27762776 "f2mod:config" : map [string ]interface {}{
27772777 "f2" : "bar" ,
27782778 "f3mod:f7" : "bat" ,
27792779 },
2780- "f3" : map [string ]interface {}{
2780+ "f1mod: f3" : map [string ]interface {}{
27812781 "f42mod:config" : map [string ]interface {}{
27822782 "f4" : "baz" ,
27832783 },
@@ -3552,7 +3552,7 @@ func TestEncodeTypedValue(t *testing.T) {
35523552 },
35533553 inEnc : gnmipb .Encoding_JSON_IETF ,
35543554 want : & gnmipb.TypedValue {Value : & gnmipb.TypedValue_JsonIetfVal {[]byte (`{
3555- "f1": "hello"
3555+ "f1mod: f1": "hello"
35563556}` )}},
35573557 }, {
35583558 name : "struct val - ietf json different module" ,
@@ -3858,7 +3858,7 @@ func TestMarshal7951(t *testing.T) {
38583858 inArgs : []Marshal7951Arg {
38593859 & RFC7951JSONConfig {AppendModuleName : true },
38603860 },
3861- want : `{"f1":"hello"}` ,
3861+ want : `{"f1mod: f1":"hello"}` ,
38623862 }, {
38633863 desc : "complex children with module name prepend request" ,
38643864 in : & ietfRenderExample {
@@ -3873,22 +3873,22 @@ func TestMarshal7951(t *testing.T) {
38733873 JSONIndent (" " ),
38743874 },
38753875 want : `{
3876- "enum-list": [
3876+ "f1mod: enum-list": [
38773877 {
38783878 "config": {
38793879 "key": "foo:VAL_ONE"
38803880 },
38813881 "key": "foo:VAL_ONE"
38823882 }
38833883 ],
3884- "f2mod:config": {
3885- "f2": "bar"
3886- },
3887- "mixed-list": [
3884+ "f1mod:mixed-list": [
38883885 "foo:VAL_ONE",
38893886 "test",
38903887 42
3891- ]
3888+ ],
3889+ "f2mod:config": {
3890+ "f2": "bar"
3891+ }
38923892}` ,
38933893 }, {
38943894 desc : "complex children with PrependModuleNameIdentityref=true" ,
@@ -3935,22 +3935,22 @@ func TestMarshal7951(t *testing.T) {
39353935 JSONIndent (" " ),
39363936 },
39373937 want : `{
3938- "enum-list": [
3938+ "f1mod: enum-list": [
39393939 {
39403940 "config": {
39413941 "key": "foo:VAL_ONE"
39423942 },
39433943 "key": "foo:VAL_ONE"
39443944 }
39453945 ],
3946- "f2mod:config": {
3947- "f2": "bar"
3948- },
3949- "mixed-list": [
3946+ "f1mod:mixed-list": [
39503947 "foo:VAL_ONE",
39513948 "test",
39523949 42
3953- ]
3950+ ],
3951+ "f2mod:config": {
3952+ "f2": "bar"
3953+ }
39543954}` ,
39553955 }}
39563956
0 commit comments