Closed baboy closed 7 months ago
I don't see the enumClassName parameter in smart-doc 3.0.2. Can't reproduce the exception, can you provide the code that reproduces it, the config file?
I don't see the enumClassName parameter in smart-doc 3.0.2. Can't reproduce the exception, can you provide the code that reproduces it, the config file?
If you define a Enum class in your project like this:
public enum TestEnum {
NAME1,
NAME2;
}
the Enum class without code and message attributions;
And you configure a dataDictionaries in smart-doc.json, like this:
{
"outPath": "D://docs/cloud-ability-api",
"sortByTitle": false,
"allInOne": true,
"allInOneDocFileName": "index.html",
"coverOld": true,
"inlineEnum": true,
...
"dataDictionaries": [
{
"title": "主机操作",
"enumClassName": "xxx.TestEnum",
"codeField": "",
"descField": ""
}
...
]
}
The exception will be output...
codeField 和 descField 不能为空,你可以使用toString():
"dataDictionaries": [
{
"title": "主机操作",
"enumClassName": "xxx.TestEnum",
"codeField": "toString()",
"descField": "toString()"
}
]
codeField 和 descField 不能为空,你可以使用toString():
"dataDictionaries": [ { "title": "主机操作", "enumClassName": "xxx.TestEnum", "codeField": "toString()", "descField": "toString()" } ]
@abing22333 嗯嗯,这个办法可以
Your Environment(您的使用环境)
Expected Behavior(您期望的结果)
Didn't set dataDictionaries field in smart-doc.json config file I want the plugin output:
Current Behavior(当前结果)
If I didn't configure dataDictionaries in smart-doc.json,the Enum values display without separators,it's difficult to read.
If I configured dataDictionaries,doc will show "Enum:xxx", If I didn't configured the attribution,it will show Enum Values:xxx, the template is different...
if the class is original Enum, it didn't had code and desc fields, the plugin will be error: eg:
smart-doc.json
I hope this plugin can compatible with the original Java Enum. and when I export dictionaries, it would display the NAME attribution of the Enum class. the name attribution is very important for Enum class.
Possible Solution(bug解决建议)
Steps to Reproduce (Bug产生步骤,请尽量提供用例代码)
1. 2. 3. 4.
Context(Bug影响描述)