Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf specification rework #131

Merged
merged 17 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ modules/website/static/api
*.hnir

.bsp

# smithy LSP
build/smithy
.smithy.lsp.log
4 changes: 4 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ object core extends BaseJavaModule {
}
}

object protobuf extends BaseJavaModule {
daddykotex marked this conversation as resolved.
Show resolved Hide resolved

}

val scalaVersionsMap =
Map("2.13" -> "2.13.7", "2.12" -> "2.12.17", "3" -> "3.3.0")
object openapi extends Cross[OpenapiModule](scalaVersionsMap.keys.toList)
Expand Down
2 changes: 2 additions & 0 deletions docs/protocols/gRPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The following traits should be taken into consideration by implementors of the p

- alloy.proto#protoIndex
- alloy.proto#protoNumType
- alloy.proto#protoWrapped
- alloy.proto#protoCompactUUID

Additionally, the following traits can be taken into consideration by other tooling to translate smithy specifications to proto specifications.

Expand Down
6 changes: 3 additions & 3 deletions docs/serialisation/json.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### JSON serialisation
## JSON serialisation

`alloy` defines a number of traits that can be taken into consideration by protocols to express additional constraints and encodings typically found in the industry.

#### Unions
### Unions

Unions in this protocol can be encoded in three different ways: tagged, discriminated, and untagged.

Expand All @@ -11,7 +11,7 @@ By default, the specification of the Smithy language hints that the `tagged-unio
However, `alloy#simpleRestJson` supports two additional encodings: `discriminated` and `untagged`, which users can opt-in via the `alloy#discriminated` and `alloy#untagged` trait, respectively. These are mostly offered as a way to retrofit existing APIs in Smithy.


##### Tagged union
#### Tagged union

This is the default behavior, and happens to visually match how Smithy unions are declared. In this encoding, the union is encoded as a JSON object with a single key-value pair, the key signalling which alternative has been encoded.

Expand Down
Loading
Loading