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

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

iand675
Copy link

@iand675 iand675 commented Dec 2, 2023

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
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.

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