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

WIP: Implement full support for Google well-known types #428

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ported-pw
Copy link

This is a work in progress to implement support for automatically parsing and serialising arbitrary JSON into the Google well-known types around https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct and https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#value.

Changes made to make this work:

  • Adding a special type meta field, while changing the respective type hints to something akin to JSON (which can be improved once Python has proper recursive type support)
  • Changes to optional handling to facilitate NullValue
  • "Transforms" for these special types, to automatically create and parse back the correct protobuf structures for arbitrary JSON
  • A lot of serialiser and deserialiser changes

There are still some bugs to sort out before this would be ready:

  • Empty Structs are not serialised correctly, they are 0 bytes
  • Parsing Structs is broken (see test failures)

Value and a lot of other things seems to generally work.

If someone wants to pick this up and finish it, be my guest. I am submitting this because I do not currently intent on finishing it.

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

Successfully merging this pull request may close these issues.

1 participant