Skip to content

Commit

Permalink
feat: Add the 'enumNameExample' configuration, default 'true'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jasonkung22 committed Dec 7, 2024
1 parent aa2b480 commit c4882b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/en/guide/advanced/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
| `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. |
| `jmeter` | `3.0.4` || `Object` | | Custom Configurations for JMeter Performance Test Script Generation |
| `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. |
| `enumNameExample` | `3.1.0` || `Boolean` | `true` | Whether to use enumeration field names when obtaining enumeration example values. |

```json
{
Expand Down Expand Up @@ -246,7 +247,8 @@
"jmeter": {
"addPrometheusListener": true
},
"addDefaultHttpStatuses": true
"addDefaultHttpStatuses": true,
"enumNameExample": true
}
```
## packageFilters
Expand Down
4 changes: 3 additions & 1 deletion docs/zh/guide/advanced/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
| `showValidation` | `3.0.3` || `Boolean` | `true` | `showValidation`用于控制`smart-doc`是否提取JSR字段验证信息展示到文档中 |
| `jmeter` | `3.0.4` || `Object` | | 生成`JMeter`性能测试脚本一些配置。 |
| `addDefaultHttpStatuses` | `3.0.5` || `Boolean` | `false` | 生成文档时是否添加框架默认的`http`状态码,例如`Spring MVC`默认的`500``404`, 当前只有生成`OenAPI`文档时支持。 |
| `enumNameExample` | `3.1.0` || `Boolean` | `true` | 获取枚举示例值时,是否采用枚举字段名称。 |

```json
{
Expand Down Expand Up @@ -250,7 +251,8 @@
"jmeter": {
"addPrometheusListener": true
},
"addDefaultHttpStatuses": true
"addDefaultHttpStatuses": true,
"enumNameExample": true
}
```

Expand Down

0 comments on commit c4882b6

Please sign in to comment.