Skip to content

[develop 2.0] Issue with $ref generation #816

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
webron opened this issue Jan 12, 2015 · 2 comments
Closed

[develop 2.0] Issue with $ref generation #816

webron opened this issue Jan 12, 2015 · 2 comments
Milestone

Comments

@webron
Copy link
Contributor

webron commented Jan 12, 2015

The current pet store example exhibits this issue in three places:

"/user/createWithArray": {

    "post": {
        "tags": [
            "user"
        ],
        "summary": "Creates list of users with given input array",
        "description": "",
        "operationId": "createUsersWithArrayInput",
        "produces": [
            "application/json",
            "application/xml"
        ],
        "parameters": [
            {
                "in": "body",
                "name": "body",
                "description": "List of user object",
                "required": false,
                "schema": {
                    "type": "array",
                    "items": {
                        "$ref": "User"
                    }
                }
            }
        ],
        "responses": {
            "default": {
                "description": "successful operation"
            }
        }
    }
}
"Pet": {

    "required": [
        "name",
        "photoUrls"
    ],
    "properties": {
        "id": {
            "type": "integer",
            "format": "int64"
        },
        "category": {
            "$ref": "Category"
        },
        "name": {
            "type": "string",
            "example": "doggie"
        },
        "photoUrls": {
            "type": "array",
            "xml": {
                "name": "photoUrl",
                "wrapped": true
            },
            "items": {
                "type": "string"
            }
        },
        "tags": {
            "type": "array",
            "xml": {
                "name": "tag",
                "wrapped": true
            },
            "items": {
                "$ref": "Tag"
            }
        },
        "status": {
            "type": "string",
            "description": "pet status in the store"
        }
    },
    "xml": {
        "name": "Pet"
    }
}

In the two snippets above, User, Category and Tag are referenced without the preceding #/definitions/ as required, while other occurrences in the spec are fine.

@webron webron added this to the v1.5.0-M1 milestone Jan 12, 2015
@webron
Copy link
Contributor Author

webron commented Jan 12, 2015

Looks like it's related to #815 - either it's not deployed yet to the pet store sample, or it's not fully fixed.

@fehguy
Copy link
Contributor

fehguy commented Jan 20, 2015

verified in tests and deployed to http://petstore.swagger.wordnik.com/v2/swagger.json

@fehguy fehguy closed this as completed Jan 20, 2015
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