Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance failure: proto2 + JSON + extension #993

Closed
tbkka opened this issue May 14, 2020 · 5 comments
Closed

Conformance failure: proto2 + JSON + extension #993

tbkka opened this issue May 14, 2020 · 5 comments
Assignees

Comments

@tbkka
Copy link
Collaborator

tbkka commented May 14, 2020

This popped up on a CI bot:

CONFORMANCE TEST BEGIN ====================================

ERROR, test=Recommended.Proto2.JsonInput.FieldNameExtension.Validator: Expected JSON payload but got type 1. request=json_payload: "{\n "[protobuf_test_messages.proto2.extension_int32]": 1\n }" requested_output_format: JSON message_type: "protobuf_test_messages.proto2.TestAllTypesProto2" test_category: JSON_TEST, response=parse_error: "JSON failed to parse: unknownField("[protobuf_test_messages.proto2.extension_int32]")"

@thomasvl
Copy link
Collaborator

I sent some email looking for more info on proto2 extension support in JSON.

@tbkka
Copy link
Collaborator Author

tbkka commented May 14, 2020

Let me know what you find. I just pushed up a draft PR #1002 which is based on the design for TextFormat and the contents of the new conformance test. It still needs a little work before I'm happy merging it, but it's enough to at least pass that test.

@thomasvl
Copy link
Collaborator

@tbkka
Copy link
Collaborator Author

tbkka commented May 15, 2020

Thanks, Thomas! Those seem to verify what I guessed from the conformance test. Extensions are handled essentially the same as in TextFormat: The key name is surrounded by [] to mark it as an extension field name, but otherwise the coding is the same as regular JSON.

I think that's enough detail to finish up #1002 and get this landed.

@tbkka
Copy link
Collaborator Author

tbkka commented Jun 24, 2020

Fixed via #1002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants