Skip to content

Separate description per allowableValue #1012

@cowwoc

Description

@cowwoc

It's not clear how to document enums in a scalable manner. I want to provide users with a list of all possible enum values, and for each value provide a description of its meaning.

Ideally, I would like to link to the enum from the REST method that returns it and then provide a separate description (annotation) per value.

@ApiModelProperty(dataType = "string", allowableValues = "Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday", value = "description", notes = "notes") is not a good fit because:

  1. The documentation falls out of date if an enum value is added or removed.
  2. I am forced to dump the description for all values in a single notes field. This clutters the code and is hard to maintain.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions