From 23c72832867e5cce593ba7e91c9df389c7c67e1e Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Fri, 14 Nov 2025 15:35:15 +0800 Subject: [PATCH] docs: update quick-start --- docs-source/src/en/guide/quick-start.md | 7 ++++++- docs-source/src/zh-cn/guide/quick-start.md | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs-source/src/en/guide/quick-start.md b/docs-source/src/en/guide/quick-start.md index 00acefb..d9fdf7e 100644 --- a/docs-source/src/en/guide/quick-start.md +++ b/docs-source/src/en/guide/quick-start.md @@ -299,7 +299,12 @@ common { // These key-values rules are applied when properties' keys exist. keyValuesRules( "some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it }, - "some.key2" to ValueRule { "$it-value" } + "some.key2" to ValueRule { "$it-value" }, + // You can also specify the expected type class, + // the type you specify will be used during generation, + // and an exception will be thrown if the type cannot be converted correctly. + // If the [useTypeAutoConversion] is not enabled, this parameter will be ignored. + "some.key3" to ValueRule(Int::class) ) // Set where to find properties' key-values. diff --git a/docs-source/src/zh-cn/guide/quick-start.md b/docs-source/src/zh-cn/guide/quick-start.md index 0728442..662bfa8 100644 --- a/docs-source/src/zh-cn/guide/quick-start.md +++ b/docs-source/src/zh-cn/guide/quick-start.md @@ -283,7 +283,11 @@ common { // 当属性键存在时应用这些键值规则 keyValuesRules( "some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it }, - "some.key2" to ValueRule { "$it-value" } + "some.key2" to ValueRule { "$it-value" }, + // 你还可以指定期望的类型类,生成时将使用你指定的类型, + // 如果类型无法正确转换,将抛出异常 + // 如果未启用 [useTypeAutoConversion],此参数将被忽略 + "some.key3" to ValueRule(Int::class) ) // 设置查找属性键值的位置