encode / apistar

The Web API toolkit. 🛠
https://docs.apistar.com
BSD 3-Clause "New" or "Revised" License
5.57k stars 411 forks source link

Specifying a Path Item object as ref to external file gives validation error #636

Open matthewhegarty opened 5 years ago

matthewhegarty commented 5 years ago

From my interpretation of the OpenAPI spec, it should be possible to specify a path item as a reference to an external file. For example:

  /pets/{petId}:
    $ref: './pet.yaml'

However, when I try to validate the attached files I get:

$ apistar validate --path petstore.openapi.yaml --format openapi 
* Invalid property name. (At ['paths', '/pets/{petId}', '$ref'], line 57, column 5.)
✘ Invalid OpenAPI schema.

I also raised the same issue in the swagger-editor repo.

I may be mis-interpreting the spec, or doing something else incorrectly, so I would appreciate any guidance.

To reproduce, extract this zip and run the command above