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

#1892 infinite loop when rendering self-references #1902

Merged
merged 2 commits into from
Jan 23, 2016
Merged

#1892 infinite loop when rendering self-references #1902

merged 2 commits into from
Jan 23, 2016

Conversation

bodnia
Copy link
Contributor

@bodnia bodnia commented Jan 21, 2016

Fixed

@bodnia
Copy link
Contributor Author

bodnia commented Jan 22, 2016

@Cwallice fixed bodnia@db32835

@fehguy
Copy link
Contributor

fehguy commented Jan 22, 2016

I'm seeing a regression in rendering the responses in XML. For the spec below, I'm seeing the element names missing in the response section:

image

{
  "swagger": "2.0",
  "info": {
    "description": "This is a sample server Petstore server.  You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger.  For this sample, you can use the api key \"special-key\" to test the authorization filters",
    "version": "1.0.0",
    "title": "Swagger Petstore",
  },
  "basePath": "/v2/api",
  "paths": {
    "/pet/{petId}": {
      "get": {
        "tags": [
          "pet"
        ],
        "operationId": "getPetById",
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "petId",
            "in": "path",
            "description": "ID of pet that needs to be fetched",
            "required": true,
            "type": "integer",
            "format": "int64"
          }
        ],
        "responses": {
          "404": {
            "description": "Pet not found"
          },
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/Pet"
            }
          },
          "400": {
            "description": "Invalid ID supplied",
            "schema": {
              "$ref": "#/definitions/ApiResponse"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "User": {
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "username": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "userStatus": {
          "type": "integer",
          "format": "int32",
          "description": "User Status"
        }
      },
      "xml": {
        "name": "User"
      }
    },
    "Category": {
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      },
      "xml": {
        "name": "Category"
      }
    },
    "Pet": {
      "required": [
        "name",
        "photoUrls"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "category": {
          "$ref": "#/definitions/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": "#/definitions/Tag"
          }
        },
        "status": {
          "type": "string",
          "description": "pet status in the store"
        }
      },
      "xml": {
        "name": "Pet"
      }
    },
    "Tag": {
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      },
      "xml": {
        "name": "Tag"
      }
    },
    "ApiResponse": {
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "type": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}

@fehguy
Copy link
Contributor

fehguy commented Jan 22, 2016

@bodnia it also seems like the shebang is having troubles still. Please see image below, clicking the collapse on an operation clears the whole path

shebang

@fehguy fehguy merged commit db32835 into swagger-api:master Jan 23, 2016
@fehguy
Copy link
Contributor

fehguy commented Jan 23, 2016

@bodnia I've merged this since the issue above was present before, and this fixes the recursion loop.

@bodnia
Copy link
Contributor Author

bodnia commented Jan 25, 2016

@fehguy As per #1902 (comment) it works exactly as on http://petstore.swagger.io/#/
Should this behaviour be changed?

@fehguy
Copy link
Contributor

fehguy commented Jan 26, 2016

master is behaving now, but I did make a change in the commit: 48ad679

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

Successfully merging this pull request may close these issues.

2 participants