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

Parameter $refs are not handled correctly #906

Closed
duncanhall opened this issue Feb 4, 2015 · 3 comments
Closed

Parameter $refs are not handled correctly #906

duncanhall opened this issue Feb 4, 2015 · 3 comments

Comments

@duncanhall
Copy link

When specifying a top level parameter and then referencing it in a path, swagger-ui does not expand the reference at all:

swagger-ui-ref-bug

This can be tested with this minimal schema:

{
    "swagger": "2.0",
    "host": "qa.test.com",
    "basePath": "/api/v2",
    "info": {
        "version": "0.2.0",
        "title": "Parameter $ref test",
        "description": "Example"
    },
    "parameters": {
        "start": {
            "name": "start",
            "in": "query",
            "description": "The starting index to offset results from",
            "type": "integer",
            "default": 0,
            "minimum": 0
        }
    },
    "paths": {
        "/item": {
            "get": {
                "description": "Return some items",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "A type of item",
                        "required": true,
                        "type": "string",
                        "format": "string"
                    },
                    {
                        "$ref": "#/parameters/start"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response"
                    }
                }
            }
        }
    }
}

The very same schema loaded into the swagger editor works as exepcted:

swagger-editor

@webron
Copy link
Contributor

webron commented Feb 4, 2015

Thanks. This is a duplicate of #621 and is currently slated for the M2 release.

@webron webron closed this as completed Feb 4, 2015
@duncanhall
Copy link
Author

Ah, sorry for not looking harder. Thanks for the quick response.

@webron
Copy link
Contributor

webron commented Feb 4, 2015

No worries. It's better to have duplicates than having no reports.

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

No branches or pull requests

2 participants