Skip to content

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