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

Conversation

@jasonkung22
Copy link
Contributor

Discussion #973

  1. Check whether you need to use enumName as the enumeration example value based on the enumNameExample configuration. The default value of enumNameExample is false
  2. If enumNameExample is false, determine whether to configure a data dictionary
  3. If the enumeration is configured for the numeric dictionary, the code field of the data dictionary is taken as the value
  4. If there is no data dictionary, determine whether the enumeration has a '@jsonvalue' annotation, and if there is a '@jsonvalue' annotation take the enumerated value
  5. If there is no '@jsonvalue' annotation, the first argument of the enumerated field is the enumerated value by default, and if there is no argument, the enumerated field name is taken

Closes #976

@github-actions
Copy link

github-actions bot commented Dec 3, 2024

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中提供示例代码。这将帮助其他用户了解如何使用新功能。

1. Check whether you need to use enumName as the enumeration example value based on the enumNameExample configuration. The default value of enumNameExample is false
2. If enumNameExample is false, determine whether to configure a data dictionary
3. If the enumeration is configured for the numeric dictionary, the code field of the data dictionary is taken as the value
4. If there is no data dictionary, determine whether the enumeration has a '@jsonvalue' annotation, and if there is a '@jsonvalue' annotation take the enumerated value
5. If there is no '@jsonvalue' annotation, the first argument of the enumerated field is the enumerated value by default, and if there is no argument, the enumerated field name is taken

Closes TongchengOpenSource#976
@jasonkung22 jasonkung22 force-pushed the feat/config_enum_name_example branch from 43360b5 to 6b75ba5 Compare December 3, 2024 09:45
@linwumingshi linwumingshi self-requested a review December 5, 2024 11:58
@linwumingshi linwumingshi merged commit 00ce3ae into TongchengOpenSource:master Dec 5, 2024
11 checks passed
@linwumingshi linwumingshi added this to the 3.1.0 milestone Dec 5, 2024
@shalousun shalousun added the enhancement New feature or request label Dec 7, 2024
jasonkung22 added a commit to jasonkung22/smart-doc that referenced this pull request Dec 11, 2024
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
jasonkung22 added a commit to jasonkung22/smart-doc that referenced this pull request Dec 11, 2024
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The sample values of the enumeration should be as uniform as possible

3 participants