Expand description
Rewrites of the buffa model output, whose JSON choices are fixed in the buf plugin:
- Field names.
JsonFieldNames::Protoserializes the snake_case proto names instead of lowerCamelCase (both are still read). An explicitjson_nameis kept. - 64-bit integers.
int64_modulepoints buffa’s string helpers at thejson_int64module, which writes numbers. - Free-form JSON.
json_value_modulemakesgoogle.protobuf.Value/Struct/ListValuefields write whole numbers as integers (1, not1.0). - Field options (
field_options): explicitjson_names and(olai.trestle.v1.emit_unpopulated).
The rewrites are idempotent and skip the files trestle writes itself.
Structs§
- Model
Rewrites - The rewrites to apply to the buffa model output.
- Package
Fields - The fields of one proto package with JSON options, keyed
Message.field.
Enums§
- Json
Field Names - How the JSON field names of one proto package are serialized.
Functions§
- field_
options - The fields of
metadatawith JSON options, by package, forModelRewrites::fields. - space_
items - Put blank lines between the items of a pretty-printed Rust file (prettyplease prints none;
rustfmt keeps them but never adds them): before an item that follows a
}or ausegroup at the same indentation, and after the file’s inner attributes. Idempotent.