This is an automated email from the ASF dual-hosted git repository. chaokunyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/fory-site.git
commit 3452a1e5b922d575c6a995fe77620c6cc2cc606b Author: chaokunyang <[email protected]> AuthorDate: Thu May 14 05:21:45 2026 +0000 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/' --- docs/compiler/schema-idl.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/compiler/schema-idl.md b/docs/compiler/schema-idl.md index a008f7740a..b7252ed6a8 100644 --- a/docs/compiler/schema-idl.md +++ b/docs/compiler/schema-idl.md @@ -877,15 +877,15 @@ message User { **Generated Code:** -| Language | Non-optional | Optional | -| ---------- | ------------------ | ----------------------------------------------- | -| Java | `String name` | `String email` with `@ForyField(nullable=true)` | -| Python | `name: str` | `name: Optional[str]` | -| Go | `Name string` | `Name *string` | -| Rust | `name: String` | `name: Option<String>` | -| C++ | `std::string name` | `std::optional<std::string> name` | -| JavaScript | `name: string` | `name?: string \| null` | -| Dart | `String name` | `String? email` | +| Language | Non-optional | Optional | +| ---------- | ------------------ | --------------------------------- | +| Java | `String name` | `@Nullable String email` | +| Python | `name: str` | `name: Optional[str]` | +| Go | `Name string` | `Name *string` | +| Rust | `name: String` | `name: Option<String>` | +| C++ | `std::string name` | `std::optional<std::string> name` | +| JavaScript | `name: string` | `name?: string \| null` | +| Dart | `String name` | `String? email` | **Default Values:** @@ -970,12 +970,12 @@ apply to elements. `repeated` is accepted as an alias for `list`. **List modifier mapping:** -| Fory IDL | Java | Python | Go | Rust | C++ | Dart | -| ----------------------- | ---------------------------------------------- | --------------------------------------- | ----------------------- | --------------------- | ----------------------------------------- | ------------------------------------------------------------- | -| `optional list<string>` | `List<String>` + `@ForyField(nullable = true)` | `Optional[List[str]]` | `[]string` + `nullable` | `Option<Vec<String>>` | `std::optional<std::vector<std::string>>` | `List<String>?` | -| `list<optional string>` | `List<String>` (nullable elements) | `List[Optional[str]]` | `[]*string` | `Vec<Option<String>>` | `std::vector<std::optional<std::string>>` | `List<String?>` | -| `ref list<User>` | `List<User>` + `@ForyField(ref = true)` | `List[User]` + `pyfory.field(ref=True)` | `[]User` + `ref` | `Arc<Vec<User>>` | `std::shared_ptr<std::vector<User>>` | `List<User>` + `@ForyField(ref: true)` | -| `list<ref User>` | `List<User>` | `List[User]` | `[]*User` + `ref=false` | `Vec<Arc<User>>` | `std::vector<std::shared_ptr<User>>` | `List<User>` + `@ListField(element: DeclaredType(ref: true))` | +| Fory IDL | Java | Python | Go | Rust | C++ | Dart | +| ----------------------- | --------------------------------------- | --------------------------------------- | ----------------------- | --------------------- | ----------------------------------------- | ------------------------------------------------------------- | +| `optional list<string>` | `@Nullable List<String>` | `Optional[List[str]]` | `[]string` + `nullable` | `Option<Vec<String>>` | `std::optional<std::vector<std::string>>` | `List<String>?` | +| `list<optional string>` | `List<String>` (nullable elements) | `List[Optional[str]]` | `[]*string` | `Vec<Option<String>>` | `std::vector<std::optional<std::string>>` | `List<String?>` | +| `ref list<User>` | `List<User>` + `@ForyField(ref = true)` | `List[User]` + `pyfory.field(ref=True)` | `[]User` + `ref` | `Arc<Vec<User>>` | `std::shared_ptr<std::vector<User>>` | `List<User>` + `@ForyField(ref: true)` | +| `list<ref User>` | `List<User>` | `List[User]` | `[]*User` + `ref=false` | `Vec<Arc<User>>` | `std::vector<std::shared_ptr<User>>` | `List<User>` + `@ListField(element: DeclaredType(ref: true))` | Use `ref(thread_safe=false)` in Fory IDL (or `[(fory).thread_safe_pointer = false]` in protobuf) to generate `Rc` instead of `Arc` in Rust. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
