forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: value renderer for google.protobuf.Any (cosmos#13671)
* chore: skeleton files for any renderer * feat: first cut at Any renderer and tests * test: Any fields, more tests, rename lookup by field * docs: make Any example match the stated spec, and the implementation. * refactor: use protojson for better test case legibility * test: use protocmp for proto equality See https://developers.google.com/protocol-buffers/docs/reference/go/faq#deepequal * refactor: use json.RawMessage instead of remarshalling * refactor: consistent pointer receiver for Textual
- Loading branch information
Showing
15 changed files
with
592 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[ | ||
{ | ||
"proto": { | ||
"@type": "type.googleapis.com/Foo" | ||
}, | ||
"screens": [ | ||
{"text": "Object: type.googleapis.com/Foo"}, | ||
{"text": "Foo object", "indent": 1} | ||
] | ||
}, | ||
{ | ||
"proto": { | ||
"@type": "type.googleapis.com/Foo", | ||
"full_name": "testing" | ||
}, | ||
"screens": [ | ||
{"text": "Object: type.googleapis.com/Foo"}, | ||
{"text": "Foo object", "indent": 1}, | ||
{"text": "Full name: testing", "indent": 2} | ||
] | ||
}, | ||
{ | ||
"proto": { | ||
"@type": "type.googleapis.com/google.protobuf.Timestamp", | ||
"value": "2006-01-02T15:04:05Z" | ||
}, | ||
"screens": [ | ||
{"text": "Object: type.googleapis.com/google.protobuf.Timestamp"}, | ||
{"text": "2006-01-02T15:04:05Z", "indent": 1} | ||
] | ||
}, | ||
{ | ||
"proto": { | ||
"@type": "type.googleapis.com/google.protobuf.Any", | ||
"value": { | ||
"@type": "type.googleapis.com/Foo" | ||
} | ||
}, | ||
"screens": [ | ||
{"text": "Object: type.googleapis.com/google.protobuf.Any"}, | ||
{"text": "Object: type.googleapis.com/Foo", "indent": 1}, | ||
{"text": "Foo object", "indent": 2} | ||
] | ||
}, | ||
{ | ||
"proto": { | ||
"@type": "type.googleapis.com/google.protobuf.Any", | ||
"value": { | ||
"@type": "type.googleapis.com/Foo", | ||
"full_name": "testing" | ||
} | ||
}, | ||
"screens": [ | ||
{"text": "Object: type.googleapis.com/google.protobuf.Any"}, | ||
{"text": "Object: type.googleapis.com/Foo", "indent": 1}, | ||
{"text": "Foo object", "indent": 2}, | ||
{"text": "Full name: testing", "indent": 3} | ||
] | ||
}, | ||
{ | ||
"proto": { | ||
"@type": "type.googleapis.com/A", | ||
"ANY": { | ||
"@type": "type.googleapis.com/Foo", | ||
"full_name": "testing" | ||
} | ||
}, | ||
"screens": [ | ||
{"text": "Object: type.googleapis.com/A"}, | ||
{"text": "A object", "indent": 1}, | ||
{"text": "ANY: Object: type.googleapis.com/Foo", "indent": 2}, | ||
{"text": "Foo object", "indent": 3}, | ||
{"text": "Full name: testing", "indent": 4} | ||
] | ||
} | ||
] |
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.