Closed hkosova closed 6 years ago
Swagger-Client's $ref plugin is causing this, by being too tolerant in processing JSON Pointers.
I've added a failing test to a branch: https://github.com/shockey/swagger-js/commit/445597b1ead7a711025064f0869b5733a52debf2
We can do any of the following:
Should be fixed.
This is related to https://github.com/swagger-api/swagger-editor/issues/1560
Demonstration API definition
See https://github.com/swagger-api/swagger-editor/issues/1560.
Expected Behavior
Misspelled references
'#definitions/Pet'
,'#parameters/foo'
etc. (with missing/
after the#
) should NOT be successfully resolved.Current Behavior
Misspelled references are successfully resolved and rendered by UI.
Context
According to the JSON Reference syntax and JSON Pointer RFC 6901, local references should be in the format
#/foo/bar
with/
after the#
:Thus,
#definitions/...
without/
after the#
is an error and should NOT be resolved successfully.