buffa-yaml: add Phase 1 YAML serialization crate#155
Open
rsd-darshan wants to merge 5 commits into
Open
Conversation
New published workspace member that routes buffa's existing protobuf-JSON serde impls through serde_norway, giving full protobuf-JSON-mapping semantics on a YAML carrier: camelCase/snake_case field names, quoted int64/uint64, base64 bytes, enum string names, and canonical WKT encodings. Public API: to_string, to_writer, from_str, from_slice, from_reader with an Error wrapper that exposes line/column Location for diagnostics. Carrier choice (serde_norway 0.9) is validated against buffa-test generated types and WKTs; zero changes required to buffa core.
Expand struct literals to multi-line format per rustfmt style, replace approximate 3.14 literal with 1.5 to satisfy clippy::approx_constant, and mark the crate-level doc example as `ignore` so rustdoc does not attempt to compile a placeholder struct.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
Hi @iainmcgin, just a gentle ping in case this got buried — happy to make any changes if needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #101 (Phase 1).
Summary
buffa-yamlthat routes buffa's existing protobuf-JSON serde impls throughserde_norwayas the YAML carrier, giving full protobuf-JSON-mapping semantics on YAML: camelCase/snake_case field names, quotedint64/uint64, base64 bytes, enum string names, and canonical WKT encodingsto_string,to_writer,from_str,from_slice,from_reader— each gated onMessage + Serialize/DeserializeOwned, mirroringserde_json/serde_norwayconventionsErrortype wrapsserde_norway::Errorand exposesLocation { line, column }for diagnostics without requiring callers to depend on the carrier directlybuffa-testgenerated types and WKTs; zero changes tobuffacore requiredTest plan
23 tests covering the full Phase 1 scope:
Empty,Timestamp,Duration,FieldMask,Value(null/bool/number/string),ListValue,Structint64/uint64serialized as quoted strings (precision check)doubleNaN and Infinity round-tripfrom_slice/to_writer/from_readermirrorfrom_str/to_string0x1F), null (~), Norway-problem string ("no")Error::location()exposes line/col without panicking