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

Unable to $ref using array index notation #256

Open
GaryGSC opened this issue Apr 2, 2019 · 3 comments
Open

Unable to $ref using array index notation #256

GaryGSC opened this issue Apr 2, 2019 · 3 comments
Labels

Comments

@GaryGSC
Copy link

GaryGSC commented Apr 2, 2019

I have some JSON references using array index notation that are throwing inspection errors. I believe they should be valid according to RFC 6901, where #/foo/0 resolves to "bar".

Here's a minimal example that gives Can not resolve reference '#/x-values/0':

swagger: '2.0'
info:
  version: 1.0.0
  title: Example API
paths:
  /:
    get:
      responses:
        200:
          description: OK
          schema:
            type: string
            example:
              $ref: '#/x-values/0'
x-values:
  - first
  - second

Versions:
WebStorm 2019.1 (build #WS-191.6183.63, from March 21, 2019)
Swagger plugin v1.0.25

@semonte
Copy link
Contributor

semonte commented Apr 3, 2019

Indeed, should be fixed. Thanks for reporting!

@GaryGSC
Copy link
Author

GaryGSC commented Nov 6, 2019

I updated to v1.0.28, which isn't published on GitHub. (?)

Now I get a slightly different error message: Array doesn't contain element with index {0}

@GaryGSC
Copy link
Author

GaryGSC commented Nov 6, 2019

Edit: I get some other error messages, too. They vary now.

A $ref to #/x-values/0/blah now says Property 'blah' not found when blah exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants