OSS Nokalva Home Page
>
Resources
>
ASN1.IO
> Proto2ASN
Proto Schema
syntax = "proto3"; package World.Schema; enum Fuel { solid = 0; liquid = 1; gas = 2; hybrid = 3; } message Rocket { string name = 1; string msg = 2; Fuel fuel = 3; oneof speed { int32 mph = 4; int32 kmph = 5; } repeated string payload = 6; }
Not all schema features match between GPB (proto3) and ASN.1. Try different options, modify both the proto and the ASN.1 schema for the best results. Use
asn1-playground
to experiment with the ASN.1 schema.
General
Add default values (when appropriate)
Generate DEFAULT values for primitive types.
Include tags
Generate context tags matching the input tags.
Make messages extensible
Generate extension markers ('...' in CHOICE, SEQUENCE), make fields OPTIONAL.
Advanced
Include encoding instructions (when appropriate)
ASN.1 encoding instructions may produce a better match for the original proto.
Generate SET instead of SEQUENCE
SET may work better for JSON serialization, where object assumes no order of the fields.
ASN.1 Schema
Copy to clipboard