springfox: Allowable Values for enumerations on response models do not render options
I`m not shure if this has to be adressed for swagger-spec or springfox-swagger:
When returning an Java-Enum it would be nice to see the “allowable Values” of this enum as possible results in the generated json-output. For using enums as Parameters this is already working, but not for using enums as response-object.
Where do I need to adress this feature?
Example:
@RequestMapping(value = "/someResource", method = RequestMethod.GET)
public ResponseEntity<SomeEnum> readResource()
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 24 (12 by maintainers)
Commits related to this issue
- #801 #810 Add proper support for enums in response values and in schema objects — committed to kevinconaway/springfox by deleted user 9 years ago
- #801 #810 Add separate ModelRef constructor to avoid passing an explicit null — committed to kevinconaway/springfox by deleted user 9 years ago
- #801 #810 Improve test case — committed to kevinconaway/springfox by deleted user 9 years ago
@dilipkrish / @kevinconaway Only for understanding: When returning plain java enum in Spring Controller Method, the allowable values should get listed in swagger-ui / json? Or is some additional Annotation e.g. needed?
Maybe you can add an example?
Using swagger 2.2.2 returning an java enum via “return new ResponseEntity(SomeJavaEnum.Value, HttpStatus.OK);” I only get “{“description”:“OK”,“schema”:{“type”:“string”}}” in generated json spec…