phpinnacle / intellij-redoc

IntelliJ OpenAPI 3.0 documentation renderer
MIT License
8 stars 1 forks source link

Doesn't support external file references #5

Open rajpaulbagga opened 5 years ago

rajpaulbagga commented 5 years ago

Would love to make use of this plugin. But...

Detailed description

It fails when the spec file has references to other files. I get a 404 in the window looking for the child file using its absolute path.

Context

OpenAPI specs may be split across multiple files with references to other files to fill in, for example, schema. E.g. something like this swagger 2.0 yaml snippet:

path:
  /invitations:
    get:
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: "email"
          in: query
          type: string
          description: "Email address of invitee"
          required: false
      responses:
        200:
          description: "Matching Invitations"
          schema:
            $ref: 'some-other-openapi-schema-files.json'

This would result in a failure like this when switching to the Redoc view:

Something went wrong...

Error downloading http://localhost:64338/Users/rbagga/git/my/absolute/path/to/some-other-openapi-schema-files.json HTTP ERROR 404

Stack trace

ReDoc Version: 2.0.0-rc.12 Commit: 36ebbb1

Your environment

IntelliJ 2019.2.3 Redoc plugin 0.3 MacOS Mojave 10.14.6

DoooMer commented 4 years ago

Same problem on PhpStorm 2020.1.3 Redoc plugin 0.3 Ubuntu 18.04.4