Skip to content

v0.10.0

Latest

Choose a tag to compare

@stefanvanburen stefanvanburen released this 28 Apr 16:05
· 6 commits to main since this release
c195043

☢️ Breaking changes

Pass a Codec instead of proto_json=True to use JSON encoding

The proto_json bool has been replaced by a codec parameter. If you were using the default (proto_json=False), no change is needed — binary protobuf remains the default. If you were opting into JSON encoding:

Before:

async with GreeterClient("http://localhost", proto_json=True) as client:
    ...

After:

from connectrpc.codec import proto_json_codec

async with GreeterClient("http://localhost", codec=proto_json_codec()) as client:
    ...

The new codec parameter accepts any object implementing the Codec protocol, enabling custom encoding strategies — for example, a ProtoJSONCodec subclass with custom marshaling options.

What's Changed

  • Allow customization of server and client codecs by @anuraaga in #192
  • Allow generating only async or sync code by @anuraaga in #214
  • Surface non-Connect handler exceptions to user by @anuraaga in #219

Full Changelog: v0.9.0...v0.10.0