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

$ref not allowed in array-type query parameters in OpenAPI 2.0 spec #190

Open
zhirsch opened this issue Oct 1, 2017 · 1 comment · May be fixed by #192
Open

$ref not allowed in array-type query parameters in OpenAPI 2.0 spec #190

zhirsch opened this issue Oct 1, 2017 · 1 comment · May be fixed by #192
Assignees

Comments

@zhirsch
Copy link

zhirsch commented Oct 1, 2017

The current OpenAPI 2.0 spec fails validation with go-swagger (...) because there are query parameters that use a $ref as the item. That's disallowed according to https://stackoverflow.com/questions/41639571/swagger-2-use-enum-reference-in-query-parameter-of-array-type.

So instead of:

           {
             "name": "components",
             "in": "query",
             "description": "<snip>",
             "type": "array",
             "items": {
               "$ref": "#/definitions/Destiny.DestinyComponentType"
             }
           },

You have to write:

           {
             "name": "components",
             "in": "query",
             "description": "<snip>",
             "type": "array",
             "items": {
               "type": "integer"
             },
             "collectionFormat": "csv"
           },
@vthornheart-bng
Copy link
Contributor

Oh, what a pain OpenAPI 2.0 is! That sucks. Are you able to move over to using the 3.0 specs that we generate instead? I don't know when I'm going to have time to address this issue, but I will keep it open so that when I'm finally able to work on spec issues again I can investigate a fix. But if this is holding you up, see if you can use the 3.0 spec against a 3.0 generator instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants