Skip to content

back-$ref's in a referenced file no longer resolve in speccy 0.8.x #185

@devjack

Description

@devjack

If openapi.yml $ref's otherfile.yml, $ref's in otherfile.yml do not resolve.

Detailed description

To reproduce, I ran speccy 0.7.3 and 0.8.4 over the same Open API definition.

This screenshot shows that speccy 0.7.3 resolves the $ref from ping.yml to openapi.yml and 0.8.4 does not (it produces an empty object instead).

screen shot 2018-10-20 at 11 41 08

Context

I define each URL/verb combination as an endpoint and all responses as JSON Schema and use speccy to combine/resolve between the relevant files and formats. An example of this usage is in this example Open API definition (see the npm scripts for speccy cli usage).

Example

File: openapi.yml

...
paths:
    /ping:
       $ref: "endpoints/ping.yml#/paths/~1ping"

...

components:
    schemas:
        ping:
            $ref: 'schemas/ping.json'
...

File: endpoint/ping.yml

paths:
    '/ping':
        get:
          responses:
            '200':
              content:
                application/json:
                    schema:
                        $ref: '../openapi.yml#/components/schemas/ping'

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions