Skip to content
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

Enums in BeanParam as PathParam or QueryParam 1.5.1-M2 #1019

Closed
swarupe04 opened this issue Apr 29, 2015 · 2 comments
Closed

Enums in BeanParam as PathParam or QueryParam 1.5.1-M2 #1019

swarupe04 opened this issue Apr 29, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@swarupe04
Copy link

In 1.5.1-M2, enum parameters in BeanParam as PathParam or QueryParam are not showing the drop down list on the swagger ui. Looking at the swagger.json, I don't see the enum values listed which seems to be issue on core side.

As a workaround, I've been using the @ApiParam with allowableValues.

Sample: field in BeanParam object:

 @ApiParam(required = true, value = "type of summary report",
            allowableValues = "summary,summary-jp,summary-uk",
            defaultValue = "summary")
    @PathParam("report_type")
    @DefaultValue("summary")
    @JsonProperty("report_type")
    private ReportType reportType = ReportType.REP_AOP_CORE_METRICS;
@webron webron added this to the v1.5 milestone Apr 29, 2015
@kungfoo
Copy link

kungfoo commented Apr 29, 2015

I;ve noticed this too but figured it was supposed to be this way.

@kungfoo
Copy link

kungfoo commented Apr 30, 2015

I think this is a bug in the UI because it seems the spec returned is correct. In the sample I just created, the enum Action is returned as:

"Pet" : {
      "properties" : {
        "kind" : {
          "type" : "string",
          "enum" : [ "DOG", "CAT", "UNKNOWN" ]
        },
      }

fehguy added a commit that referenced this issue May 19, 2015
Fixes #1019: Listing of enum values has been fixed.
@fehguy fehguy closed this as completed May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants