openapi-snippet icon indicating copy to clipboard operation
openapi-snippet copied to clipboard

Add swagger escape character https://swagger.io/docs/specification/u…

Open apilabeyes opened this issue 3 years ago • 1 comments

…sing-ref/

apilabeyes avatar Feb 15 '22 07:02 apilabeyes

@apilabeyes Thanks for the PR. Would you mind adding a test case for this behaviour also?

Consider also that escaping should only take place in the parts of a reference that uses these characters literally. Like in the official example, the reference to path path /blogs/{blog_id}/new~posts becomes $ref: '#/paths/~1blogs~1{blog_id}~1new~0posts' after escaping. So there are still slashes and tildes left in the final reference string. Does your implementation account for that?

ErikWittern avatar Feb 15 '22 08:02 ErikWittern