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


The following commit(s) were added to refs/heads/main by this push:
     new 4fa6233c8c 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
4fa6233c8c is described below

commit 4fa6233c8ceeec303e8964e326af44bd32cda32c
Author: chaokunyang <[email protected]>
AuthorDate: Tue Jan 27 18:23:31 2026 +0000

    🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
---
 docs/compiler/fdl-syntax.md   |  7 +++++++
 docs/compiler/protobuf-idl.md |  2 +-
 docs/compiler/type-system.md  | 23 +++++++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/docs/compiler/fdl-syntax.md b/docs/compiler/fdl-syntax.md
index c8d5707f9a..2a3c1e1151 100644
--- a/docs/compiler/fdl-syntax.md
+++ b/docs/compiler/fdl-syntax.md
@@ -858,6 +858,7 @@ Modifiers before `repeated` apply to the field/collection. 
Modifiers after
 | `timestamp`     | Date and time with timezone               | Variable |
 | `duration`      | Duration                                  | Variable |
 | `decimal`       | Decimal value                             | Variable |
+| `any`           | Dynamic value (runtime type)              | Variable |
 
 See [Type System](type-system.md) for complete type mappings.
 
@@ -867,6 +868,11 @@ See [Type System](type-system.md) for complete type 
mappings.
 - Use `fixed_*` for fixed-width integer encoding.
 - Use `tagged_*` for tagged/hybrid encoding (64-bit only).
 
+**Any type notes:**
+
+- `any` always writes a null flag (same as `nullable`) because the value may 
be empty.
+- `ref` is not allowed on `any` fields. Wrap `any` in a message if you need 
reference tracking.
+
 ### Named Types
 
 Reference other messages or enums by name:
@@ -1241,6 +1247,7 @@ primitive_type := 'bool'
                | 'float16' | 'float32' | 'float64'
                | 'string' | 'bytes'
                | 'date' | 'timestamp' | 'duration' | 'decimal'
+               | 'any'
 named_type   := qualified_name
 qualified_name := IDENTIFIER ('.' IDENTIFIER)*   // e.g., Parent.Child
 map_type     := 'map' '<' field_type ',' field_type '>'
diff --git a/docs/compiler/protobuf-idl.md b/docs/compiler/protobuf-idl.md
index 0038ffcd4a..589d33c397 100644
--- a/docs/compiler/protobuf-idl.md
+++ b/docs/compiler/protobuf-idl.md
@@ -219,7 +219,7 @@ message TreeNode {
 | Map        | `map<K, V>`                                                     
                                       | `map<K, V>`                            
                                                         |
 | Nullable   | `optional T` (proto3)                                           
                                       | `optional T`                           
                                                         |
 | Oneof      | `oneof`                                                         
                                       | `union` (case id = field number)       
                                                         |
-| Any        | `google.protobuf.Any`                                           
                                       | Not supported                          
                                                         |
+| Any        | `google.protobuf.Any`                                           
                                       | `any`                                  
                                                         |
 | Extensions | `extend`                                                        
                                       | Not supported                          
                                                         |
 
 ### Wire Format
diff --git a/docs/compiler/type-system.md b/docs/compiler/type-system.md
index 8cdfbfbcf2..484c421c79 100644
--- a/docs/compiler/type-system.md
+++ b/docs/compiler/type-system.md
@@ -215,6 +215,29 @@ timestamp created_at = 1;
 | Rust     | `chrono::NaiveDateTime`          | Requires `chrono` crate |
 | C++      | `fory::serialization::Timestamp` |                         |
 
+### Any
+
+Dynamic value with runtime type information:
+
+```protobuf
+any payload = 1;
+```
+
+| Language | Type           | Notes                |
+| -------- | -------------- | -------------------- |
+| Java     | `Object`       | Runtime type written |
+| Python   | `Any`          | Runtime type written |
+| Go       | `any`          | Runtime type written |
+| Rust     | `Box<dyn Any>` | Runtime type written |
+| C++      | `std::any`     | Runtime type written |
+
+**Notes:**
+
+- `any` always writes a null flag (same as `nullable`) because values may be 
empty; codegen treats `any` as nullable even without `optional`.
+- Allowed runtime values are limited to `bool`, `string`, `enum`, `message`, 
and `union`. Other primitives (numeric, bytes, date/time) and list/map are not 
supported; wrap them in a message or use explicit fields instead.
+- `ref` is not allowed on `any` fields (including repeated/map values). Wrap 
`any` in a message if you need reference tracking.
+- The runtime type must be registered in the target language schema/IDL 
registration; unknown types fail to deserialize.
+
 ## Enum Types
 
 Enums define named integer constants:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to