| Crates.io | prost-canonical-serde |
| lib.rs | prost-canonical-serde |
| version | 0.1.2 |
| created_at | 2026-01-12 04:34:43.813848+00 |
| updated_at | 2026-01-15 15:00:32.132693+00 |
| description | Canonical JSON encoding for Prost-generated protobuf bindings |
| homepage | |
| repository | https://github.com/xyzzyz/prost-canonical-serde |
| max_upload_size | |
| id | 2036993 |
| size | 80,817 |
Canonical JSON encoding for Prost-generated protobuf bindings.
Protobuf has a canonical JSON mapping that differs from plain Serde JSON (for
example, int64/uint64 are encoded as strings and bytes use base64). Prost
provides efficient Rust bindings, but it does not implement canonical JSON on
its own. This project fills that gap by generating serde::Serialize and
serde::Deserialize implementations that follow the protobuf canonical JSON
spec, while keeping the normal serde_json API surface.
prost-types (Timestamp, Duration, Any, Struct,
etc.) are handled with their canonical JSON mappings.no_std friendly: the core crate works without std (alloc required).Use the derive macros for prost-generated types and keep using serde_json.
See the crate documentation on
docs.rs
for a full end-to-end example with a .proto, build.rs, and a runnable usage
snippet.
Apache-2.0. See LICENSE.