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

Empty response gives "Cannot read property '$ref' of undefined" #608

Closed
flixx opened this issue Aug 15, 2018 · 0 comments
Closed

Empty response gives "Cannot read property '$ref' of undefined" #608

flixx opened this issue Aug 15, 2018 · 0 comments

Comments

@flixx
Copy link

flixx commented Aug 15, 2018

I have this in my openapi.yaml:

delete:
  tags:
    - Service Panel
  parameters:
    - $ref: '../../../common/parameters.yaml#/service_id'
    - $ref: '../../../common/parameters.yaml#/voucher_id'
  responses:
    204:
      description: Delete voucher
      content:
        application/json: {}

This is valid openapi 3.0 according to swagger-cli and openapi-spec-validator.

When I try to run reDoc, I get:

Cannot read property '$ref' of undefined
Stack trace
TypeError: Cannot read property '$ref' of undefined
    at e (http://127.0.0.1:8080/redoc.standalone.js:68:24962)
    at Object.n.sample (http://127.0.0.1:8080/redoc.standalone.js:68:20507)
    at e.generateExample (http://127.0.0.1:8080/redoc.standalone.js:111:40203)
    at new e (http://127.0.0.1:8080/redoc.standalone.js:111:39744)
    at http://127.0.0.1:8080/redoc.standalone.js:111:40529
    at Array.map (<anonymous>)
    at new e (http://127.0.0.1:8080/redoc.standalone.js:111:40478)
    at new e (http://127.0.0.1:8080/redoc.standalone.js:111:41426)
    at http://127.0.0.1:8080/redoc.standalone.js:111:43638
    at Array.map (<anonymous>)

ReDoc Version: 2.0.0-alpha.36 
Commit: e0d82f4

When I remove the empty response, everything works fine:

delete:
  tags:
    - Service Panel
  parameters:
    - $ref: '../../../common/parameters.yaml#/service_id'
    - $ref: '../../../common/parameters.yaml#/voucher_id'
  responses:
    204:
      description: Delete voucher
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

1 participant