-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The errorCodeDictionaries enumeration class does not exist; getter method results in an error. #408
Comments
Configuring the internal enumeration |
Business enumerations are generally defined by oneself, aren't they? What scenarios require the use of the HttpStatus enumeration class? Here, enumeration values are obtained through the reflection of getter methods; if a getter method cannot be found, the enumeration class cannot be parsed. |
The API is designed according to standard RESTful principles, using HTTP status. |
@Ikki-Dai Upon reviewing the code, it seems that the issue actually stems from the Spring source code; some fields have getters added while others do not, resulting in an inconsistent style. |
Let's see if we can support parsing methods for codeField and descField; if they end with () then execute the corresponding method. |
This can also be the configuration with the least changes. |
Your Environment(您的使用环境)
Expected Behavior(您期望的结果)
errorCodeDictionaries: [{
"title": "http code",
"enumClassName": "org.springframework.http.HttpStatus",
"codeField": "value",
"descField": "reasonPhrase"
}]
Current Behavior(当前结果)
java.lang.NoSuchMethodException: org.springframework.http.HttpStatus.getValue()
Possible Solution(bug解决建议)
Enums may not have getter methods corresponding to their fields.
Enum 可能不存在字段对应的 getter 方法
Steps to Reproduce (Bug产生步骤,请尽量提供用例代码)
Context(Bug影响描述)
When designing an interface using RESTful,
it is not possible to use Spring HTTP status as the response code for outputting documentation.
The text was updated successfully, but these errors were encountered: