philosowaffle / vs-openapi-designer

OpenApi Designer Extension for VS Code
https://marketplace.visualstudio.com/items?itemName=philosowaffle.openapi-designer
GNU General Public License v3.0
15 stars 2 forks source link

Fragile relative paths #1

Closed philosowaffle closed 6 years ago

philosowaffle commented 6 years ago

The following $ref breaks: '../../index.yaml/#/definitions/clientExceptionResponse' when used on several files.

Refs that work:

index.yaml

swagger: "2.0"
info:
  version: "1.0"
  title: "Example"

host: "example.com"
basePath: "/api"

schemes:
- "https"

paths:
  /endpointA:
    $ref: '/paths/account/endpointA.yaml'
  /endpointB:
    $ref: '/paths/user/endpointB.yaml'

definitions:
  exceptionResponse:
    $ref: '/definitions/exceptionResponse.yaml'

Endpoints A&B reference exceptionResponse using: ../../index.yaml/#/definitions/clientExceptionResponse

Works for one, but not for the other.

philosowaffle commented 6 years ago

Possibly a non-issue, appears to work fine when ref is corrected to: '../../index.yaml#/definitions/clientExceptionResponse'

Edit: spoke too soon, definitely still an issue.

philosowaffle commented 6 years ago

Seems to break when more than one endpoint makes this reference.

philosowaffle commented 6 years ago

Thinking of switching to this tool instead, however having some trouble getting it working. Logged issue.

philosowaffle commented 6 years ago

https://github.com/philosowaffle/vs-openapi-designer/pull/2