You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When autocompletion of components.pathItems.pathItem1.$ref is performed, the '#/paths//path/segment1/segment2' will be suggested and inserted. That's incorrect, because the text should be inserted in JSON Pointer encoded form: '#/~1paths~1path~1segment1~1segment2'.
NOTE: also notice that there are two un-escaped backslashes instead of one: '#/paths//path/segment1/segment2'
To reproduce...
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
Expected behavior
Suggestion shows unescaped form of the future inserted text, but the insertion will insert properly JSON Pointer encoded text.
Ran into this as well for $ref inside of a Webhook.
Both the suggestion and the completion have an unescaped / which also resolves (i.e., works even though it should not).
Expected: #/paths/~1foo/ got #/paths//foo.
Update: If I manually type out the $ref it does not resolve!
Uh oh!
There was an error while loading. Please reload this page.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
When autocompletion of
components.pathItems.pathItem1.$ref
is performed, the'#/paths//path/segment1/segment2'
will be suggested and inserted. That's incorrect, because the text should be inserted in JSON Pointer encoded form:'#/~1paths~1path~1segment1~1segment2'
.To reproduce...
Steps to reproduce the behavior:
Expected behavior
Suggestion shows unescaped form of the future inserted text, but the insertion will insert properly JSON Pointer encoded text.
Screenshots
Additional context
Note that
apidom-json-pointer
package contains all the tooling needed to implement this fix: https://github.com/swagger-api/apidom/blob/main/packages/apidom-json-pointer/README.md#escapingThe text was updated successfully, but these errors were encountered: