@@ -2873,15 +2873,15 @@ func TestConstructJSON(t *testing.T) {
28732873 },
28742874 inAppendMod : true ,
28752875 wantIETF : map [string ]interface {}{
2876- "f1" : "foo" ,
2877- "config" : map [string ]interface {}{
2876+ "f1mod: f1" : "foo" ,
2877+ "f1mod: config" : map [string ]interface {}{
28782878 "f2mod:f6" : "mat" ,
28792879 },
28802880 "f2mod:config" : map [string ]interface {}{
28812881 "f2" : "bar" ,
28822882 "f3mod:f7" : "bat" ,
28832883 },
2884- "f3" : map [string ]interface {}{
2884+ "f1mod: f3" : map [string ]interface {}{
28852885 "f42mod:config" : map [string ]interface {}{
28862886 "f4" : "baz" ,
28872887 },
@@ -3895,7 +3895,7 @@ func TestEncodeTypedValue(t *testing.T) {
38953895 },
38963896 inEnc : gnmipb .Encoding_JSON_IETF ,
38973897 want : & gnmipb.TypedValue {Value : & gnmipb.TypedValue_JsonIetfVal {[]byte (`{
3898- "f1": "hello"
3898+ "f1mod: f1": "hello"
38993899}` )}},
39003900 }, {
39013901 name : "struct val - ietf json different module" ,
@@ -4201,7 +4201,7 @@ func TestMarshal7951(t *testing.T) {
42014201 inArgs : []Marshal7951Arg {
42024202 & RFC7951JSONConfig {AppendModuleName : true },
42034203 },
4204- want : `{"f1":"hello"}` ,
4204+ want : `{"f1mod: f1":"hello"}` ,
42054205 }, {
42064206 desc : "complex children with module name prepend request" ,
42074207 in : & ietfRenderExample {
@@ -4216,22 +4216,22 @@ func TestMarshal7951(t *testing.T) {
42164216 JSONIndent (" " ),
42174217 },
42184218 want : `{
4219- "enum-list": [
4219+ "f1mod: enum-list": [
42204220 {
42214221 "config": {
42224222 "key": "foo:VAL_ONE"
42234223 },
42244224 "key": "foo:VAL_ONE"
42254225 }
42264226 ],
4227- "f2mod:config": {
4228- "f2": "bar"
4229- },
4230- "mixed-list": [
4227+ "f1mod:mixed-list": [
42314228 "foo:VAL_ONE",
42324229 "test",
42334230 42
4234- ]
4231+ ],
4232+ "f2mod:config": {
4233+ "f2": "bar"
4234+ }
42354235}` ,
42364236 }, {
42374237 desc : "complex children with PrependModuleNameIdentityref=true" ,
@@ -4278,22 +4278,22 @@ func TestMarshal7951(t *testing.T) {
42784278 JSONIndent (" " ),
42794279 },
42804280 want : `{
4281- "enum-list": [
4281+ "f1mod: enum-list": [
42824282 {
42834283 "config": {
42844284 "key": "foo:VAL_ONE"
42854285 },
42864286 "key": "foo:VAL_ONE"
42874287 }
42884288 ],
4289- "f2mod:config": {
4290- "f2": "bar"
4291- },
4292- "mixed-list": [
4289+ "f1mod:mixed-list": [
42934290 "foo:VAL_ONE",
42944291 "test",
42954292 42
4296- ]
4293+ ],
4294+ "f2mod:config": {
4295+ "f2": "bar"
4296+ }
42974297}` ,
42984298 }}
42994299
0 commit comments