Skip to content

Instantly share code, notes, and snippets.

@z0mt3c
Created May 5, 2015 08:15
Show Gist options
  • Save z0mt3c/4a8e5b78d76b20b9ae97 to your computer and use it in GitHub Desktop.
Save z0mt3c/4a8e5b78d76b20b9ae97 to your computer and use it in GitHub Desktop.
Uncaught TypeError: Cannot read property 'test' of undefined
SwaggerUi.Views.OperationView.Backbone.View.extend.showStatus @ index.js:24
SwaggerUi.Views.OperationView.Backbone.View.extend.showCompleteStatus @ index.js:24
9.Operation.execute.obj.on.response @ index.js:568
(anonymous function) @ spec-converter.js:505
111.Request.callback @ index.js:24
(anonymous function) @ index.js:24
112.Emitter.emit @ index.js:24
111.Request.end.xhr.onreadystatechange @ index.js:24
@z0mt3c
Copy link
Author

z0mt3c commented May 5, 2015

{
  "swagger": "2.0",
  "paths": {
    "/any/route": {
      "get": {
        "responses": {
          "default": {}
        },
        "produces": [
          "application/pdf"
        ],
        "tags": [
          "any"
        ]
      }
    }
  },
  "definitions": {},
  "tags": [],
  "info": {
    "title": "Example API",
    "version": "1.0"
  },
  "basePath": "/api"
}

@webron
Copy link

webron commented May 5, 2015

Add this response:

"200": {
            "description": "jwij",
            "schema": {"type": "file"}
          }

@z0mt3c
Copy link
Author

z0mt3c commented May 5, 2015

{
  "swagger": "2.0",
  "paths": {
    "/any/route": {
      "get": {
        "responses": {
          "200": {
            "schema": {
              "type": "file"
            },
            "description": "bla"
          },
          "default": {
            "schema": {
              "type": "file"
            },
            "description": "bla"
          }
        },
        "produces": [
          "application/pdf"
        ],
        "tags": [
          "any"
        ]
      }
    }
  },
  "definitions": {},
  "tags": [],
  "info": {
    "title": "Example API",
    "version": "1.0"
  },
  "basePath": "/api"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment