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

Most upvoted comments

@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…