You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by ch...@apache.org on 2026/10/05 06:17:20 UTC
(fory-site) branch main updated (01bc369a98d -> b554bd77608)
This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git
from 01bc369a98d 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
new 66aa9c6d058 🔄 synced local 'docs/object-serialization/' with remote 'docs/object-serialization/'
new b554bd77608 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/compiler/generated-code/csharp.md | 3 ++-
docs/compiler/generated-code/index.md | 9 +++++++++
docs/compiler/generated-code/kotlin.md | 3 ++-
docs/compiler/generated-code/rust.md | 6 ++++--
docs/compiler/generated-code/scala.md | 3 ++-
docs/compiler/generated-code/swift.md | 8 +++++---
docs/object-serialization/csharp/schema-metadata.md | 6 +++---
docs/object-serialization/kotlin/static-generated-serializers.md | 3 ++-
docs/object-serialization/scala/basic-serialization.md | 6 +++---
docs/object-serialization/scala/schema-metadata.md | 4 ++--
docs/object-serialization/swift/schema-metadata.md | 5 +++--
11 files changed, 37 insertions(+), 19 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
(fory-site) 02/02: 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
Posted by ch...@apache.org.
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 b554bd77608bc30dc876fc83132cebc11dfadbb8
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Mon Oct 5 06:17:15 2026 +0000
🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
---
docs/compiler/generated-code/csharp.md | 3 ++-
docs/compiler/generated-code/index.md | 9 +++++++++
docs/compiler/generated-code/kotlin.md | 3 ++-
docs/compiler/generated-code/rust.md | 6 ++++--
docs/compiler/generated-code/scala.md | 3 ++-
docs/compiler/generated-code/swift.md | 8 +++++---
6 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/docs/compiler/generated-code/csharp.md b/docs/compiler/generated-code/csharp.md
index 431c8b08ce3..f0204327ce3 100644
--- a/docs/compiler/generated-code/csharp.md
+++ b/docs/compiler/generated-code/csharp.md
@@ -54,7 +54,8 @@ table. Schema-defined cases use non-negative `[ForyCase]` IDs. If a case needs
non-default schema encoding, the generated `[ForyCase]` carries `Type`. Known
case record names are PascalCase FDL case names; payload types are emitted as
qualified references when needed to avoid name conflicts. A typed union must
-have at least one non-`Unknown` case.
+have at least one schema-defined case. On a name collision, the generated carrier
+is named `Unknown_`; a second collision is an error. Schema case names are preserved.
```csharp
[ForyUnion]
diff --git a/docs/compiler/generated-code/index.md b/docs/compiler/generated-code/index.md
index a8a872d8729..2d38d808465 100644
--- a/docs/compiler/generated-code/index.md
+++ b/docs/compiler/generated-code/index.md
@@ -29,6 +29,15 @@ package or namespace, names such as `AddressbookForyModule` or
`ComplexPbForyModule` let multiple IDL files target the same package or
namespace without producing colliding `ForyModule` types.
+## Unknown Union Case Names
+
+C#, Kotlin, Scala, and Rust generate an `Unknown` case to preserve unknown union
+values; Swift uses `unknown`. Schema-defined case names keep their normal
+language-specific spelling. If the generated carrier name conflicts, the compiler
+uses `Unknown_` or Swift's `unknown_`. If that alternate name is also occupied,
+generation fails. The unknown-case annotation or attribute identifies the carrier;
+its name is not required to be `Unknown` or `unknown`.
+
## Reference Schemas
The examples below use two real schemas:
diff --git a/docs/compiler/generated-code/kotlin.md b/docs/compiler/generated-code/kotlin.md
index 34fa8f164f1..68cae8d8b32 100644
--- a/docs/compiler/generated-code/kotlin.md
+++ b/docs/compiler/generated-code/kotlin.md
@@ -93,7 +93,8 @@ sealed classes with `@ForyUnion`; the Fory-provided `Unknown(UnknownCase)`
carrier is marked with `@ForyUnknownCase`. The marker only selects the carrier
and does not add an entry to the schema case table. Schema-defined cases may use
case IDs `0..N` and hold a single `value` property. A typed union must have at
-least one non-`Unknown` case.
+least one schema-defined case. On a name collision, the generated carrier is named
+`Unknown_`; a second collision is an error. Schema case names are preserved.
```kotlin
package addressbook
diff --git a/docs/compiler/generated-code/rust.md b/docs/compiler/generated-code/rust.md
index f150a5c9854..b546a9bc2e8 100644
--- a/docs/compiler/generated-code/rust.md
+++ b/docs/compiler/generated-code/rust.md
@@ -36,8 +36,10 @@ Unions map to Rust enums with `#[fory(id = ...)]` schema case attributes.
`#[fory(unknown)] Unknown(::fory::UnknownCase)` marks the Fory-provided
forward-compatibility carrier. The marker only selects the carrier and does not
add an entry to the schema case table; schema cases still use the full `0..N`
-ID range. A generated typed union must have at least one non-`Unknown` case. The
-compiler marks the first declared non-`Unknown` case as `#[fory(default)]`.
+ID range. On a name collision, the generated carrier is named `Unknown_`; a second
+collision is an error. Schema case names are preserved. A generated typed union
+must have at least one schema-defined case. The compiler marks the first declared
+schema-defined case as `#[fory(default)]`.
When that case's payload implements Rust's standard `Default` trait, the
compiler also emits a standard `Default` implementation from that case:
diff --git a/docs/compiler/generated-code/scala.md b/docs/compiler/generated-code/scala.md
index aca455deaf8..98c2301667f 100644
--- a/docs/compiler/generated-code/scala.md
+++ b/docs/compiler/generated-code/scala.md
@@ -101,7 +101,8 @@ forward-compatibility carrier marked with `@ForyUnknownCase`. It is omitted
from the schema case table because the marker only selects the carrier and does
not add a schema entry. Schema-defined cases use non-negative `@ForyCase` IDs.
A typed union must have at least one
-non-`Unknown` case.
+schema-defined case. On a name collision, the generated carrier is named
+`Unknown_`; a second collision is an error. Schema case names are preserved.
```scala
package addressbook
diff --git a/docs/compiler/generated-code/swift.md b/docs/compiler/generated-code/swift.md
index 7b3598f7715..1be9040ae83 100644
--- a/docs/compiler/generated-code/swift.md
+++ b/docs/compiler/generated-code/swift.md
@@ -28,10 +28,12 @@ Swift output is one `.swift` file per schema, for example:
## Type Generation
The generator creates Swift models with split model macros and stable field/case IDs.
-A typed union must include `@ForyUnknownCase case unknown(UnknownCase)` and at
-least one non-`unknown` case; `unknown(UnknownCase)` is only the
+A typed union must include a case marked `@ForyUnknownCase` and at
+least one schema-defined case; `unknown(UnknownCase)` is the default name of the
Fory-provided forward-compatibility carrier. The marker only selects the carrier
-and does not add an entry to the schema case table.
+and does not add an entry to the schema case table. On a name collision, the
+generated carrier is named `unknown_`; a second collision is an error. Schema
+case names are preserved.
When package/namespace is non-empty, namespace shaping is controlled by `swift_namespace_style`:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
(fory-site) 01/02: 🔄 synced local 'docs/object-serialization/' with remote 'docs/object-serialization/'
Posted by ch...@apache.org.
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 66aa9c6d0580422b6672843f0242e5d0db623f4f
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Mon Oct 5 06:17:15 2026 +0000
🔄 synced local 'docs/object-serialization/' with remote 'docs/object-serialization/'
---
docs/object-serialization/csharp/schema-metadata.md | 6 +++---
docs/object-serialization/kotlin/static-generated-serializers.md | 3 ++-
docs/object-serialization/scala/basic-serialization.md | 6 +++---
docs/object-serialization/scala/schema-metadata.md | 4 ++--
docs/object-serialization/swift/schema-metadata.md | 5 +++--
5 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/docs/object-serialization/csharp/schema-metadata.md b/docs/object-serialization/csharp/schema-metadata.md
index c555671441b..fcec22f1a34 100644
--- a/docs/object-serialization/csharp/schema-metadata.md
+++ b/docs/object-serialization/csharp/schema-metadata.md
@@ -122,9 +122,9 @@ Generated union cases use `[ForyCase]` for both the stable case ID and optional
case payload schema type. Do not put `[ForyField]` on union case payload
members. Known case record names use PascalCase FDL case names; payload types
use qualified references when needed to avoid name conflicts. A typed union must
-declare at least one non-`Unknown` case; `Unknown(UnknownCase)` is only the
-Fory-owned forward-compatibility carrier. The marker only selects the carrier and
-does not add an entry to the schema case table.
+declare at least one schema-defined case and exactly one `[ForyUnknownCase]`
+case exposing `Value: UnknownCase`. The carrier name is unrestricted. The marker
+only selects the carrier and does not add an entry to the schema case table.
```csharp
using Apache.Fory;
diff --git a/docs/object-serialization/kotlin/static-generated-serializers.md b/docs/object-serialization/kotlin/static-generated-serializers.md
index fe42f884b1d..440f7e71c50 100644
--- a/docs/object-serialization/kotlin/static-generated-serializers.md
+++ b/docs/object-serialization/kotlin/static-generated-serializers.md
@@ -224,7 +224,8 @@ one constructor property named `value`. `Unknown(UnknownCase)` is marked with
`@ForyUnknownCase` as the Fory-owned forward-compatibility carrier. It is
omitted from the schema case table because the marker only selects the carrier
and does not add a schema entry. A typed union must declare at least one
-non-`Unknown` case:
+schema-defined case. Exactly one case must carry `@ForyUnknownCase`; its name is
+unrestricted:
```kotlin
package example
diff --git a/docs/object-serialization/scala/basic-serialization.md b/docs/object-serialization/scala/basic-serialization.md
index c1768d45e56..d4d38ab44fa 100644
--- a/docs/object-serialization/scala/basic-serialization.md
+++ b/docs/object-serialization/scala/basic-serialization.md
@@ -164,9 +164,9 @@ output mode cannot express a legal qualifier for a conflict, the IDL compiler
appends `Case` to the generated case name.
Schema-defined union cases use non-negative IDs, and a typed union must declare
-at least one non-`Unknown` case. The Scala unknown-case carrier is selected by
-`@ForyUnknownCase`, not by a schema case ID. Its payload stores the original case
-ID and the deserialized value. When a reader sees a newer case ID, it returns
+at least one schema-defined case. The Scala unknown-case carrier is selected by
+`@ForyUnknownCase`, independent of its name, and has no schema case ID. Its payload
+stores the original case ID and the deserialized value. When a reader sees a newer case ID, it returns
`Unknown(UnknownCase)` instead of failing solely because the case ID is not known
locally.
diff --git a/docs/object-serialization/scala/schema-metadata.md b/docs/object-serialization/scala/schema-metadata.md
index 151c8cdb616..d360a98acd0 100644
--- a/docs/object-serialization/scala/schema-metadata.md
+++ b/docs/object-serialization/scala/schema-metadata.md
@@ -108,8 +108,8 @@ enum SearchTarget derives ForySerializer {
```
Schema-defined union cases use non-negative IDs, and a typed union must declare
-at least one non-`Unknown` case. The unknown-case carrier is selected by
-`@ForyUnknownCase`, not by a schema case ID.
+at least one schema-defined case. The unknown-case carrier is selected by
+`@ForyUnknownCase`, independent of its name, and has no schema case ID.
When a generated Scala union case name matches the payload type simple name,
packaged output keeps the case name and qualifies the payload type. If a target
output mode cannot express a legal qualifier for a conflict, the IDL compiler
diff --git a/docs/object-serialization/swift/schema-metadata.md b/docs/object-serialization/swift/schema-metadata.md
index 2a216e4f7b6..59d22014312 100644
--- a/docs/object-serialization/swift/schema-metadata.md
+++ b/docs/object-serialization/swift/schema-metadata.md
@@ -200,8 +200,9 @@ External payloads select a serializer with `.with(...)`:
case user(ThirdParty.User)
```
-Every `@ForyUnion` must declare `@ForyUnknownCase case unknown(UnknownCase)` and
-at least one non-`unknown` case. The unknown case is only the Fory-owned
+Every `@ForyUnion` must declare exactly one `@ForyUnknownCase` case with one
+`UnknownCase` associated value and at least one schema-defined case. The marked
+case name is unrestricted. The unknown case is only the Fory-owned
forward-compatibility carrier and cannot be the default value source. It is
omitted from the schema case table because the marker only selects the carrier
and does not add a schema entry. Schema cases use non-negative IDs.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org