Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Protobuf specification rework (#131)
Rework the protobuf specification. The goal is to allow for more control over what should be wrapped in messages and what should not be wrapped, avoiding implicit rules that prevent sound refactoring/evolutions of smithy specifications. In particular : 1. addition of a `alloy.proto#protoWrapped` trait that can be added on simple shapes + lists + maps + members targeting those. This is the only signal allowed for deciding whether something should be wrapped or not. 2. addition of a number of validation rules for smithy shapes that belong to a transitive closure of a `gRPC` or `protoEnabled shape`. These rules ported from the proto language, such as (but not limited to) : * proto oneof members cannot be repeated/map fields => smithy members of unions targeting map/list shapes MUST have `@protoWrapped` * proto maps cannot have messages => smithy map keys MUST NOT have `@protoWrapped` * when @protoIndex are present on enum/int enum members, one of the value MUST BE 0 * when @protoIndex is absent on intEnum members, one of its enum values must be 0 * etc etc 3. created an `alloy-protobuf` artifact with proto files containing messages that can be used by smithy-translate and other tools to facilitate the abidance to the rules described in the alloy protobuf specification This PR is to remain a draft until the semantics described in it are incorporated in smithy-translate and validated in some "smithy4s-protobuf" POC
- Loading branch information