swagger-api / swagger-api/swagger.io-docs

Non-encoded $ref on https://swagger.io/docs/specification/using-ref/#escape

Open
#250 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Astro
Stars
1.6k
Forks
407
Avg merge
2m
Merged PRs (30d)
2

Description

On https://swagger.io/docs/specification/using-ref/#escape, there's a section that says:

For example, to refer to the path /blogs/{blog_id}/new~posts, you would use:

$ref: '#/paths/~1blogs~1{blog_id}~1new~0posts'

The / and ~ are encoded to ~1 and ~0 respectively. However, the curly braces around blog_id aren't percent-encoded (RFC3986), and this throws an error on editor.swagger.io:

Screen Shot 2019-08-11 at 11 17 08

The $ref should be #/paths/~1blogs~1%7Bblog_id%7D~1new~0posts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the “Escape” section of the Using $ref documentation at swagger.io/docs/specification/using-ref/#escape and compare its example with RFC3986 and editor.swagger.io behavior. Update the example so the path parameter braces are encoded, then verify that the displayed reference matches the documented escaping rules.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.