Skip to content

Commit c4882b6

Browse files
committed
feat: Add the 'enumNameExample' configuration, default 'true'
1. When 'enumNameExample' is configured to true, the enumeration example value is always the enumeration field name. 2. When 'enumNameExample' is configured to false, the system determines the value based on the data dictionary, '@jsonvalue', and enumeration field parameters
1 parent aa2b480 commit c4882b6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/en/guide/advanced/config.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
| `showValidation` | `3.0.3` || `Boolean` | `true` | `showValidation` is used to control whether `smart-doc` extracts the JSR validation information of fields for display in the documentation. |
6565
| `jmeter` | `3.0.4` || `Object` | | Custom Configurations for JMeter Performance Test Script Generation |
6666
| `addDefaultHttpStatuses` | `3.0.5` || `Boolean` | `false` | When generating documentation, consider whether to include the default HTTP status codes from frameworks such as Spring MVC's default `500` and `404` errors. Currently, only the generation of `OpenAPI` documentation supports this feature. |
67+
| `enumNameExample` | `3.1.0` || `Boolean` | `true` | Whether to use enumeration field names when obtaining enumeration example values. |
6768

6869
```json
6970
{
@@ -246,7 +247,8 @@
246247
"jmeter": {
247248
"addPrometheusListener": true
248249
},
249-
"addDefaultHttpStatuses": true
250+
"addDefaultHttpStatuses": true,
251+
"enumNameExample": true
250252
}
251253
```
252254
## packageFilters

docs/zh/guide/advanced/config.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
| `showValidation` | `3.0.3` || `Boolean` | `true` | `showValidation`用于控制`smart-doc`是否提取JSR字段验证信息展示到文档中 |
6969
| `jmeter` | `3.0.4` || `Object` | | 生成`JMeter`性能测试脚本一些配置。 |
7070
| `addDefaultHttpStatuses` | `3.0.5` || `Boolean` | `false` | 生成文档时是否添加框架默认的`http`状态码,例如`Spring MVC`默认的`500``404`, 当前只有生成`OenAPI`文档时支持。 |
71+
| `enumNameExample` | `3.1.0` || `Boolean` | `true` | 获取枚举示例值时,是否采用枚举字段名称。 |
7172

7273
```json
7374
{
@@ -250,7 +251,8 @@
250251
"jmeter": {
251252
"addPrometheusListener": true
252253
},
253-
"addDefaultHttpStatuses": true
254+
"addDefaultHttpStatuses": true,
255+
"enumNameExample": true
254256
}
255257
```
256258

0 commit comments

Comments
 (0)