intellij-swagger
intellij-swagger copied to clipboard
Unable to $ref using array index notation
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
Indeed, should be fixed. Thanks for reporting!
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}
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.