diff --git a/book/src/schema/index.md b/book/src/schema/index.md index de1f679..7ba35ed 100644 --- a/book/src/schema/index.md +++ b/book/src/schema/index.md @@ -33,8 +33,8 @@ Some of these are not natively supported in each language, turning into a common | f64 | f64 | float64 | Double | number | float | | string | String | string | String | string | str | | &string | &str | string | String | string | str | -| bytes | Vec\ | []byte | ByteArray | Uint8Array | bytes | -| &bytes | &\[u8] | []byte | ByteArray | Uint8Array | bytes | +| bytes | Vec\ | \[]byte | ByteArray | Uint8Array | bytes | +| &bytes | &\[u8] | \[]byte | ByteArray | Uint8Array | bytes | [big.Int]: https://pkg.go.dev/math/big#Int [BigInteger]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/math/BigInteger.html @@ -52,7 +52,7 @@ Containers for multiple values of a single type. | Language | Definition | | ---------- | ---------- | | Rust | Vec\ | -| Go | []T | +| Go | \[]T | | Kotlin | List\ | | TypeScript | T\[] | | Python | list\[T] | diff --git a/book/src/schema/structs.md b/book/src/schema/structs.md index e1be377..9d0d721 100644 --- a/book/src/schema/structs.md +++ b/book/src/schema/structs.md @@ -35,7 +35,7 @@ Here is a basic named schema with two fields `field1` and `field2`. The first on These samples describe how the schema would be defined in each language, when generating the code for it. -#### Rust {#banamedbasicsic-lang-rs} +#### Rust {#named-lang-rs} ```rust {{#include structs/named.rs}} @@ -65,10 +65,10 @@ An additional constructor is required, to ensure all fields are properly initial #### Python {#named-lang-py} -In Python the `typing.TypedDict` type is used to define the fields of a class. +In Python the `@dataclass` attribute is used to define the fields of a class. ```python -{{#include structs/named.py:4:}} +{{#include structs/named.py:5:}} ``` ## Unnamed @@ -114,7 +114,7 @@ A single field is defined as `type @id`, the name and [ID]. #### Python {#unnamed-lang-py} ```python -{{#include structs/unnamed.py}} +{{#include structs/unnamed.py:4:}} ``` ## Unit @@ -160,7 +160,7 @@ Instead, it's only the type that carries information. #### Python {#unit-lang-py} ```python -{{#include structs/unit.py}} +{{#include structs/unit.py:4:}} ``` ## Generics @@ -200,5 +200,5 @@ Instead, it's only the type that carries information. #### Python {#generics-lang-py} ```python -{{#include structs/generics.py:3:}} +{{#include structs/generics.py:5:}} ```