Skip to content

Commit 86d31f9

Browse files
committed
Add documentation for type decorator
1 parent 191298d commit 86d31f9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/src/usage/annotations.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,17 @@ This would generate the following Kotlin code:
103103
typealias Options = String
104104
```
105105

106+
This decorator can also be applied to fields. If you want a field to be serializedd
107+
as a different type in the foreign language, you can use the `(type = "...")` decorator:
106108

109+
```rust
110+
#[typeshare]
111+
struct MyStruct {
112+
#[typeshare(typescript(type = "Record<string, any>"))]
113+
#[typeshare(python(type = "dict"))]
114+
my_field: MyCustomType,
115+
}
116+
```
107117

108118
## The `#[serde]` Attribute
109119

0 commit comments

Comments
 (0)