Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Conversation

@jasonkung22
Copy link
Contributor

@jasonkung22 jasonkung22 commented Dec 11, 2024

Added the 'enumConvertor' configuration and modified the enumeration example value logic

1. Added the 'enumConvertor' configuration
2. non-JSON parameters (header/get/path request, post/put request formdata mode)
	1.1. if the 'enumConvertor' configuration is true
		a. If there is '@JsonValue' annotation, take enumeration value according to '@JsonValue' annotation, the parameter type is the actual type of the enumeration value
		b. If there is no '@JsonValue' annotation, take the enumeration name, the parameter type is enum
	1.2. If 'enumConvertor' configuration is false
		Take enumeration name, the parameter type is enum

3. json parameters or json response (post/put request body mode)
	2.1. if there is '@JsonValue' annotation, take the enumeration value according to '@JsonValue' annotation, the parameter type is the actual type of the enumeration value
	2.2. if there is no '@JsonValue' annotation, take the enumeration name, the parameter type is enum

#977
#973

Closes #986

…enumeration example value logic

1. Added the 'enumConvertor' configuration
2. non-JSON parameters (header/get/path request, post/put request form-data mode)
	1.1. if the 'enumConvertor' configuration is true
		a. If there is '@jsonvalue' annotation, take enumeration value according to '@jsonvalue' annotation, the parameter type is the actual type of the enumeration value
		b. If there is no '@jsonvalue' annotation, take the enumeration name, the parameter type is enum
	1.2. If 'enumConvertor' configuration is false
		Take enumeration name, the parameter type is enum

3. json parameters or json response (post/put request body mode)
	2.1. if there is '@jsonvalue' annotation, take the enumeration value according to '@jsonvalue' annotation, the parameter type is the actual type of the enumeration value
	2.2. if there is no '@jsonvalue' annotation, take the enumeration name, the parameter type is enum

TongchengOpenSource#977
TongchengOpenSource#973

Closes TongchengOpenSource#986
@github-actions
Copy link

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage configuration change such as Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/ for repository smart-doc-group/smart-doc-group.github.io

In addition, if you have added new features, please provide example code in the repository smart-doc-group/smart-doc-example-cn. This will help other users understand how to use the new features.


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式 配置参数的变更,如:新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库smart-doc-group/smart-doc-group.github.io中的docs/目录下添加或更新文档(markdown格式)。

另外,如果您添加了新功能,请在仓库smart-doc-group/smart-doc-example-cn中提供示例代码。这将帮助其他用户了解如何使用新功能。

jasonkung22 added a commit to jasonkung22/smart-doc-group.github.io that referenced this pull request Dec 11, 2024
1. If true, the enumeration value is parsed as an enumeration example value.
2. If false, take the enumeration name as the enumeration example value

PR: TongchengOpenSource/smart-doc#989
jasonkung22 added a commit to jasonkung22/smart-doc-group.github.io that referenced this pull request Dec 11, 2024
In the header/path/query request mode, whether to enable the enumeration converter, the default value is false.
1. If true, the enumeration value is parsed as an enumeration example value.
2. If false, take the enumeration name as the enumeration example value

PR: TongchengOpenSource/smart-doc#989
@shalousun shalousun merged commit bd314f3 into TongchengOpenSource:master Dec 11, 2024
12 checks passed
jasonkung22 added a commit to jasonkung22/smart-doc-group.github.io that referenced this pull request Dec 12, 2024
In the header/path/query request mode, whether to enable the enumeration converter, the default value is false.
1. If true, the enumeration value is parsed as an enumeration example value.
2. If false, take the enumeration name as the enumeration example value

PR: TongchengOpenSource/smart-doc#989
@shalousun shalousun added this to the 3.1.0 milestone Dec 13, 2024
@shalousun shalousun added the bug Something isn't working label Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

By default, the type of the enumeration attribute field should be enum

2 participants