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

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

Closed
devjack opened this issue Oct 20, 2018 · 3 comments
Closed

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

devjack opened this issue Oct 20, 2018 · 3 comments

Comments

@devjack
Copy link

devjack commented Oct 20, 2018

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

@devjack
Copy link
Author

devjack commented Oct 20, 2018

I've verified that the bug was introduced between 0.7.3 and 0.8.0, likely (?) with the introduction of oas-kit.

@philsturgeon
Copy link
Contributor

@devjack looks like Mike is helping you out over on oas-kit. How's it going?

@philsturgeon
Copy link
Contributor

Fixed in #198!

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

2 participants