Skip to content

References are not parsed properly #167

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

Closed
billhainaut opened this issue Nov 26, 2014 · 3 comments
Closed

References are not parsed properly #167

billhainaut opened this issue Nov 26, 2014 · 3 comments

Comments

@billhainaut
Copy link

At the request of webron, I'm opening this issue.

This spec does not resolve the references properly:

{
    "swagger": "2.0",
    "info": {
        "description": "TODO - This will be the API/Plan description",
        "version": "v1",
        "title": "TODO - Determine what needs to be done for title",
        "termsOfService": "http://helloreverb.com/terms/",
        "contact": {
            "name": "[email protected]"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        }
    },
    "host": "resource.myrheem.com",
    "basePath": "/v1",
    "schemes": ["http"],
    "paths": {
        "/people/mymenus": {
            "get": {
                "tags": ["people"],
                "summary": "Gets my menus.",
                "description": "More details for method can go here to support swagger",
                "operationId": "GetMyMenus",
                "consumes": ["application/json"],
                "produces": ["application/json"],
                "parameters": [{
                    "in": "header",
                    "name": "X-ClientID",
                    "description": "ClientId for this application",
                    "required": true,
                    "type": "string"
                },
                {
                    "in": "header",
                    "name": "Authorization",
                    "description": "Bearer Token for logged in user",
                    "required": true,
                    "type": "string"
                }],
                "responses": {
                    "401": {
                        "description": "Bad Request"
                    },
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "$ref": "#/definitions/Rheem.ResourceInterfaceTypes.PersonMenuType"
                        }
                    }
                },
                "security": []
            }
        }
    },
    "securityDefinitions": {
        "rheem_auth": {
            "type": "oauth2",
            "authorizationUrl": "http://auth.myrheem.com/v1/oauth/authorize",
            "flow": "implicit",
            "scopes": {

            }
        }
    },
    "definitions": {
        "Rheem.ResourceInterfaceTypes.PersonMenuItem": {
            "properties": {
                "Label": {
                    "type": "string"
                },
                "URL": {
                    "type": "string"
                },
                "Target": {
                    "type": "string"
                },
                "MenuCSS": {
                    "type": "string"
                },
                "BreadCrumbDisplay": {
                    "type": "string"
                },
                "IncludeInBreadCrumb": {
                    "type": "boolean"
                },
                "menuNextLevel": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Rheem.ResourceInterfaceTypes.PersonMenuItem"
                    }
                }
            }
        },
        "Rheem.ResourceInterfaceTypes.PersonMenuType": {
            "properties": {
                "MenuLevel": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Rheem.ResourceInterfaceTypes.PersonMenuItem"
                    }
                }
            }
        }
    }
}
@webron
Copy link
Contributor

webron commented Nov 26, 2014

@fehguy - it seems that only direct references are currently parsed (that is Cat instead of #/definitions/Cat). There's a whole set of possible problems with supporting direct references, and we'd probably want to not support it at all.

There's a discussion on it here - OAI/OpenAPI-Specification#135

@fehguy
Copy link
Contributor

fehguy commented Nov 26, 2014

@webron yes that is a bug in the js library. I'll see that it is fixed for #/definitions/Cat and we can wait for the resolution on canonical references. I'll have to review that issue before I can comment on it--it seems we went through this dance during the 2.0 spec development.

@fehguy
Copy link
Contributor

fehguy commented Nov 26, 2014

we can open a different issue with the removal of direct references.

@fehguy fehguy closed this as completed Nov 26, 2014
fehguy added a commit to swagger-api/swagger-ui that referenced this issue Nov 26, 2014
jessekoska pushed a commit to jessekoska/SwaggerLume that referenced this issue Aug 7, 2016
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this issue Aug 18, 2016
JuanSW18 pushed a commit to Digital-Paw/digital-paw-swagger-ui that referenced this issue Aug 23, 2024
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

3 participants