8000 AllowableValues for @ApiParam is not honored by Swagger when request parameter is Collection Array · Issue #3321 · springfox/springfox · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
AllowableValues for @ApiParam is not honored by Swagger when request parameter is Collection Array #3321
Closed
@SarveshSharma06

Description

@SarveshSharma06

I am working with springfox version 2.9.2

In my spring boot application, I have a RestController with request parameter like:

@ApiParam(allowableValues="one, two, three")
            @RequestParam(name = "expand", required = false) Set<NumberEnum> numbers

I have an Enum class NumberEnum with values {one, two, three, four}

On swagger am expecting to see: "Available values: one, two, three" Instead I see all the 4 enum values.
Here's how my swagger json looks like:

{
            "name": "numbers",
            "in": "query",
            "description": "some desc",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "one",
                "two",
                "three",
                "four"
              ]
            },
            "collectionFormat": "multi",
            "allowEmptyValue": false,
            "enum": [
              "one",
              "two",
              "three",
              "four"
            ]
          }

Am I doing something wrong here. Please advice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0