Skip to content

Extend proto-lens API to support serializing the protobuf JSON format - #455

Open
iand675 wants to merge 9 commits into
google:masterfrom
iand675:proto-lens-json
Open

Extend proto-lens API to support serializing the protobuf JSON format#455
iand675 wants to merge 9 commits into
google:masterfrom
iand675:proto-lens-json

Conversation

@iand675

@iand675 iand675 commented Dec 2, 2023

Copy link
Copy Markdown

I needed to support JSON deserialization to the Protobuf models to integrate with a third party system with a large number of protocol buffer definitions, so it was infeasible to hand-write them.

This PR adds support for the serialization formats outlined here: https://protobuf.dev/programming-guides/proto3/#json

I also bumped some dependencies and replaced the Setup.hs codegen approach for the official protobuf types because the Setup.hs approach absolutely refused to work in the upstream Nix project. I could probably roll it back, but it's nice IMO to be able to use some of the base packages to the ecosystem without having to have the protocol buffer compiler installed.

@blackgnezdo

Copy link
Copy Markdown
Collaborator

Thanks for the change @iand675.

You are right that the bootstrap story is a complicated one. We pondered it quite a bit before landing on this one. The reasoning was that people who want to work with protobuf wouldn't consider it a chore to have protoc available. Keeping the generated files comes with a maintenance cost. I'd rather we limit the scope of your change to the json related features you added.

I'm also semi-blocked on ghc-source-gen ghc 9.6 support and the lack of CI support for the newer GHC versions in this project. I'd be happy if these were resolved.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not pass the required checks.

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.

2 participants