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/09/30 02:46:44 UTC
(fory-site) branch main updated: docs: publish Apache Fory 1.7.6 (#513)
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 2bfc128a5c8 docs: publish Apache Fory 1.7.6 (#513)
2bfc128a5c8 is described below
commit 2bfc128a5c82f3e072e31f484069f0a516c570f7
Author: Shawn Yang <sh...@gmail.com>
AuthorDate: Wed Sep 30 10:46:38 2026 +0800
docs: publish Apache Fory 1.7.6 (#513)
Update the website for Apache Fory 1.7.6 with English and Chinese
release posts, source downloads, and installation examples, including
the homepage language tabs.
Sync the latest 1.7 documentation snapshot with the voted release
documentation for required JSON constructor properties and `NON_DEFAULT`
inclusion, and update the corresponding Chinese guides. Keep the
existing 1.7 documentation series and older releases unchanged.
Validation: both locales pass `npm run build`; changed Markdown passes
Prettier and markdownlint; critical routes, release pages, and JSON
guide anchors were checked locally. The release snapshot was compared
with the voted `v1.7.6` source.
---
blog/2026-09-30-fory_1_7_6_released.md | 78 ++++++++++++++++++++++
.../2026-09-30-fory_1_7_6_released.md | 71 ++++++++++++++++++++
.../current/compiler/build-integration.md | 2 +-
.../current/compiler/cli.md | 2 +-
.../current/grpc/csharp.md | 4 +-
.../current/grpc/dart.md | 2 +-
.../current/grpc/rust.md | 2 +-
.../current/json/annotations.md | 23 ++++---
.../current/json/getting-started.md | 6 +-
.../current/json/kotlin.md | 18 +++--
.../current/json/object-mapping.md | 22 ++++++
.../current/json/scala.md | 19 ++++--
.../current/object-serialization/cpp/index.md | 8 +--
.../current/object-serialization/csharp/index.md | 2 +-
.../current/object-serialization/dart/index.md | 2 +-
.../current/object-serialization/java/index.md | 4 +-
.../current/object-serialization/kotlin/index.md | 4 +-
.../rust/basic-serialization.md | 2 +-
.../current/object-serialization/rust/index.md | 8 +--
.../current/object-serialization/scala/index.md | 2 +-
.../current/row-format/java.md | 4 +-
.../current/start/cpp.md | 2 +-
.../current/start/csharp.md | 2 +-
.../current/start/dart.md | 2 +-
.../current/start/go.md | 2 +-
.../current/start/java.md | 6 +-
.../current/start/javascript.md | 4 +-
.../current/start/kotlin.md | 4 +-
.../current/start/python.md | 2 +-
.../current/start/rust.md | 2 +-
.../current/start/scala.md | 2 +-
.../current/start/swift.md | 2 +-
.../version-1.7.0/compiler/build-integration.md | 2 +-
.../version-1.7.0/compiler/cli.md | 2 +-
.../version-1.7.0/grpc/csharp.md | 4 +-
.../version-1.7.0/grpc/dart.md | 2 +-
.../version-1.7.0/grpc/rust.md | 2 +-
.../version-1.7.0/json/annotations.md | 23 ++++---
.../version-1.7.0/json/getting-started.md | 6 +-
.../version-1.7.0/json/kotlin.md | 18 +++--
.../version-1.7.0/json/object-mapping.md | 22 ++++++
.../version-1.7.0/json/scala.md | 19 ++++--
.../object-serialization/cpp/index.md | 8 +--
.../object-serialization/csharp/index.md | 2 +-
.../object-serialization/dart/index.md | 2 +-
.../object-serialization/java/index.md | 4 +-
.../object-serialization/kotlin/index.md | 4 +-
.../rust/basic-serialization.md | 2 +-
.../object-serialization/rust/index.md | 8 +--
.../object-serialization/scala/index.md | 2 +-
.../version-1.7.0/row-format/java.md | 4 +-
.../version-1.7.0/start/cpp.md | 2 +-
.../version-1.7.0/start/csharp.md | 2 +-
.../version-1.7.0/start/dart.md | 2 +-
.../version-1.7.0/start/go.md | 2 +-
.../version-1.7.0/start/java.md | 6 +-
.../version-1.7.0/start/javascript.md | 4 +-
.../version-1.7.0/start/kotlin.md | 4 +-
.../version-1.7.0/start/python.md | 2 +-
.../version-1.7.0/start/rust.md | 2 +-
.../version-1.7.0/start/scala.md | 2 +-
.../version-1.7.0/start/swift.md | 2 +-
.../download/index.md | 12 ++--
src/components/home/HomepageLanding.tsx | 24 +++----
src/pages/download/index.md | 12 ++--
.../version-1.7.0/compiler/build-integration.md | 2 +-
versioned_docs/version-1.7.0/compiler/cli.md | 2 +-
versioned_docs/version-1.7.0/grpc/csharp.md | 4 +-
versioned_docs/version-1.7.0/grpc/dart.md | 2 +-
versioned_docs/version-1.7.0/grpc/rust.md | 2 +-
versioned_docs/version-1.7.0/json/annotations.md | 27 +++++---
.../version-1.7.0/json/getting-started.md | 6 +-
versioned_docs/version-1.7.0/json/kotlin.md | 26 ++++++--
.../version-1.7.0/json/object-mapping.md | 29 +++++++-
versioned_docs/version-1.7.0/json/scala.md | 26 +++++---
.../object-serialization/cpp/index.md | 8 +--
.../object-serialization/csharp/index.md | 2 +-
.../object-serialization/dart/index.md | 2 +-
.../object-serialization/java/index.md | 4 +-
.../object-serialization/kotlin/index.md | 4 +-
.../rust/basic-serialization.md | 2 +-
.../object-serialization/rust/index.md | 8 +--
.../object-serialization/scala/index.md | 2 +-
versioned_docs/version-1.7.0/row-format/java.md | 4 +-
versioned_docs/version-1.7.0/start/cpp.md | 2 +-
versioned_docs/version-1.7.0/start/csharp.md | 2 +-
versioned_docs/version-1.7.0/start/dart.md | 2 +-
versioned_docs/version-1.7.0/start/go.md | 2 +-
versioned_docs/version-1.7.0/start/java.md | 6 +-
versioned_docs/version-1.7.0/start/javascript.md | 4 +-
versioned_docs/version-1.7.0/start/kotlin.md | 4 +-
versioned_docs/version-1.7.0/start/python.md | 2 +-
versioned_docs/version-1.7.0/start/rust.md | 2 +-
versioned_docs/version-1.7.0/start/scala.md | 2 +-
versioned_docs/version-1.7.0/start/swift.md | 2 +-
95 files changed, 508 insertions(+), 213 deletions(-)
diff --git a/blog/2026-09-30-fory_1_7_6_released.md b/blog/2026-09-30-fory_1_7_6_released.md
new file mode 100644
index 00000000000..bb230b3635a
--- /dev/null
+++ b/blog/2026-09-30-fory_1_7_6_released.md
@@ -0,0 +1,78 @@
+---
+slug: fory_1_7_6_release
+title: Fory v1.7.6 Released
+description: "Fory 1.7.6 adds optional validation for missing JSON constructor properties and retains properties without defaults under NON_DEFAULT inclusion."
+authors: [chaokunyang]
+tags: [fory, java, json, kotlin, scala]
+---
+
+Apache Fory 1.7.6 is now available. This release improves JSON constructor-property handling
+for Java, Scala, and Kotlin. See [Getting Started](/docs/start/) for installation instructions.
+
+## Highlights
+
+- Opt in to rejecting missing required constructor properties with `failOnMissingRequiredProperties(true)`.
+- `NON_DEFAULT` inclusion retains properties without defaults, including required constructor properties.
+
+## Required Constructor Properties
+
+Enable `failOnMissingRequiredProperties(true)` when input must include ordinary constructor
+properties that have no declared default. For example, with a Java record:
+
+```java
+import org.apache.fory.json.ForyJson;
+
+record Request(int id) {}
+
+ForyJson json = ForyJson.builder()
+ .failOnMissingRequiredProperties(true)
+ .build();
+
+Request request = json.fromJson("{\"id\":42}", Request.class);
+json.fromJson("{}", Request.class); // Fails because id is missing.
+```
+
+The option is disabled by default. It supports Java records and property-based `JsonCreator`
+models, Scala case classes, and Kotlin constructor models, including nested objects. Declared
+language defaults and existing optional or container defaults remain available. Explicit null
+continues to follow the property's type and nullability rules.
+
+For Kotlin, a nullable constructor property without a default must still appear when this option
+is enabled, although its value may be null. The option does not change writing: if an inclusion
+policy omits a required property, a strict reader can reject that output.
+
+See [required constructor properties](/docs/json/object-mapping#required-constructor-properties)
+and the [Kotlin](/docs/json/kotlin/) and [Scala](/docs/json/scala/) guides for details.
+
+## Retaining Properties Without Defaults
+
+Field-level and class-level `NON_DEFAULT` inclusion now retain properties without defaults,
+including null, zero, false, and empty values. For example, a Scala case class can omit its
+declared default while retaining a required identifier:
+
+```scala
+import org.apache.fory.json.annotation.JsonInclude
+import org.apache.fory.json.annotation.JsonProperty.Include
+import org.apache.fory.json.scala.ForyJsonScala
+
+@JsonInclude(Include.NON_DEFAULT)
+case class Request(id: Int, retries: Int = 3)
+
+val json = ForyJsonScala.builder().build()
+json.toJson(Request(0)) // {"id":0}
+json.toJson(Request(0, retries = 1)) // {"id":0,"retries":1}
+```
+
+This also applies to Java constructor properties without defaults and Kotlin required
+constructor or `lateinit` properties. Supported default comparisons keep their existing
+requirements. In Kotlin, comparing a defaulted property still requires a valid reference object;
+a constructor with required parameters cannot supply one without those arguments. Global
+`NON_DEFAULT` remains unsupported.
+
+See [default omission](/docs/json/annotations#jsoninclude-and-default-omission) for supported
+models and configuration examples.
+
+The complete release notes are available on
+[GitHub](https://github.com/apache/fory/releases/tag/v1.7.6).
+
+**Full Changelog**: [v1.7.5...v1.7.6](https://github.com/apache/fory/compare/v1.7.5...v1.7.6)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2026-09-30-fory_1_7_6_released.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2026-09-30-fory_1_7_6_released.md
new file mode 100644
index 00000000000..07eb236694c
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2026-09-30-fory_1_7_6_released.md
@@ -0,0 +1,71 @@
+---
+slug: fory_1_7_6_release
+title: Fory v1.7.6 发布
+description: "Fory 1.7.6 新增可选的 JSON 构造函数属性缺失校验,并在 NON_DEFAULT 包含策略下保留没有默认值的属性。"
+authors: [chaokunyang]
+tags: [fory, java, json, kotlin, scala]
+---
+
+Apache Fory 1.7.6 已发布。本次发布改进了 Java、Scala 和 Kotlin 的 JSON 构造函数属性处理。
+安装方式请参阅[快速开始](/zh-CN/docs/start/)。
+
+## 主要更新
+
+- 通过 `failOnMissingRequiredProperties(true)` 显式启用必需构造函数属性的缺失校验。
+- `NON_DEFAULT` 包含策略保留没有默认值的属性,包括必需构造函数属性。
+
+## 必需的构造函数属性
+
+当输入必须包含未声明默认值的普通构造函数属性时,可以启用 `failOnMissingRequiredProperties(true)`。
+下面以 Java record 为例:
+
+```java
+import org.apache.fory.json.ForyJson;
+
+record Request(int id) {}
+
+ForyJson json = ForyJson.builder()
+ .failOnMissingRequiredProperties(true)
+ .build();
+
+Request request = json.fromJson("{\"id\":42}", Request.class);
+json.fromJson("{}", Request.class); // Fails because id is missing.
+```
+
+该选项默认关闭,适用于 Java record、基于属性的 `JsonCreator` 模型、Scala case class 和 Kotlin
+构造函数模型,包括嵌套对象。声明的语言默认值以及现有的 Optional 或容器默认值仍然可用。
+显式 null 继续遵循属性的类型和可空性规则。
+
+对于 Kotlin,启用此选项后,没有默认值的可空构造函数属性也必须出现在输入中,但其值可以是 null。
+此选项不改变写入:如果包含策略省略了必需属性,严格读取器可能拒绝这些输出。
+
+详细规则见[必需的构造函数属性](/zh-CN/docs/json/object-mapping#required-constructor-properties),
+以及 [Kotlin](/zh-CN/docs/json/kotlin/) 和 [Scala](/zh-CN/docs/json/scala/) 指南。
+
+## 保留没有默认值的属性
+
+字段级和类级 `NON_DEFAULT` 包含策略现在都会保留没有默认值的属性,包括 null、零、false 和空值。
+例如,Scala case class 可以省略声明的默认值,同时保留必需的标识符:
+
+```scala
+import org.apache.fory.json.annotation.JsonInclude
+import org.apache.fory.json.annotation.JsonProperty.Include
+import org.apache.fory.json.scala.ForyJsonScala
+
+@JsonInclude(Include.NON_DEFAULT)
+case class Request(id: Int, retries: Int = 3)
+
+val json = ForyJsonScala.builder().build()
+json.toJson(Request(0)) // {"id":0}
+json.toJson(Request(0, retries = 1)) // {"id":0,"retries":1}
+```
+
+此行为也适用于 Java 中没有默认值的构造函数属性,以及 Kotlin 的必需构造函数属性和 `lateinit` 属性。
+受支持的默认值比较仍遵循原有要求。对于 Kotlin,比较有默认值的属性仍需要有效的参考对象;
+构造函数含必需参数时,不能在没有这些参数的情况下提供参考对象。全局 `NON_DEFAULT` 仍不受支持。
+
+支持的模型和配置示例见[默认值省略](/zh-CN/docs/json/annotations#jsoninclude-and-default-omission)。
+
+完整发布说明见 [GitHub](https://github.com/apache/fory/releases/tag/v1.7.6)。
+
+**完整变更记录**:[v1.7.5...v1.7.6](https://github.com/apache/fory/compare/v1.7.5...v1.7.6)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md
index aae54f53ab6..2783e7ab30f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md
@@ -211,7 +211,7 @@ cc_library(
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md
index e6c3e6d5d10..9dc3def02ba 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md
@@ -659,5 +659,5 @@ fory = "x.y.z"
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md
index d4232243667..9a4a24a4706 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md
@@ -36,7 +36,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
</ItemGroup>
```
@@ -45,7 +45,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
</ItemGroup>
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md
index 5357875e156..dce964090b5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md
@@ -29,7 +29,7 @@ license: |
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
grpc: ^4.0.0
dev_dependencies:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md
index fef66910370..628db9b23ab 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md
@@ -29,7 +29,7 @@ license: |
```toml
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
bytes = "1"
tonic = { version = "0.14", features = ["transport"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md
index c2e36b3ba1f..fd19052e19f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md
@@ -132,7 +132,7 @@ public final class User {
`OptionalInt`、`OptionalLong` 和 `OptionalDouble`。
安装 Scala 模块后,还会省略 `None` 以及受支持的空严格求值 Scala 集合和 Map。
- `NON_DEFAULT`:显式授权在属性等于受支持的默认值时省略它。不同的值(包括 null 或空值)仍会保留。
- 不支持的默认值来源会在模型初始化时失败。见[默认值省略](#jsoninclude-and-default-omission)。
+ 无论采用字段级还是类级授权,没有默认值的属性都会保留。见[默认值省略](#jsoninclude-and-default-omission)。
```java
public final class Response {
@@ -193,13 +193,20 @@ public final class Options {
恢复一致的值,或通过 `ALWAYS` 排除该属性。`defaultPropertyInclusion(NON_DEFAULT)` 会立即抛出配置错误,
避免全局授权将此契约静默应用于无关模型。`NON_EMPTY` 不授予默认值求值权限。
-| 模型 | 支持的默认值来源 |
-| ----------------------------------------------------------------------------------- | ------------------------------------------------------ |
-| Scala 构造函数属性 | 每次写入时,用实际的前置参数调用声明的编译器默认值方法 |
-| Java 普通无参模型 | 使用读取时选定的无参构造函数创建一个参考对象 |
-| 选定构造函数的所有参数都有默认值的 Kotlin 模型 | 使用这些语言默认值创建一个参考对象 |
-| Kotlin 普通无参模型 | 使用该构造函数创建一个参考对象 |
-| Java 必需构造函数参数、含必需参数的 Kotlin 构造函数,或缺少默认值/依赖的 Scala 属性 | 对已授权属性报错 |
+字段级和类级 `NON_DEFAULT` 都会保留没有默认值的属性,包括必需构造函数参数和 Kotlin `lateinit` 属性。
+它们的 null、零、false 和空值都会写出;读取时的回退值不会让它们成为具有默认值的属性。
+如果 Java 模型的读取路径未选择无参构造方式,已授权属性也会保留。
+对于默认值不稳定或不受支持的属性,使用 `ALWAYS` 保留。Mixin 遵循相同规则。
+
+| 模型 | 支持的默认值来源 |
+| ------------------------------------------------- | ------------------------------------------------------ |
+| Scala 构造函数属性 | 每次写入时,用实际的前置参数调用声明的编译器默认值方法 |
+| Java 普通无参模型 | 使用读取时选定的无参构造函数创建一个参考对象 |
+| 选定构造函数的所有参数都有默认值的 Kotlin 模型 | 使用这些语言默认值创建一个参考对象 |
+| Kotlin 普通无参模型 | 使用该构造函数创建一个参考对象 |
+| 没有默认值的必需属性 | 在字段级和类级授权下均保留 |
+| Kotlin 有默认值的属性,但选定构造函数还含必需参数 | 拒绝:无法在不伪造必需参数的情况下构造参考对象 |
+| Scala 默认值方法所需的依赖不可用 | 拒绝 |
每份已初始化的模型元数据只构造一次参考对象,而非每次序列化都构造。声明类型与动态类型的模型使用位置
可能分别初始化。授权允许执行**整个构造函数**、其他字段初始化器及 Kotlin `init` 块。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md
index 83f68cc667b..fb10ce0f387 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md
@@ -41,7 +41,7 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-json</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
@@ -55,7 +55,7 @@ repositories {
mavenCentral()
}
-implementation("org.apache.fory:fory-json:1.7.5")
+implementation("org.apache.fory:fory-json:1.7.6")
```
### Kotlin
@@ -64,7 +64,7 @@ Kotlin/JVM 应用添加可选的 Kotlin JSON 运行时,并使用其统一 buil
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md
index 671eb4be2e6..7d07777f0c5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md
@@ -38,7 +38,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
@@ -50,7 +50,7 @@ plugins {
}
dependencies {
- ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.5")
+ ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.6")
}
```
@@ -141,6 +141,12 @@ data class Request(
- 缺少 `id` 使用 `0`。
- `{"id":1,"retries":null}` 会失败;null 不会要求 Kotlin 使用默认值。
+启用 `ForyJsonKotlin.builder().failOnMissingRequiredProperties(true).build()` 后,未声明默认值的普通
+构造函数属性必须出现在输入中,包括可空属性、数值属性和 Boolean 属性。已声明的编译器默认值仍然生效。
+例如,上述模型缺少 `id` 时会报错,而缺少 `label` 和 `retries` 时仍使用它们的默认值。
+在此模式下,可空性本身不代表属性可以缺失:没有默认值的可空属性必须出现,但其值可以是显式 null。
+此选项默认为 `false`,不改变写入、类体属性行为或现有非空约束。
+
普通类体 `var` 属性在成员缺失时保留初始化值,在成员存在时于构造后赋值。`lateinit` 属性是必需的。自动 creator 属性和延后赋值属性都必须能在读写两个方向重建。
类体 `val`、计算属性、委托属性、仅 getter 的属性和委托 `var` 必须被忽略,或由精确的自定义编解码器处理。输入中存在的延后赋值 setter 在构造后按固定属性顺序执行,随后运行验证器;输入成员顺序不能决定应用调用顺序。Kotlin 类实例始终通过正常构造创建,因此不会绕过主构造函数初始化和验证。
@@ -170,12 +176,16 @@ val text = json.toJson(Response(1, items = emptyList())) // {"id":1}
显式 null 与字段缺失不同,非空属性仍会拒绝显式 null。如果需要精确往返,应选择能保留所需值的包含策略。
`NON_DEFAULT` 需要通过属性上的 `@JsonProperty` 或类上的 `@JsonInclude` 显式授权。
-只有**选定构造函数的每个参数都有语言默认值**,或模型使用普通无参构造函数时才支持。
+只有**选定构造函数的每个参数都有语言默认值**,或模型使用普通无参构造函数时,才支持与参考对象比较。
Fory 为每份已初始化的模型元数据构造一个参考对象并获取已授权属性的值,执行完整构造函数、
所有初始化器和 `init` 块。此操作不会在每次写入时重复;未授权的模型不会构造参考对象。
动态类型和声明类型的模型使用位置可能分别初始化。
-包含必需参数的模型会被拒绝,即使另一个构造函数恰好没有参数。Fory 不会伪造参数、
+字段级和类级授权都会保留没有默认值的构造函数属性及 `lateinit` 属性,包括 null、零、false 和空值。
+如果某个有默认值的属性需要参考对象,而选定构造函数还含必需参数,则会拒绝该属性,即使另一个构造函数没有参数。
+例如,对 `data class Key(val id: Int)` 使用类级 `NON_DEFAULT` 时,`Key(0)` 写为 `{"id":0}`。
+对于 `data class Entry(val id: Int, val count: Int = 1)`,同样的类级策略无法在不伪造 `id` 的情况下比较 `count`;
+可为 `count` 指定 `ALWAYS` 覆盖策略以保留它。Fory 不会伪造参数、
借用第一个对象的参数、更改创建器选择、绕过构造函数或分析字节码。构造失败会报告模型和属性。
全局 `defaultPropertyInclusion(NON_DEFAULT)` 会被拒绝。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md
index 94475fbffa9..7e61f960a30 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md
@@ -89,6 +89,27 @@ Android 无法构造不具备可用无参构造函数的普通类。JDK 25 及
普通构造函数的副作用用作反序列化完成钩子:即使无参构造函数会运行,属性赋值也发生在其后;
而绕过构造函数的路径根本不会运行它。
+## 必需的构造函数属性 {#required-constructor-properties}
+
+启用 `failOnMissingRequiredProperties(true)`,可以拒绝缺少未声明默认值的普通构造函数或工厂属性的输入:
+
+```java
+ForyJson json = ForyJson.builder()
+ .failOnMissingRequiredProperties(true)
+ .build();
+```
+
+此选项默认为 `false`,适用于 record、基于属性的 `JsonCreator` 模型、Scala case class 和 Kotlin
+构造函数模型,包括嵌套对象。声明的语言默认值及现有的 Optional、集合、Map 和数组默认值仍可使用。
+未声明默认值的普通属性必须出现在输入中,不再自动填充零、false 或 null。此选项不会引入新的容器默认值:
+没有默认值的 Kotlin 非空集合仍为必需属性,而 Scala 集合保留现有的空集合默认值。
+
+显式 JSON null 视为已提供的属性值,继续遵循属性的类型和可空性规则。被忽略的属性、普通无参 Java Bean
+以及构造后赋值的属性保持原有行为。完整的自定义对象编解码器自行负责缺失字段规则。
+
+此选项不改变写入。如果包含策略省略了必需属性,生成的 JSON 可能被严格读取器拒绝。应在输出中保留该属性,
+或使用未启用此选项的读取器。
+
## Kotlin 对象映射 {#kotlin-object-mapping}
为 Kotlin/JVM 类安装 `fory-json-kotlin` 并使用 `ForyJsonKotlin.builder()`。Kotlin 普通类和 data class 使用选定的构造函数、精确属性类型、编译器默认值和声明的可空性,不使用 Java 绕过构造函数的回退路径。默认值仅在成员缺失时生效。显式 JSON null 仍是已提供的值,非空参数会拒绝它。
@@ -197,6 +218,7 @@ ForyJson json = ForyJson.builder().defaultPropertyInclusion(Include.NON_EMPTY).b
builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`,拒绝 `DEFAULT` 和 `NON_DEFAULT`。
省略默认值需要通过属性上的 `@JsonProperty(include = NON_DEFAULT)` 或类上的 `@JsonInclude(NON_DEFAULT)`
显式授权;支持的默认值来源、构造与求值影响以及错误行为见[默认值省略](annotations.md#jsoninclude-and-default-omission)。
+两种授权形式都会保留没有默认值的属性,包括其值为 null 或零时。
属性上的 `JsonProperty.include` 优先于类上的 `JsonInclude`,后者优先于 builder 默认值。空值定义与适用范围见
[属性包含策略](annotations.md#jsonproperty)。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md
index ad6311ce5b1..9bc86c5aeb3 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md
@@ -24,7 +24,7 @@ Fory JSON 通过可选的 `fory-json-scala` 制品支持 Scala 2.13 和 Scala 3
## 设置 {#setup}
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.6"
```
`ForyJsonScala.builder()` 安装 Scala 模块并返回标准 Fory JSON builder:
@@ -88,6 +88,11 @@ json.fromJson("""{"selected":null}""", classOf[Options]) // Options(None, None)
json.fromJson("{}", classOf[Profile]) // Profile(0, false, List(), null)
```
+使用 `ForyJsonScala.builder().failOnMissingRequiredProperties(true).build()`,可以拒绝缺少未声明默认值的
+普通构造函数属性的输入。例如,`case class Request(id: Int)` 此时拒绝 `{}`,而
+`case class Request(id: Int = 7)` 仍将它读取为 `Request(7)`。Option、集合、Map 和数组属性保留现有的
+缺失值默认规则。此选项默认关闭,不改变写入或显式 null 的处理。
+
显式构造函数默认值优先用于缺失的属性。显式 JSON `null` 对 `Option[A]` 解码为 `None`,
即使其构造函数默认值为 `Some(...)` 也是如此。
@@ -130,7 +135,7 @@ import org.apache.fory.json.scala.ForyJsonScala
@JsonInclude(Include.NON_DEFAULT)
case class Request(
- @JsonProperty(include = Include.ALWAYS) id: Int,
+ id: Int,
retries: Int = 3,
tags: List[String] = Nil
)
@@ -141,19 +146,19 @@ json.fromJson("""{"id":0}""", classOf[Request]) // Request(0, 3, Nil)
json.toJson(Request(0, retries = 0)) // {"id":0,"retries":0}
```
-`id` 没有声明默认值,因此需要显式排除,否则类级授权会失败。读取时隐含的零、空集合或 `None`
+`id` 没有声明默认值,因此类级授权会将它保留在输出中,包括其值为零时。读取时隐含的零、空集合或 `None`
不是声明的默认值。也可移除类注解,只在选定的默认值属性上添加
`@JsonProperty(include = Include.NON_DEFAULT)`。Mixin 支持两种形式;全局 `NON_DEFAULT` 会被拒绝。
默认值表达式在写入时执行,必须具有确定性且没有外部可见副作用。
对于 `case class Limits(low: Int)(val high: Int = low + 1)`,比较 `high` 时使用对象实际的 `low`。
-当 `low=5, high=2` 时会保留 high,因为默认值为 6。缺少默认值方法或写入 Schema 依赖时,
-模型初始化会失败。JVM 方法返回 `void` 的 `Unit` 默认值不能用作比较来源;
-授权整个类时,应通过 `ALWAYS` 保留这些属性。
+当 `low=5, high=2` 时会保留 high,因为默认值为 6。选定默认值方法所需的依赖不可用时,模型初始化会失败。
+没有受支持的编译器默认值方法的属性,在类级和字段级 `NON_DEFAULT` 下都会保留。
+这也包括 JVM 方法返回 `void` 的 `Unit` 默认值,它们不是受支持的比较来源。
授权表示调用方确认缺失输入可以恢复相同上下文;Fory 不证明这一点或表达式的纯度。
对于依赖时间、随机数或状态的默认值,应使用 `ALWAYS`。数组按内容比较,浮点数区分正零与负零。
-Scala 类体初始化器不会被推断为构造函数默认值。不同于默认值的值(包括 null 和空集合)仍会写出。
+Scala 类体初始化器不会被推断为构造函数默认值,这些属性仍会写出。不同于默认值的值(包括 null 和空集合)仍会写出。
读取行为独立,并创建新的可变默认值。类级授权也覆盖未来新增的字段,见
[默认值省略](annotations.md#jsoninclude-and-default-omission)。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md
index a8d57c2646c..027a2eaf121 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md
@@ -60,7 +60,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
@@ -90,11 +90,11 @@ module(
bazel_dep(name = "rules_cc", version = "0.1.1")
-bazel_dep(name = "fory", version = "1.7.5")
+bazel_dep(name = "fory", version = "1.7.6")
git_override(
module_name = "fory",
remote = "https://github.com/apache/fory.git",
- commit = "v1.7.5", # Or use a specific commit hash for reproducibility
+ commit = "v1.7.6", # Or use a specific commit hash for reproducibility
)
```
@@ -125,7 +125,7 @@ bazel run //:my_app
本地开发时,可以改用 `local_path_override`:
```bazel
-bazel_dep(name = "fory", version = "1.7.5")
+bazel_dep(name = "fory", version = "1.7.6")
local_path_override(
module_name = "fory",
path = "/path/to/fory",
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md
index adee666bc03..94cbfa1d5c3 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md
@@ -44,7 +44,7 @@ Apache Fory™ C# 是面向 .NET 的高性能跨语言序列化库。它支持
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
</ItemGroup>
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md
index b39d5ae085e..5666763a43f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md
@@ -44,7 +44,7 @@ Apache Fory™ Dart 可以将 Dart 对象序列化为字节并反序列化,也
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md
index 91f2624954d..368686e637a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md
@@ -51,7 +51,7 @@ Fory core 支持 Java 8 及更高版本。Java Record 序列化需要 Java 17
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
@@ -59,7 +59,7 @@ Fory core 支持 Java 8 及更高版本。Java Record 序列化需要 Java 17
```kotlin
// Binary object serialization
-implementation("org.apache.fory:fory-core:1.7.5")
+implementation("org.apache.fory:fory-core:1.7.6")
```
#### JDK 25 及更高版本
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md
index 6350606bf08..aa2a007acce 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md
@@ -53,14 +53,14 @@ Fory Kotlin 继承了 Fory Java 的全部功能,并增加了 Kotlin 特有优
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-kotlin</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
### Gradle
```kotlin
-implementation("org.apache.fory:fory-kotlin:1.7.5")
+implementation("org.apache.fory:fory-kotlin:1.7.6")
```
### JDK25+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md
index 5d07b9e4334..78484d7bd94 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md
@@ -145,7 +145,7 @@ Rust 启用 `chrono::NaiveDate`、`chrono::NaiveDateTime` 和 `chrono::Duration`
```toml
[dependencies]
-fory = { version = "1.7.5", features = ["chrono"] }
+fory = { version = "1.7.6", features = ["chrono"] }
```
### 自定义类型
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md
index e8d991471fb..f567af4ffae 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md
@@ -36,9 +36,9 @@ Rust 实现通过自动内存管理和编译期类型安全提供灵活的高性
| Crate | 说明 | 版本 |
| --------------------------------------------------------------------------- | ---------------------------------- | --------------------------------------------- |
-| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | 面向用户的 API、运行时类型和派生宏 | [1.7.5](https://crates.io/crates/fory) |
-| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | 用于高级集成的底层运行时 crate | [1.7.5](https://crates.io/crates/fory-core) |
-| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | 供直接使用运行时的底层过程宏 crate | [1.7.5](https://crates.io/crates/fory-derive) |
+| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | 面向用户的 API、运行时类型和派生宏 | [1.7.6](https://crates.io/crates/fory) |
+| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | 用于高级集成的底层运行时 crate | [1.7.6](https://crates.io/crates/fory-core) |
+| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | 供直接使用运行时的底层过程宏 crate | [1.7.6](https://crates.io/crates/fory-derive) |
大多数应用程序只需依赖 `fory`。它重新导出生成代码所需的派生宏和公共运行时类型。只有明确要基于底层运行时 crate 构建时,才直接使用 `fory-core` 或 `fory-derive`。
@@ -48,7 +48,7 @@ Rust 实现通过自动内存管理和编译期类型安全提供灵活的高性
```toml
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
```
### 基本示例
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md
index f2a783338bf..9e09acdb161 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md
@@ -49,7 +49,7 @@ Fory Scala 继承了 Fory Java 的全部功能,并增加了 Scala 特有优化
使用 sbt 添加依赖:
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"
```
### JDK25+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md
index 5371274add8..7676d7ac787 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md
@@ -41,14 +41,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-format</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-format:1.7.5")
+implementation("org.apache.fory:fory-format:1.7.6")
```
## 基本用法
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md
index 5c6fbfe3d8d..58e2bccffbf 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md
@@ -42,7 +42,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md
index 1c161ece6df..48c97c3ee51 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md
@@ -34,7 +34,7 @@ dotnet --version
```bash
dotnet new console -n ForyExample
cd ForyExample
-dotnet add package Apache.Fory --version 1.7.5
+dotnet add package Apache.Fory --version 1.7.6
```
将 `Program.cs` 替换为:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md
index eb309e76416..ef5ccc8e1ec 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md
@@ -34,7 +34,7 @@ dart pub --help
```yaml
dependencies:
- fory: 1.7.5
+ fory: 1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md
index 634a69f71d7..80973c120b2 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md
@@ -36,7 +36,7 @@ go env GOPROXY
mkdir fory-example
cd fory-example
go mod init example.com/fory-example
-go get github.com/apache/fory/go/fory@v1.7.5
+go get github.com/apache/fory/go/fory@v1.7.6
```
如果 Go proxy 尚未收录新的 submodule tag,请稍后重试,或者暂时使用 `GOPROXY=direct`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md
index e3d00f161b2..73186eb1850 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md
@@ -39,14 +39,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-core:1.7.5")
+implementation("org.apache.fory:fory-core:1.7.6")
```
运行下面完整的 xlang 往返示例:
@@ -85,7 +85,7 @@ public final class ForyExample {
Fory JSON 将 Java 对象映射为标准 JSON 文本和 UTF-8 字节。如果应用只需要 JSON,请添加 `fory-json`,无需添加 `fory-core`:
```kotlin
-implementation("org.apache.fory:fory-json:1.7.5")
+implementation("org.apache.fory:fory-json:1.7.6")
```
在 `ForyExample.java` 中添加 import:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md
index 71b22b08f8c..d9aa1b2db43 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md
@@ -33,7 +33,7 @@ npm --version
安装 core 软件包:
```bash
-npm install @apache-fory/core@1.7.5
+npm install @apache-fory/core@1.7.6
```
定义 Schema 并运行 xlang 往返示例:
@@ -65,7 +65,7 @@ JavaScript 使用 xlang 模式。接下来可阅读 [JavaScript/TypeScript 对
若要使用可选的 Node.js 字符串快速路径,请安装版本匹配的软件包:
```bash
-npm install @apache-fory/core@1.7.5 @apache-fory/hps@1.7.5
+npm install @apache-fory/core@1.7.6 @apache-fory/hps@1.7.6
```
## 其他能力
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md
index 9c54487c9eb..929f3113a74 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md
@@ -42,7 +42,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-kotlin:1.7.6")
}
```
@@ -81,7 +81,7 @@ Fory JSON 是独立于二进制对象序列化的文本格式。与普通 JSON A
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md
index 547a4a8a8f8..5e09627ead0 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md
@@ -33,7 +33,7 @@ python -m pip --version
安装已发布的软件包:
```bash
-python -m pip install pyfory==1.7.5
+python -m pip install pyfory==1.7.6
```
运行 xlang 往返示例:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md
index 411ff063265..721f85fcd9f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md
@@ -34,7 +34,7 @@ cargo --version
```toml title="Cargo.toml"
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
```
```rust
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md
index 4ecec3308ff..bb81113847d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md
@@ -35,7 +35,7 @@ sbt --version
```sbt
ThisBuild / scalaVersion := "3.3.1"
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"
```
创建 `src/main/scala/ScalaExample.scala`:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md
index c6ab477f053..fcff6aa3a6b 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md
@@ -39,7 +39,7 @@ swift package init --type executable --name ForyExample
```swift title="Package.swift"
dependencies: [
- .package(url: "https://github.com/apache/fory.git", exact: "1.7.5")
+ .package(url: "https://github.com/apache/fory.git", exact: "1.7.6")
],
targets: [
.executableTarget(
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md
index aae54f53ab6..2783e7ab30f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md
@@ -211,7 +211,7 @@ cc_library(
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md
index e6c3e6d5d10..9dc3def02ba 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md
@@ -659,5 +659,5 @@ fory = "x.y.z"
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md
index d4232243667..9a4a24a4706 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md
@@ -36,7 +36,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
</ItemGroup>
```
@@ -45,7 +45,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
</ItemGroup>
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md
index 5357875e156..dce964090b5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md
@@ -29,7 +29,7 @@ license: |
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
grpc: ^4.0.0
dev_dependencies:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md
index fef66910370..628db9b23ab 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md
@@ -29,7 +29,7 @@ license: |
```toml
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
bytes = "1"
tonic = { version = "0.14", features = ["transport"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md
index c2e36b3ba1f..fd19052e19f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md
@@ -132,7 +132,7 @@ public final class User {
`OptionalInt`、`OptionalLong` 和 `OptionalDouble`。
安装 Scala 模块后,还会省略 `None` 以及受支持的空严格求值 Scala 集合和 Map。
- `NON_DEFAULT`:显式授权在属性等于受支持的默认值时省略它。不同的值(包括 null 或空值)仍会保留。
- 不支持的默认值来源会在模型初始化时失败。见[默认值省略](#jsoninclude-and-default-omission)。
+ 无论采用字段级还是类级授权,没有默认值的属性都会保留。见[默认值省略](#jsoninclude-and-default-omission)。
```java
public final class Response {
@@ -193,13 +193,20 @@ public final class Options {
恢复一致的值,或通过 `ALWAYS` 排除该属性。`defaultPropertyInclusion(NON_DEFAULT)` 会立即抛出配置错误,
避免全局授权将此契约静默应用于无关模型。`NON_EMPTY` 不授予默认值求值权限。
-| 模型 | 支持的默认值来源 |
-| ----------------------------------------------------------------------------------- | ------------------------------------------------------ |
-| Scala 构造函数属性 | 每次写入时,用实际的前置参数调用声明的编译器默认值方法 |
-| Java 普通无参模型 | 使用读取时选定的无参构造函数创建一个参考对象 |
-| 选定构造函数的所有参数都有默认值的 Kotlin 模型 | 使用这些语言默认值创建一个参考对象 |
-| Kotlin 普通无参模型 | 使用该构造函数创建一个参考对象 |
-| Java 必需构造函数参数、含必需参数的 Kotlin 构造函数,或缺少默认值/依赖的 Scala 属性 | 对已授权属性报错 |
+字段级和类级 `NON_DEFAULT` 都会保留没有默认值的属性,包括必需构造函数参数和 Kotlin `lateinit` 属性。
+它们的 null、零、false 和空值都会写出;读取时的回退值不会让它们成为具有默认值的属性。
+如果 Java 模型的读取路径未选择无参构造方式,已授权属性也会保留。
+对于默认值不稳定或不受支持的属性,使用 `ALWAYS` 保留。Mixin 遵循相同规则。
+
+| 模型 | 支持的默认值来源 |
+| ------------------------------------------------- | ------------------------------------------------------ |
+| Scala 构造函数属性 | 每次写入时,用实际的前置参数调用声明的编译器默认值方法 |
+| Java 普通无参模型 | 使用读取时选定的无参构造函数创建一个参考对象 |
+| 选定构造函数的所有参数都有默认值的 Kotlin 模型 | 使用这些语言默认值创建一个参考对象 |
+| Kotlin 普通无参模型 | 使用该构造函数创建一个参考对象 |
+| 没有默认值的必需属性 | 在字段级和类级授权下均保留 |
+| Kotlin 有默认值的属性,但选定构造函数还含必需参数 | 拒绝:无法在不伪造必需参数的情况下构造参考对象 |
+| Scala 默认值方法所需的依赖不可用 | 拒绝 |
每份已初始化的模型元数据只构造一次参考对象,而非每次序列化都构造。声明类型与动态类型的模型使用位置
可能分别初始化。授权允许执行**整个构造函数**、其他字段初始化器及 Kotlin `init` 块。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md
index 83f68cc667b..fb10ce0f387 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md
@@ -41,7 +41,7 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-json</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
@@ -55,7 +55,7 @@ repositories {
mavenCentral()
}
-implementation("org.apache.fory:fory-json:1.7.5")
+implementation("org.apache.fory:fory-json:1.7.6")
```
### Kotlin
@@ -64,7 +64,7 @@ Kotlin/JVM 应用添加可选的 Kotlin JSON 运行时,并使用其统一 buil
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md
index 671eb4be2e6..7d07777f0c5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md
@@ -38,7 +38,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
@@ -50,7 +50,7 @@ plugins {
}
dependencies {
- ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.5")
+ ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.6")
}
```
@@ -141,6 +141,12 @@ data class Request(
- 缺少 `id` 使用 `0`。
- `{"id":1,"retries":null}` 会失败;null 不会要求 Kotlin 使用默认值。
+启用 `ForyJsonKotlin.builder().failOnMissingRequiredProperties(true).build()` 后,未声明默认值的普通
+构造函数属性必须出现在输入中,包括可空属性、数值属性和 Boolean 属性。已声明的编译器默认值仍然生效。
+例如,上述模型缺少 `id` 时会报错,而缺少 `label` 和 `retries` 时仍使用它们的默认值。
+在此模式下,可空性本身不代表属性可以缺失:没有默认值的可空属性必须出现,但其值可以是显式 null。
+此选项默认为 `false`,不改变写入、类体属性行为或现有非空约束。
+
普通类体 `var` 属性在成员缺失时保留初始化值,在成员存在时于构造后赋值。`lateinit` 属性是必需的。自动 creator 属性和延后赋值属性都必须能在读写两个方向重建。
类体 `val`、计算属性、委托属性、仅 getter 的属性和委托 `var` 必须被忽略,或由精确的自定义编解码器处理。输入中存在的延后赋值 setter 在构造后按固定属性顺序执行,随后运行验证器;输入成员顺序不能决定应用调用顺序。Kotlin 类实例始终通过正常构造创建,因此不会绕过主构造函数初始化和验证。
@@ -170,12 +176,16 @@ val text = json.toJson(Response(1, items = emptyList())) // {"id":1}
显式 null 与字段缺失不同,非空属性仍会拒绝显式 null。如果需要精确往返,应选择能保留所需值的包含策略。
`NON_DEFAULT` 需要通过属性上的 `@JsonProperty` 或类上的 `@JsonInclude` 显式授权。
-只有**选定构造函数的每个参数都有语言默认值**,或模型使用普通无参构造函数时才支持。
+只有**选定构造函数的每个参数都有语言默认值**,或模型使用普通无参构造函数时,才支持与参考对象比较。
Fory 为每份已初始化的模型元数据构造一个参考对象并获取已授权属性的值,执行完整构造函数、
所有初始化器和 `init` 块。此操作不会在每次写入时重复;未授权的模型不会构造参考对象。
动态类型和声明类型的模型使用位置可能分别初始化。
-包含必需参数的模型会被拒绝,即使另一个构造函数恰好没有参数。Fory 不会伪造参数、
+字段级和类级授权都会保留没有默认值的构造函数属性及 `lateinit` 属性,包括 null、零、false 和空值。
+如果某个有默认值的属性需要参考对象,而选定构造函数还含必需参数,则会拒绝该属性,即使另一个构造函数没有参数。
+例如,对 `data class Key(val id: Int)` 使用类级 `NON_DEFAULT` 时,`Key(0)` 写为 `{"id":0}`。
+对于 `data class Entry(val id: Int, val count: Int = 1)`,同样的类级策略无法在不伪造 `id` 的情况下比较 `count`;
+可为 `count` 指定 `ALWAYS` 覆盖策略以保留它。Fory 不会伪造参数、
借用第一个对象的参数、更改创建器选择、绕过构造函数或分析字节码。构造失败会报告模型和属性。
全局 `defaultPropertyInclusion(NON_DEFAULT)` 会被拒绝。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md
index 94475fbffa9..7e61f960a30 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md
@@ -89,6 +89,27 @@ Android 无法构造不具备可用无参构造函数的普通类。JDK 25 及
普通构造函数的副作用用作反序列化完成钩子:即使无参构造函数会运行,属性赋值也发生在其后;
而绕过构造函数的路径根本不会运行它。
+## 必需的构造函数属性 {#required-constructor-properties}
+
+启用 `failOnMissingRequiredProperties(true)`,可以拒绝缺少未声明默认值的普通构造函数或工厂属性的输入:
+
+```java
+ForyJson json = ForyJson.builder()
+ .failOnMissingRequiredProperties(true)
+ .build();
+```
+
+此选项默认为 `false`,适用于 record、基于属性的 `JsonCreator` 模型、Scala case class 和 Kotlin
+构造函数模型,包括嵌套对象。声明的语言默认值及现有的 Optional、集合、Map 和数组默认值仍可使用。
+未声明默认值的普通属性必须出现在输入中,不再自动填充零、false 或 null。此选项不会引入新的容器默认值:
+没有默认值的 Kotlin 非空集合仍为必需属性,而 Scala 集合保留现有的空集合默认值。
+
+显式 JSON null 视为已提供的属性值,继续遵循属性的类型和可空性规则。被忽略的属性、普通无参 Java Bean
+以及构造后赋值的属性保持原有行为。完整的自定义对象编解码器自行负责缺失字段规则。
+
+此选项不改变写入。如果包含策略省略了必需属性,生成的 JSON 可能被严格读取器拒绝。应在输出中保留该属性,
+或使用未启用此选项的读取器。
+
## Kotlin 对象映射 {#kotlin-object-mapping}
为 Kotlin/JVM 类安装 `fory-json-kotlin` 并使用 `ForyJsonKotlin.builder()`。Kotlin 普通类和 data class 使用选定的构造函数、精确属性类型、编译器默认值和声明的可空性,不使用 Java 绕过构造函数的回退路径。默认值仅在成员缺失时生效。显式 JSON null 仍是已提供的值,非空参数会拒绝它。
@@ -197,6 +218,7 @@ ForyJson json = ForyJson.builder().defaultPropertyInclusion(Include.NON_EMPTY).b
builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`,拒绝 `DEFAULT` 和 `NON_DEFAULT`。
省略默认值需要通过属性上的 `@JsonProperty(include = NON_DEFAULT)` 或类上的 `@JsonInclude(NON_DEFAULT)`
显式授权;支持的默认值来源、构造与求值影响以及错误行为见[默认值省略](annotations.md#jsoninclude-and-default-omission)。
+两种授权形式都会保留没有默认值的属性,包括其值为 null 或零时。
属性上的 `JsonProperty.include` 优先于类上的 `JsonInclude`,后者优先于 builder 默认值。空值定义与适用范围见
[属性包含策略](annotations.md#jsonproperty)。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md
index ad6311ce5b1..9bc86c5aeb3 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md
@@ -24,7 +24,7 @@ Fory JSON 通过可选的 `fory-json-scala` 制品支持 Scala 2.13 和 Scala 3
## 设置 {#setup}
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.6"
```
`ForyJsonScala.builder()` 安装 Scala 模块并返回标准 Fory JSON builder:
@@ -88,6 +88,11 @@ json.fromJson("""{"selected":null}""", classOf[Options]) // Options(None, None)
json.fromJson("{}", classOf[Profile]) // Profile(0, false, List(), null)
```
+使用 `ForyJsonScala.builder().failOnMissingRequiredProperties(true).build()`,可以拒绝缺少未声明默认值的
+普通构造函数属性的输入。例如,`case class Request(id: Int)` 此时拒绝 `{}`,而
+`case class Request(id: Int = 7)` 仍将它读取为 `Request(7)`。Option、集合、Map 和数组属性保留现有的
+缺失值默认规则。此选项默认关闭,不改变写入或显式 null 的处理。
+
显式构造函数默认值优先用于缺失的属性。显式 JSON `null` 对 `Option[A]` 解码为 `None`,
即使其构造函数默认值为 `Some(...)` 也是如此。
@@ -130,7 +135,7 @@ import org.apache.fory.json.scala.ForyJsonScala
@JsonInclude(Include.NON_DEFAULT)
case class Request(
- @JsonProperty(include = Include.ALWAYS) id: Int,
+ id: Int,
retries: Int = 3,
tags: List[String] = Nil
)
@@ -141,19 +146,19 @@ json.fromJson("""{"id":0}""", classOf[Request]) // Request(0, 3, Nil)
json.toJson(Request(0, retries = 0)) // {"id":0,"retries":0}
```
-`id` 没有声明默认值,因此需要显式排除,否则类级授权会失败。读取时隐含的零、空集合或 `None`
+`id` 没有声明默认值,因此类级授权会将它保留在输出中,包括其值为零时。读取时隐含的零、空集合或 `None`
不是声明的默认值。也可移除类注解,只在选定的默认值属性上添加
`@JsonProperty(include = Include.NON_DEFAULT)`。Mixin 支持两种形式;全局 `NON_DEFAULT` 会被拒绝。
默认值表达式在写入时执行,必须具有确定性且没有外部可见副作用。
对于 `case class Limits(low: Int)(val high: Int = low + 1)`,比较 `high` 时使用对象实际的 `low`。
-当 `low=5, high=2` 时会保留 high,因为默认值为 6。缺少默认值方法或写入 Schema 依赖时,
-模型初始化会失败。JVM 方法返回 `void` 的 `Unit` 默认值不能用作比较来源;
-授权整个类时,应通过 `ALWAYS` 保留这些属性。
+当 `low=5, high=2` 时会保留 high,因为默认值为 6。选定默认值方法所需的依赖不可用时,模型初始化会失败。
+没有受支持的编译器默认值方法的属性,在类级和字段级 `NON_DEFAULT` 下都会保留。
+这也包括 JVM 方法返回 `void` 的 `Unit` 默认值,它们不是受支持的比较来源。
授权表示调用方确认缺失输入可以恢复相同上下文;Fory 不证明这一点或表达式的纯度。
对于依赖时间、随机数或状态的默认值,应使用 `ALWAYS`。数组按内容比较,浮点数区分正零与负零。
-Scala 类体初始化器不会被推断为构造函数默认值。不同于默认值的值(包括 null 和空集合)仍会写出。
+Scala 类体初始化器不会被推断为构造函数默认值,这些属性仍会写出。不同于默认值的值(包括 null 和空集合)仍会写出。
读取行为独立,并创建新的可变默认值。类级授权也覆盖未来新增的字段,见
[默认值省略](annotations.md#jsoninclude-and-default-omission)。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md
index a8d57c2646c..027a2eaf121 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md
@@ -60,7 +60,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
@@ -90,11 +90,11 @@ module(
bazel_dep(name = "rules_cc", version = "0.1.1")
-bazel_dep(name = "fory", version = "1.7.5")
+bazel_dep(name = "fory", version = "1.7.6")
git_override(
module_name = "fory",
remote = "https://github.com/apache/fory.git",
- commit = "v1.7.5", # Or use a specific commit hash for reproducibility
+ commit = "v1.7.6", # Or use a specific commit hash for reproducibility
)
```
@@ -125,7 +125,7 @@ bazel run //:my_app
本地开发时,可以改用 `local_path_override`:
```bazel
-bazel_dep(name = "fory", version = "1.7.5")
+bazel_dep(name = "fory", version = "1.7.6")
local_path_override(
module_name = "fory",
path = "/path/to/fory",
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/index.md
index adee666bc03..94cbfa1d5c3 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/index.md
@@ -44,7 +44,7 @@ Apache Fory™ C# 是面向 .NET 的高性能跨语言序列化库。它支持
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
</ItemGroup>
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/dart/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/dart/index.md
index b39d5ae085e..5666763a43f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/dart/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/dart/index.md
@@ -44,7 +44,7 @@ Apache Fory™ Dart 可以将 Dart 对象序列化为字节并反序列化,也
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/java/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/java/index.md
index 91f2624954d..368686e637a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/java/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/java/index.md
@@ -51,7 +51,7 @@ Fory core 支持 Java 8 及更高版本。Java Record 序列化需要 Java 17
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
@@ -59,7 +59,7 @@ Fory core 支持 Java 8 及更高版本。Java Record 序列化需要 Java 17
```kotlin
// Binary object serialization
-implementation("org.apache.fory:fory-core:1.7.5")
+implementation("org.apache.fory:fory-core:1.7.6")
```
#### JDK 25 及更高版本
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/kotlin/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/kotlin/index.md
index 6350606bf08..aa2a007acce 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/kotlin/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/kotlin/index.md
@@ -53,14 +53,14 @@ Fory Kotlin 继承了 Fory Java 的全部功能,并增加了 Kotlin 特有优
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-kotlin</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
### Gradle
```kotlin
-implementation("org.apache.fory:fory-kotlin:1.7.5")
+implementation("org.apache.fory:fory-kotlin:1.7.6")
```
### JDK25+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/basic-serialization.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/basic-serialization.md
index 5d07b9e4334..78484d7bd94 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/basic-serialization.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/basic-serialization.md
@@ -145,7 +145,7 @@ Rust 启用 `chrono::NaiveDate`、`chrono::NaiveDateTime` 和 `chrono::Duration`
```toml
[dependencies]
-fory = { version = "1.7.5", features = ["chrono"] }
+fory = { version = "1.7.6", features = ["chrono"] }
```
### 自定义类型
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/index.md
index e8d991471fb..f567af4ffae 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/rust/index.md
@@ -36,9 +36,9 @@ Rust 实现通过自动内存管理和编译期类型安全提供灵活的高性
| Crate | 说明 | 版本 |
| --------------------------------------------------------------------------- | ---------------------------------- | --------------------------------------------- |
-| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | 面向用户的 API、运行时类型和派生宏 | [1.7.5](https://crates.io/crates/fory) |
-| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | 用于高级集成的底层运行时 crate | [1.7.5](https://crates.io/crates/fory-core) |
-| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | 供直接使用运行时的底层过程宏 crate | [1.7.5](https://crates.io/crates/fory-derive) |
+| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | 面向用户的 API、运行时类型和派生宏 | [1.7.6](https://crates.io/crates/fory) |
+| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | 用于高级集成的底层运行时 crate | [1.7.6](https://crates.io/crates/fory-core) |
+| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | 供直接使用运行时的底层过程宏 crate | [1.7.6](https://crates.io/crates/fory-derive) |
大多数应用程序只需依赖 `fory`。它重新导出生成代码所需的派生宏和公共运行时类型。只有明确要基于底层运行时 crate 构建时,才直接使用 `fory-core` 或 `fory-derive`。
@@ -48,7 +48,7 @@ Rust 实现通过自动内存管理和编译期类型安全提供灵活的高性
```toml
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
```
### 基本示例
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/scala/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/scala/index.md
index f2a783338bf..9e09acdb161 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/scala/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/scala/index.md
@@ -49,7 +49,7 @@ Fory Scala 继承了 Fory Java 的全部功能,并增加了 Scala 特有优化
使用 sbt 添加依赖:
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"
```
### JDK25+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/row-format/java.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/row-format/java.md
index 5371274add8..7676d7ac787 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/row-format/java.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/row-format/java.md
@@ -41,14 +41,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-format</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-format:1.7.5")
+implementation("org.apache.fory:fory-format:1.7.6")
```
## 基本用法
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/cpp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/cpp.md
index 5c6fbfe3d8d..58e2bccffbf 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/cpp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/cpp.md
@@ -42,7 +42,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/csharp.md
index 1c161ece6df..48c97c3ee51 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/csharp.md
@@ -34,7 +34,7 @@ dotnet --version
```bash
dotnet new console -n ForyExample
cd ForyExample
-dotnet add package Apache.Fory --version 1.7.5
+dotnet add package Apache.Fory --version 1.7.6
```
将 `Program.cs` 替换为:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/dart.md
index eb309e76416..ef5ccc8e1ec 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/dart.md
@@ -34,7 +34,7 @@ dart pub --help
```yaml
dependencies:
- fory: 1.7.5
+ fory: 1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/go.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/go.md
index 634a69f71d7..80973c120b2 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/go.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/go.md
@@ -36,7 +36,7 @@ go env GOPROXY
mkdir fory-example
cd fory-example
go mod init example.com/fory-example
-go get github.com/apache/fory/go/fory@v1.7.5
+go get github.com/apache/fory/go/fory@v1.7.6
```
如果 Go proxy 尚未收录新的 submodule tag,请稍后重试,或者暂时使用 `GOPROXY=direct`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/java.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/java.md
index e3d00f161b2..73186eb1850 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/java.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/java.md
@@ -39,14 +39,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-core:1.7.5")
+implementation("org.apache.fory:fory-core:1.7.6")
```
运行下面完整的 xlang 往返示例:
@@ -85,7 +85,7 @@ public final class ForyExample {
Fory JSON 将 Java 对象映射为标准 JSON 文本和 UTF-8 字节。如果应用只需要 JSON,请添加 `fory-json`,无需添加 `fory-core`:
```kotlin
-implementation("org.apache.fory:fory-json:1.7.5")
+implementation("org.apache.fory:fory-json:1.7.6")
```
在 `ForyExample.java` 中添加 import:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/javascript.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/javascript.md
index 71b22b08f8c..d9aa1b2db43 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/javascript.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/javascript.md
@@ -33,7 +33,7 @@ npm --version
安装 core 软件包:
```bash
-npm install @apache-fory/core@1.7.5
+npm install @apache-fory/core@1.7.6
```
定义 Schema 并运行 xlang 往返示例:
@@ -65,7 +65,7 @@ JavaScript 使用 xlang 模式。接下来可阅读 [JavaScript/TypeScript 对
若要使用可选的 Node.js 字符串快速路径,请安装版本匹配的软件包:
```bash
-npm install @apache-fory/core@1.7.5 @apache-fory/hps@1.7.5
+npm install @apache-fory/core@1.7.6 @apache-fory/hps@1.7.6
```
## 其他能力
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/kotlin.md
index 9c54487c9eb..929f3113a74 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/kotlin.md
@@ -42,7 +42,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-kotlin:1.7.6")
}
```
@@ -81,7 +81,7 @@ Fory JSON 是独立于二进制对象序列化的文本格式。与普通 JSON A
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/python.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/python.md
index 547a4a8a8f8..5e09627ead0 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/python.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/python.md
@@ -33,7 +33,7 @@ python -m pip --version
安装已发布的软件包:
```bash
-python -m pip install pyfory==1.7.5
+python -m pip install pyfory==1.7.6
```
运行 xlang 往返示例:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/rust.md
index 411ff063265..721f85fcd9f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/rust.md
@@ -34,7 +34,7 @@ cargo --version
```toml title="Cargo.toml"
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
```
```rust
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/scala.md
index 4ecec3308ff..bb81113847d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/scala.md
@@ -35,7 +35,7 @@ sbt --version
```sbt
ThisBuild / scalaVersion := "3.3.1"
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"
```
创建 `src/main/scala/ScalaExample.scala`:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/swift.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/swift.md
index c6ab477f053..fcff6aa3a6b 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/swift.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/start/swift.md
@@ -39,7 +39,7 @@ swift package init --type executable --name ForyExample
```swift title="Package.swift"
dependencies: [
- .package(url: "https://github.com/apache/fory.git", exact: "1.7.5")
+ .package(url: "https://github.com/apache/fory.git", exact: "1.7.6")
],
targets: [
.executableTarget(
diff --git a/i18n/zh-CN/docusaurus-plugin-content-pages/download/index.md b/i18n/zh-CN/docusaurus-plugin-content-pages/download/index.md
index a3717a00cc4..2335cbe951b 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-pages/download/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-pages/download/index.md
@@ -9,11 +9,11 @@ Apache Fory™ 的官方发布以源码制品形式提供。
## 最新版本
-当前最新源码版本为 1.7.5:
+当前最新源码版本为 1.7.6:
| 版本 | 日期 | 源码 | 发布说明 |
| ----- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
-| 1.7.5 | 2026-09-25 | [source](https://www.apache.org/dyn/closer.lua/fory/1.7.5/apache-fory-1.7.5-src.tar.gz?action=download) [asc](https://downloads.apache.org/fory/1.7.5/apache-fory-1.7.5-src.tar.gz.asc) [sha512](https://downloads.apache.org/fory/1.7.5/apache-fory-1.7.5-src.tar.gz.sha512) | [release notes](https://github.com/apache/fory/releases/tag/v1.7.5) |
+| 1.7.6 | 2026-09-30 | [source](https://www.apache.org/dyn/closer.lua/fory/1.7.6/apache-fory-1.7.6-src.tar.gz?action=download) [asc](https://downloads.apache.org/fory/1.7.6/apache-fory-1.7.6-src.tar.gz.asc) [sha512](https://downloads.apache.org/fory/1.7.6/apache-fory-1.7.6-src.tar.gz.sha512) | [release notes](https://github.com/apache/fory/releases/tag/v1.7.6) |
## 所有归档版本
@@ -31,13 +31,13 @@ Fory 为下载站点上的所有文件提供 SHA 摘要和 PGP 签名文件。
要验证 SHA 摘要,你需要 `.tar.gz` 文件及其对应的 `.tar.gz.sha512` 文件。示例命令如下:
```bash
-sha512sum --check apache-fory-1.7.5-src.tar.gz.sha512
+sha512sum --check apache-fory-1.7.6-src.tar.gz.sha512
```
输出类似下面这样即表示校验通过:
```bash
-apache-fory-1.7.5-src.tar.gz: OK
+apache-fory-1.7.6-src.tar.gz: OK
```
### 校验签名
@@ -53,13 +53,13 @@ gpg --import KEYS
之后可以校验签名:
```bash
-gpg --verify apache-fory-1.7.5-src.tar.gz.asc apache-fory-1.7.5-src.tar.gz
+gpg --verify apache-fory-1.7.6-src.tar.gz.asc apache-fory-1.7.6-src.tar.gz
```
如果出现如下输出,即表示签名正确:
```bash
-gpg: Signature made Tue Sep 22 10:11:37 2026 CST
+gpg: Signature made Sun Sep 27 01:30:42 2026 CST
gpg: using RSA key 1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4
gpg: Good signature from "chaokunyang (CODE SIGNING KEY) <ch...@apache.org>" [unknown]
```
diff --git a/src/components/home/HomepageLanding.tsx b/src/components/home/HomepageLanding.tsx
index 96b3c2e4c9c..bbfeef3b360 100644
--- a/src/components/home/HomepageLanding.tsx
+++ b/src/components/home/HomepageLanding.tsx
@@ -138,7 +138,7 @@ const runtimeExamples: RuntimeExample[] = [
install: `<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>`,
codeLanguage: "java",
guide: "/docs/object-serialization/java/",
@@ -160,7 +160,7 @@ Person out = (Person) fory.deserialize(bytes);`,
id: "python",
label: "Python",
installLanguage: "bash",
- install: `pip install pyfory==1.7.5`,
+ install: `pip install pyfory==1.7.6`,
codeLanguage: "python",
guide: "/docs/object-serialization/python/",
summary:
@@ -183,7 +183,7 @@ out = fory.deserialize(data)`,
id: "rust",
label: "Rust",
installLanguage: "bash",
- install: `cargo add fory@1.7.5`,
+ install: `cargo add fory@1.7.6`,
codeLanguage: "rust",
guide: "/docs/object-serialization/rust/",
summary:
@@ -209,7 +209,7 @@ fn main() -> Result<(), Error> {
id: "go",
label: "Go",
installLanguage: "bash",
- install: `go get github.com/apache/fory/go/fory@v1.7.5`,
+ install: `go get github.com/apache/fory/go/fory@v1.7.6`,
codeLanguage: "go",
guide: "/docs/object-serialization/go/",
summary:
@@ -234,7 +234,7 @@ _ = f.Deserialize(payload, &out)`,
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)`,
@@ -262,7 +262,7 @@ auto out = fory.deserialize<Person>(bytes).value();`,
id: "javascript",
label: "JavaScript",
installLanguage: "bash",
- install: `npm install @apache-fory/core@1.7.5 @apache-fory/hps@1.7.5`,
+ install: `npm install @apache-fory/core@1.7.6 @apache-fory/hps@1.7.6`,
codeLanguage: "typescript",
guide: "/docs/object-serialization/javascript/",
summary:
@@ -284,7 +284,7 @@ const out = deserialize(payload);`,
id: "csharp",
label: "C#",
installLanguage: "bash",
- install: `dotnet add package Apache.Fory --version 1.7.5`,
+ install: `dotnet add package Apache.Fory --version 1.7.6`,
codeLanguage: "csharp",
guide: "/docs/object-serialization/csharp/",
summary:
@@ -308,7 +308,7 @@ Person out = fory.Deserialize<Person>(payload);`,
id: "swift",
label: "Swift",
installLanguage: "swift",
- install: `.package(url: "https://github.com/apache/fory.git", exact: "1.7.5")`,
+ install: `.package(url: "https://github.com/apache/fory.git", exact: "1.7.6")`,
codeLanguage: "swift",
guide: "/docs/object-serialization/swift/",
summary:
@@ -332,7 +332,7 @@ let out: Person = try fory.deserialize(payload)`,
label: "Dart",
installLanguage: "yaml",
install: `dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.13`,
@@ -368,7 +368,7 @@ final out = fory.deserialize<Person>(payload);`,
id: "scala",
label: "Scala",
installLanguage: "sbt",
- install: `libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"`,
+ install: `libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"`,
codeLanguage: "scala",
guide: "/docs/object-serialization/scala/",
summary:
@@ -389,8 +389,8 @@ val out = fory.deserialize(payload).asInstanceOf[Person]`,
id: "kotlin",
label: "Kotlin",
installLanguage: "kotlin",
- install: `implementation("org.apache.fory:fory-kotlin:1.7.5")
-ksp("org.apache.fory:fory-kotlin-ksp:1.7.5")`,
+ install: `implementation("org.apache.fory:fory-kotlin:1.7.6")
+ksp("org.apache.fory:fory-kotlin-ksp:1.7.6")`,
codeLanguage: "kotlin",
guide: "/docs/object-serialization/kotlin/",
summary:
diff --git a/src/pages/download/index.md b/src/pages/download/index.md
index b8589e70d76..8ad57e33583 100644
--- a/src/pages/download/index.md
+++ b/src/pages/download/index.md
@@ -9,11 +9,11 @@ For binary install, please see the Apache Fory™ [getting started](/docs/start/
## The latest release
-The latest source release is 1.7.5:
+The latest source release is 1.7.6:
| Version | Date | Source | Release Notes |
| ------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
-| 1.7.5 | 2026-09-25 | [source](https://www.apache.org/dyn/closer.lua/fory/1.7.5/apache-fory-1.7.5-src.tar.gz?action=download) [asc](https://downloads.apache.org/fory/1.7.5/apache-fory-1.7.5-src.tar.gz.asc) [sha512](https://downloads.apache.org/fory/1.7.5/apache-fory-1.7.5-src.tar.gz.sha512) | [release notes](https://github.com/apache/fory/releases/tag/v1.7.5) |
+| 1.7.6 | 2026-09-30 | [source](https://www.apache.org/dyn/closer.lua/fory/1.7.6/apache-fory-1.7.6-src.tar.gz?action=download) [asc](https://downloads.apache.org/fory/1.7.6/apache-fory-1.7.6-src.tar.gz.asc) [sha512](https://downloads.apache.org/fory/1.7.6/apache-fory-1.7.6-src.tar.gz.sha512) | [release notes](https://github.com/apache/fory/releases/tag/v1.7.6) |
## All archived releases
@@ -31,13 +31,13 @@ These files are named after the files they relate to but have `.sha512/.asc` ext
To verify the SHA digests, you need the `.tar.gz` file and its associated `.tar.gz.sha512` file. An example command:
```bash
-sha512sum --check apache-fory-1.7.5-src.tar.gz.sha512
+sha512sum --check apache-fory-1.7.6-src.tar.gz.sha512
```
It should output something like:
```bash
-apache-fory-1.7.5-src.tar.gz: OK
+apache-fory-1.7.6-src.tar.gz: OK
```
### Verifying Signatures
@@ -54,13 +54,13 @@ gpg --import KEYS
Then you can verify signature:
```bash
-gpg --verify apache-fory-1.7.5-src.tar.gz.asc apache-fory-1.7.5-src.tar.gz
+gpg --verify apache-fory-1.7.6-src.tar.gz.asc apache-fory-1.7.6-src.tar.gz
```
If something like the following appears, it means the signature is correct:
```bash
-gpg: Signature made Tue Sep 22 10:11:37 2026 CST
+gpg: Signature made Sun Sep 27 01:30:42 2026 CST
gpg: using RSA key 1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4
gpg: Good signature from "chaokunyang (CODE SIGNING KEY) <ch...@apache.org>" [unknown]
```
diff --git a/versioned_docs/version-1.7.0/compiler/build-integration.md b/versioned_docs/version-1.7.0/compiler/build-integration.md
index 40921cc01da..f0dca646633 100644
--- a/versioned_docs/version-1.7.0/compiler/build-integration.md
+++ b/versioned_docs/version-1.7.0/compiler/build-integration.md
@@ -211,7 +211,7 @@ Add the Fory dependency to `pubspec.yaml`:
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/versioned_docs/version-1.7.0/compiler/cli.md b/versioned_docs/version-1.7.0/compiler/cli.md
index 859ccae09d3..f4171a8d968 100644
--- a/versioned_docs/version-1.7.0/compiler/cli.md
+++ b/versioned_docs/version-1.7.0/compiler/cli.md
@@ -689,5 +689,5 @@ fory = "x.y.z"
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
```
diff --git a/versioned_docs/version-1.7.0/grpc/csharp.md b/versioned_docs/version-1.7.0/grpc/csharp.md
index 867be016b58..b45b057c3a6 100644
--- a/versioned_docs/version-1.7.0/grpc/csharp.md
+++ b/versioned_docs/version-1.7.0/grpc/csharp.md
@@ -39,7 +39,7 @@ Server project:
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
</ItemGroup>
```
@@ -48,7 +48,7 @@ Client project:
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
</ItemGroup>
diff --git a/versioned_docs/version-1.7.0/grpc/dart.md b/versioned_docs/version-1.7.0/grpc/dart.md
index 4df35db87ba..0c62882a28c 100644
--- a/versioned_docs/version-1.7.0/grpc/dart.md
+++ b/versioned_docs/version-1.7.0/grpc/dart.md
@@ -38,7 +38,7 @@ application that compiles or runs generated service companions:
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
grpc: ^4.0.0
dev_dependencies:
diff --git a/versioned_docs/version-1.7.0/grpc/rust.md b/versioned_docs/version-1.7.0/grpc/rust.md
index 3b3ad8343f0..e6da7b5b1fc 100644
--- a/versioned_docs/version-1.7.0/grpc/rust.md
+++ b/versioned_docs/version-1.7.0/grpc/rust.md
@@ -37,7 +37,7 @@ to build streaming responses or request streams.
```toml
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
bytes = "1"
tonic = { version = "0.14", features = ["transport"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
diff --git a/versioned_docs/version-1.7.0/json/annotations.md b/versioned_docs/version-1.7.0/json/annotations.md
index be2adefc8c3..916ccc875c4 100644
--- a/versioned_docs/version-1.7.0/json/annotations.md
+++ b/versioned_docs/version-1.7.0/json/annotations.md
@@ -163,8 +163,9 @@ The supported inclusion values are:
JDK `Optional`, `OptionalInt`, `OptionalLong`, and `OptionalDouble` values.
With the Scala module, also omit `None` and supported empty strict Scala collections and maps.
- `NON_DEFAULT`: explicitly authorize omission when the property equals a supported default.
- Different values, including null or empty values, remain included. Unsupported default sources
- cause an error when the model is initialized. See [Default omission](#jsoninclude-and-default-omission).
+ Different values, including null or empty values, remain included. Properties without defaults
+ remain included under both field-level and class-level authorization.
+ See [Default omission](#jsoninclude-and-default-omission).
```java
public final class Response {
@@ -234,13 +235,21 @@ with `ALWAYS`. `defaultPropertyInclusion(NON_DEFAULT)` immediately throws a conf
global authorization would silently apply this contract to unrelated models. `NON_EMPTY` does not
grant default-evaluation authorization.
-| Model | Supported default source |
-| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
-| Scala constructor property | Declared compiler default method, evaluated on each write with actual preceding parameters |
-| Java ordinary no-argument model | One reference object constructed using the reader's no-argument constructor |
-| Kotlin selected constructor with defaults for every parameter | One reference object constructed using those language defaults |
-| Ordinary Kotlin no-argument model | One reference object using that constructor |
-| Java required constructor parameters, Kotlin constructor with any required parameter, or Scala missing default/dependency | Rejected for an authorized property |
+Both field-level and class-level `NON_DEFAULT` retain properties without defaults, including required
+constructor parameters and Kotlin `lateinit` properties. Their null, zero, false, and empty values are written;
+reader fallbacks do not make them defaulted properties. Java models without a no-argument
+construction path selected by the reader retain their authorized properties.
+Use `ALWAYS` to retain a property with an unstable or unsupported default. Mixins follow the same rules.
+
+| Model | Supported default source |
+| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
+| Scala constructor property | Declared compiler default method, evaluated on each write with actual preceding parameters |
+| Java ordinary no-argument model | One reference object constructed using the reader's no-argument constructor |
+| Kotlin selected constructor with defaults for every parameter | One reference object constructed using those language defaults |
+| Ordinary Kotlin no-argument model | One reference object using that constructor |
+| Required properties without defaults | Retained under both field-level and class-level authorization |
+| Kotlin defaulted property when the selected constructor also has required parameters | Rejected: no reference object can be constructed without inventing required arguments |
+| Scala default method with unavailable dependencies | Rejected |
Reference construction happens once per initialized model metadata, not once per serialization.
Distinct declared and dynamic model occurrences can initialize separately. Authorization permits
diff --git a/versioned_docs/version-1.7.0/json/getting-started.md b/versioned_docs/version-1.7.0/json/getting-started.md
index aea3e942ba6..34d68f0460c 100644
--- a/versioned_docs/version-1.7.0/json/getting-started.md
+++ b/versioned_docs/version-1.7.0/json/getting-started.md
@@ -43,7 +43,7 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-json</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
@@ -57,7 +57,7 @@ repositories {
mavenCentral()
}
-implementation("org.apache.fory:fory-json:1.7.5")
+implementation("org.apache.fory:fory-json:1.7.6")
```
### Kotlin
@@ -66,7 +66,7 @@ Kotlin/JVM applications add the optional Kotlin JSON runtime and use its single
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
diff --git a/versioned_docs/version-1.7.0/json/kotlin.md b/versioned_docs/version-1.7.0/json/kotlin.md
index 57890deba01..522274b0f03 100644
--- a/versioned_docs/version-1.7.0/json/kotlin.md
+++ b/versioned_docs/version-1.7.0/json/kotlin.md
@@ -41,7 +41,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
@@ -54,7 +54,7 @@ plugins {
}
dependencies {
- ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.5")
+ ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.6")
}
```
@@ -162,6 +162,14 @@ For this model:
- a missing `id` uses `0`.
- `{"id":1,"retries":null}` fails; null never asks Kotlin to use a default.
+Enable `ForyJsonKotlin.builder().failOnMissingRequiredProperties(true).build()` to require ordinary
+constructor properties without declared defaults, including nullable properties and numeric or
+Boolean properties. Compiler defaults still apply when declared. For example, a missing `id` in
+the model above is then an error, while missing `label` and `retries` still use their defaults.
+Nullability alone does not make a property optional in this mode: a nullable property without a
+default must appear, but its value may be explicit null. This option defaults to `false` and does
+not change writing, body-property behavior, or existing non-null constraints.
+
Normal body `var` properties preserve their initializer when absent and are assigned after
construction when present. A `lateinit` property is required. Automatic creator and deferred
properties must be reconstructible in both read and write directions.
@@ -202,15 +210,21 @@ Explicit null remains distinct from a missing field and is rejected for a non-nu
Choose an inclusion rule that retains values when exact round trips are required.
`NON_DEFAULT` requires explicit field authorization with `@JsonProperty`, or class authorization
-with `@JsonInclude`. It is supported when **every parameter of the selected constructor has a
-language default**, or the model uses an ordinary no-argument constructor. Fory constructs one
+with `@JsonInclude`. Comparing against a reference object is supported when **every parameter of the
+selected constructor has a language default**, or the model uses an ordinary no-argument constructor. Fory constructs one
reference object per initialized model metadata and captures authorized property values. This
executes the complete constructor, all initializers, and `init` blocks. It is not repeated on each
write, and models without authorization do not construct a reference. Dynamic and declared model
occurrences can initialize separately.
-Models with required parameters are rejected, even if another constructor happens to have no
-arguments. Fory does not fabricate parameters, borrow them from the first object, change creator
+Both field-level and class-level authorization retain constructor properties without defaults and
+`lateinit` properties, including null, zero, false, and empty values. A defaulted property that needs
+a reference object is rejected when the selected constructor also has required parameters, even if
+another constructor has no arguments.
+For example, class-level `NON_DEFAULT` on `data class Key(val id: Int)` writes `{"id":0}` for `Key(0)`.
+For `data class Entry(val id: Int, val count: Int = 1)`, the same class policy cannot compare `count`
+without inventing `id`; give `count` an `ALWAYS` override to retain it.
+Fory does not fabricate parameters, borrow them from the first object, change creator
selection, bypass a constructor, or analyze bytecode. Failed construction reports the model and
property. Global `defaultPropertyInclusion(NON_DEFAULT)` is rejected.
diff --git a/versioned_docs/version-1.7.0/json/object-mapping.md b/versioned_docs/version-1.7.0/json/object-mapping.md
index b7d713f120c..717f5c85232 100644
--- a/versioned_docs/version-1.7.0/json/object-mapping.md
+++ b/versioned_docs/version-1.7.0/json/object-mapping.md
@@ -100,6 +100,32 @@ use ordinary-constructor side effects as a deserialization completion hook: when
constructor runs, property assignment happens afterward, and constructor-bypassing paths do not run
it at all.
+## Required constructor properties
+
+Enable `failOnMissingRequiredProperties(true)` to reject missing ordinary constructor or factory
+properties that have no declared default:
+
+```java
+ForyJson json = ForyJson.builder()
+ .failOnMissingRequiredProperties(true)
+ .build();
+```
+
+The option defaults to `false` and applies to records, property-based `JsonCreator` models, Scala
+case classes, and Kotlin constructor models, including nested objects. Declared language defaults
+and existing optional, collection, map, and array defaults remain available. Ordinary properties
+without declared defaults must appear instead of receiving zero, false, or null. No new container
+defaults are introduced: a Kotlin non-null collection without a default remains required, while
+a Scala collection retains its empty default.
+
+An explicit JSON null counts as present and continues to follow the property's type and nullability
+rules. Ignored properties, ordinary no-argument beans, and properties assigned after construction
+keep their existing behavior. Complete custom object codecs own their own missing-field rules.
+
+This option does not change writing. If an inclusion policy omits a required property, the resulting
+JSON can be rejected by a strict reader. Preserve that property in the output or use a reader with
+the option disabled.
+
## Kotlin object mapping
Install `fory-json-kotlin` and use `ForyJsonKotlin.builder()` for Kotlin/JVM classes. Kotlin
@@ -225,7 +251,8 @@ ForyJson json = ForyJson.builder().defaultPropertyInclusion(Include.NON_EMPTY).b
The builder accepts `ALWAYS`, `NON_NULL`, and `NON_EMPTY`. It rejects `DEFAULT` and `NON_DEFAULT`.
Default omission requires explicit `@JsonProperty(include = NON_DEFAULT)` or class-level
`@JsonInclude(NON_DEFAULT)` authorization; see [Default omission](annotations.md#jsoninclude-and-default-omission)
-for supported sources, construction/evaluation effects, and errors. An explicit `JsonProperty.include`
+for supported sources, construction/evaluation effects, and errors. Both forms retain properties
+without defaults, including null and zero values. An explicit `JsonProperty.include`
overrides `JsonInclude` on the class, which overrides the builder default. See
[Property inclusion](annotations.md#jsonproperty) for the empty-value definitions and boundaries.
diff --git a/versioned_docs/version-1.7.0/json/scala.md b/versioned_docs/version-1.7.0/json/scala.md
index 8e21138fa13..ee9dab49bdd 100644
--- a/versioned_docs/version-1.7.0/json/scala.md
+++ b/versioned_docs/version-1.7.0/json/scala.md
@@ -25,7 +25,7 @@ module works on the ordinary JVM and GraalVM Native Image. Android is not suppor
## Setup
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.6"
```
`ForyJsonScala.builder()` installs the Scala module and returns the standard Fory JSON builder:
@@ -95,6 +95,12 @@ json.fromJson("""{"selected":null}""", classOf[Options]) // Options(None, None)
json.fromJson("{}", classOf[Profile]) // Profile(0, false, List(), null)
```
+Use `ForyJsonScala.builder().failOnMissingRequiredProperties(true).build()` to reject missing ordinary
+constructor properties without a declared default. For example, `case class Request(id: Int)` then
+rejects `{}`, while `case class Request(id: Int = 7)` still reads it as `Request(7)`. Option,
+collection, map, and array properties retain their existing missing-value defaults. The option is
+disabled by default and does not change writing or explicit null handling.
+
Explicit constructor defaults take precedence for omitted properties. An explicit JSON `null`
decodes as `None` for `Option[A]`, even when its constructor default is `Some(...)`.
@@ -147,7 +153,7 @@ import org.apache.fory.json.scala.ForyJsonScala
@JsonInclude(Include.NON_DEFAULT)
case class Request(
- @JsonProperty(include = Include.ALWAYS) id: Int,
+ id: Int,
retries: Int = 3,
tags: List[String] = Nil
)
@@ -158,22 +164,24 @@ json.fromJson("""{"id":0}""", classOf[Request]) // Request(0, 3, Nil)
json.toJson(Request(0, retries = 0)) // {"id":0,"retries":0}
```
-`id` is explicitly excluded because it has no declared default; otherwise class-level authorization
-would fail. A reader's implicit zero, empty collection, or `None` fallback is not a declared default.
+`id` has no declared default, so class-level authorization keeps it in the output, including when
+its value is zero. A reader's implicit zero, empty collection, or `None` fallback is not a declared
+default.
Alternatively, omit the class annotation and place `@JsonProperty(include = Include.NON_DEFAULT)`
only on selected defaulted properties. Mixins support both forms. Global `NON_DEFAULT` is rejected.
Default expressions run during writing and must be deterministic and free of externally visible
side effects. For `case class Limits(low: Int)(val high: Int = low + 1)`, the comparison for `high`
uses the object's actual `low`. For `low=5, high=2`, high is retained because its default is 6.
-Missing default methods or unavailable write-schema dependencies cause a model-initialization error.
-`Unit` defaults whose JVM methods return `void` are not supported comparison sources; retain those
-properties with `ALWAYS` when authorizing the class.
+Unavailable dependencies of a selected default method cause a model-initialization error.
+Properties without a supported compiler default method are retained under both class-level and
+field-level `NON_DEFAULT`. This also applies to `Unit` defaults whose JVM methods return `void`,
+which are not supported comparison sources.
Authorization confirms that missing input restores the same context; Fory does not prove this or
expression purity. Use `ALWAYS` for time-, random-, or state-dependent defaults. Arrays compare by contents, and
floating-point comparisons distinguish positive and negative zero. Class-body initializers are
-not inferred as Scala constructor defaults. Values differing from a default, including null and
-empty collections, remain written. Reading stays independent and creates fresh mutable defaults.
+not inferred as Scala constructor defaults and remain written. Values differing from a default,
+including null and empty collections, remain written. Reading stays independent and creates fresh mutable defaults.
Class authorization covers future added fields too; see [Default omission](annotations.md#jsoninclude-and-default-omission).
## Supported Scala types
diff --git a/versioned_docs/version-1.7.0/object-serialization/cpp/index.md b/versioned_docs/version-1.7.0/object-serialization/cpp/index.md
index afe718ab0f2..4112b645055 100644
--- a/versioned_docs/version-1.7.0/object-serialization/cpp/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/cpp/index.md
@@ -62,7 +62,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
@@ -92,11 +92,11 @@ module(
bazel_dep(name = "rules_cc", version = "0.1.1")
-bazel_dep(name = "fory", version = "1.7.5")
+bazel_dep(name = "fory", version = "1.7.6")
git_override(
module_name = "fory",
remote = "https://github.com/apache/fory.git",
- commit = "v1.7.5", # Or use a specific commit hash for reproducibility
+ commit = "v1.7.6", # Or use a specific commit hash for reproducibility
)
```
@@ -128,7 +128,7 @@ bazel run //:my_app
For local development, you can use `local_path_override` instead:
```bazel
-bazel_dep(name = "fory", version = "1.7.5")
+bazel_dep(name = "fory", version = "1.7.6")
local_path_override(
module_name = "fory",
path = "/path/to/fory",
diff --git a/versioned_docs/version-1.7.0/object-serialization/csharp/index.md b/versioned_docs/version-1.7.0/object-serialization/csharp/index.md
index 314bbfc042f..6d6b76c337e 100644
--- a/versioned_docs/version-1.7.0/object-serialization/csharp/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/csharp/index.md
@@ -46,7 +46,7 @@ Reference the single `Apache.Fory` package. It includes the Fory library and the
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.5" />
+ <PackageReference Include="Apache.Fory" Version="1.7.6" />
</ItemGroup>
```
diff --git a/versioned_docs/version-1.7.0/object-serialization/dart/index.md b/versioned_docs/version-1.7.0/object-serialization/dart/index.md
index de88d951a5d..2e737dafc2a 100644
--- a/versioned_docs/version-1.7.0/object-serialization/dart/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/dart/index.md
@@ -47,7 +47,7 @@ Add the dependency to your `pubspec.yaml`:
```yaml
dependencies:
- fory: ^1.7.5
+ fory: ^1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/versioned_docs/version-1.7.0/object-serialization/java/index.md b/versioned_docs/version-1.7.0/object-serialization/java/index.md
index e09006216c4..200391d3095 100644
--- a/versioned_docs/version-1.7.0/object-serialization/java/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/java/index.md
@@ -63,7 +63,7 @@ or later.
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
@@ -71,7 +71,7 @@ or later.
```kotlin
// Binary object serialization
-implementation("org.apache.fory:fory-core:1.7.5")
+implementation("org.apache.fory:fory-core:1.7.6")
```
#### JDK 25 and Later
diff --git a/versioned_docs/version-1.7.0/object-serialization/kotlin/index.md b/versioned_docs/version-1.7.0/object-serialization/kotlin/index.md
index f39fcd83a45..6e9f7c3b8bd 100644
--- a/versioned_docs/version-1.7.0/object-serialization/kotlin/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/kotlin/index.md
@@ -53,14 +53,14 @@ See [Java Features](../java/index.md#features) for complete feature list.
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-kotlin</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
### Gradle
```kotlin
-implementation("org.apache.fory:fory-kotlin:1.7.5")
+implementation("org.apache.fory:fory-kotlin:1.7.6")
```
### JDK25+
diff --git a/versioned_docs/version-1.7.0/object-serialization/rust/basic-serialization.md b/versioned_docs/version-1.7.0/object-serialization/rust/basic-serialization.md
index c5ecc0bd109..e25539885c5 100644
--- a/versioned_docs/version-1.7.0/object-serialization/rust/basic-serialization.md
+++ b/versioned_docs/version-1.7.0/object-serialization/rust/basic-serialization.md
@@ -147,7 +147,7 @@ let later = timestamp.checked_add_duration(duration)?;
```toml
[dependencies]
-fory = { version = "1.7.5", features = ["chrono"] }
+fory = { version = "1.7.6", features = ["chrono"] }
```
### Custom Types
diff --git a/versioned_docs/version-1.7.0/object-serialization/rust/index.md b/versioned_docs/version-1.7.0/object-serialization/rust/index.md
index 9b1e313541a..4c1cf50092b 100644
--- a/versioned_docs/version-1.7.0/object-serialization/rust/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/rust/index.md
@@ -37,9 +37,9 @@ The Rust implementation provides versatile and high-performance serialization wi
| Crate | Description | Version |
| --------------------------------------------------------------------------- | ----------------------------------------------------- | --------------------------------------------- |
-| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | User-facing API, public Fory types, and derive macros | [1.7.5](https://crates.io/crates/fory) |
-| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | Lower-level core crate for advanced integrations | [1.7.5](https://crates.io/crates/fory-core) |
-| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | Procedural macro crate for direct derive-macro use | [1.7.5](https://crates.io/crates/fory-derive) |
+| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | User-facing API, public Fory types, and derive macros | [1.7.6](https://crates.io/crates/fory) |
+| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | Lower-level core crate for advanced integrations | [1.7.6](https://crates.io/crates/fory-core) |
+| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | Procedural macro crate for direct derive-macro use | [1.7.6](https://crates.io/crates/fory-derive) |
Most applications should depend on `fory` only. It re-exports the derive
macros and the public Fory types needed by generated code. Use `fory-core`
@@ -52,7 +52,7 @@ Add Apache Fory™ to your `Cargo.toml`:
```toml
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
```
### Basic Example
diff --git a/versioned_docs/version-1.7.0/object-serialization/scala/index.md b/versioned_docs/version-1.7.0/object-serialization/scala/index.md
index f051855bbb9..fdf64a96c20 100644
--- a/versioned_docs/version-1.7.0/object-serialization/scala/index.md
+++ b/versioned_docs/version-1.7.0/object-serialization/scala/index.md
@@ -49,7 +49,7 @@ See [Java Features](../java/index.md#features) for complete feature list.
Add the dependency with sbt:
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"
```
### JDK25+
diff --git a/versioned_docs/version-1.7.0/row-format/java.md b/versioned_docs/version-1.7.0/row-format/java.md
index 0fe607c728e..835f352e3be 100644
--- a/versioned_docs/version-1.7.0/row-format/java.md
+++ b/versioned_docs/version-1.7.0/row-format/java.md
@@ -43,14 +43,14 @@ For Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-format</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
For Gradle:
```kotlin
-implementation("org.apache.fory:fory-format:1.7.5")
+implementation("org.apache.fory:fory-format:1.7.6")
```
## Basic Usage
diff --git a/versioned_docs/version-1.7.0/start/cpp.md b/versioned_docs/version-1.7.0/start/cpp.md
index dbd1443855a..93a1c3fff17 100644
--- a/versioned_docs/version-1.7.0/start/cpp.md
+++ b/versioned_docs/version-1.7.0/start/cpp.md
@@ -45,7 +45,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.5
+ GIT_TAG v1.7.6
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
diff --git a/versioned_docs/version-1.7.0/start/csharp.md b/versioned_docs/version-1.7.0/start/csharp.md
index e3b0a5308bf..a47d9b8c248 100644
--- a/versioned_docs/version-1.7.0/start/csharp.md
+++ b/versioned_docs/version-1.7.0/start/csharp.md
@@ -36,7 +36,7 @@ Create a console project and add the released package:
```bash
dotnet new console -n ForyExample
cd ForyExample
-dotnet add package Apache.Fory --version 1.7.5
+dotnet add package Apache.Fory --version 1.7.6
```
Replace `Program.cs` with:
diff --git a/versioned_docs/version-1.7.0/start/dart.md b/versioned_docs/version-1.7.0/start/dart.md
index f67b3d3e476..dc4c3afbc4f 100644
--- a/versioned_docs/version-1.7.0/start/dart.md
+++ b/versioned_docs/version-1.7.0/start/dart.md
@@ -36,7 +36,7 @@ Add Fory and the generator to `pubspec.yaml`:
```yaml
dependencies:
- fory: 1.7.5
+ fory: 1.7.6
dev_dependencies:
build_runner: ^2.4.0
diff --git a/versioned_docs/version-1.7.0/start/go.md b/versioned_docs/version-1.7.0/start/go.md
index 145ffbc4dc5..efa03140b03 100644
--- a/versioned_docs/version-1.7.0/start/go.md
+++ b/versioned_docs/version-1.7.0/start/go.md
@@ -38,7 +38,7 @@ Create a module and install the released Fory module:
mkdir fory-example
cd fory-example
go mod init example.com/fory-example
-go get github.com/apache/fory/go/fory@v1.7.5
+go get github.com/apache/fory/go/fory@v1.7.6
```
If a Go proxy has not picked up a new submodule tag yet, retry later or use
diff --git a/versioned_docs/version-1.7.0/start/java.md b/versioned_docs/version-1.7.0/start/java.md
index 8f0a338fa6a..9bd5f221652 100644
--- a/versioned_docs/version-1.7.0/start/java.md
+++ b/versioned_docs/version-1.7.0/start/java.md
@@ -44,14 +44,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.5</version>
+ <version>1.7.6</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-core:1.7.5")
+implementation("org.apache.fory:fory-core:1.7.6")
```
Run this complete xlang round trip:
@@ -97,7 +97,7 @@ Fory JSON maps Java objects to standard JSON text and UTF-8 bytes. Add
`fory-json` instead of `fory-core` when the application only needs JSON:
```kotlin
-implementation("org.apache.fory:fory-json:1.7.5")
+implementation("org.apache.fory:fory-json:1.7.6")
```
Add the import to `ForyExample.java`:
diff --git a/versioned_docs/version-1.7.0/start/javascript.md b/versioned_docs/version-1.7.0/start/javascript.md
index 32a4cf5c48c..3dd7e711e2b 100644
--- a/versioned_docs/version-1.7.0/start/javascript.md
+++ b/versioned_docs/version-1.7.0/start/javascript.md
@@ -36,7 +36,7 @@ npm --version
Install the core package:
```bash
-npm install @apache-fory/core@1.7.5
+npm install @apache-fory/core@1.7.6
```
Define a schema and run an xlang round trip:
@@ -72,7 +72,7 @@ JavaScript uses xlang mode. Continue with
For the optional Node.js string fast path, install the matching package version:
```bash
-npm install @apache-fory/core@1.7.5 @apache-fory/hps@1.7.5
+npm install @apache-fory/core@1.7.6 @apache-fory/hps@1.7.6
```
## Other Capabilities
diff --git a/versioned_docs/version-1.7.0/start/kotlin.md b/versioned_docs/version-1.7.0/start/kotlin.md
index 189d918e685..faa65bd945c 100644
--- a/versioned_docs/version-1.7.0/start/kotlin.md
+++ b/versioned_docs/version-1.7.0/start/kotlin.md
@@ -44,7 +44,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-kotlin:1.7.6")
}
```
@@ -88,7 +88,7 @@ module when interoperating with ordinary JSON APIs, browsers, logs, or other JSO
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.5")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.6")
}
```
diff --git a/versioned_docs/version-1.7.0/start/python.md b/versioned_docs/version-1.7.0/start/python.md
index 5b761149501..e3a6e9aeae6 100644
--- a/versioned_docs/version-1.7.0/start/python.md
+++ b/versioned_docs/version-1.7.0/start/python.md
@@ -35,7 +35,7 @@ python -m pip --version
Install the released package:
```bash
-python -m pip install pyfory==1.7.5
+python -m pip install pyfory==1.7.6
```
Run an xlang round trip:
diff --git a/versioned_docs/version-1.7.0/start/rust.md b/versioned_docs/version-1.7.0/start/rust.md
index 228f9996dbb..4792e80b6e0 100644
--- a/versioned_docs/version-1.7.0/start/rust.md
+++ b/versioned_docs/version-1.7.0/start/rust.md
@@ -36,7 +36,7 @@ Add the public crate:
```toml title="Cargo.toml"
[dependencies]
-fory = "1.7.5"
+fory = "1.7.6"
```
```rust
diff --git a/versioned_docs/version-1.7.0/start/scala.md b/versioned_docs/version-1.7.0/start/scala.md
index 7fa04e7da16..2048de39a8d 100644
--- a/versioned_docs/version-1.7.0/start/scala.md
+++ b/versioned_docs/version-1.7.0/start/scala.md
@@ -37,7 +37,7 @@ Add the Fory Scala library to `build.sbt`:
```sbt
ThisBuild / scalaVersion := "3.3.1"
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.6"
```
Create `src/main/scala/ScalaExample.scala`:
diff --git a/versioned_docs/version-1.7.0/start/swift.md b/versioned_docs/version-1.7.0/start/swift.md
index 122e2f89150..b72a56862a5 100644
--- a/versioned_docs/version-1.7.0/start/swift.md
+++ b/versioned_docs/version-1.7.0/start/swift.md
@@ -42,7 +42,7 @@ Add the released package and depend on its `Fory` library in the generated `Pack
```swift title="Package.swift"
dependencies: [
- .package(url: "https://github.com/apache/fory.git", exact: "1.7.5")
+ .package(url: "https://github.com/apache/fory.git", exact: "1.7.6")
],
targets: [
.executableTarget(
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org