ajv-formats icon indicating copy to clipboard operation
ajv-formats copied to clipboard

uri-reference ?

Open seriousme opened this issue 4 years ago • 0 comments

hi,

The current format for uri-reference declares a fragment like #/paths/~1{id}/get/responses/404 invalid. The fragment is considered valid if the curly braces are percent encoded as %7B and %7D.

I use AJV to validate openApi specs, and out of about 2300 real world specs about 7 fail because they have uri-reference with curly braces.

RFC 3986 is not very strict on what to encode and what not. The What-wg url spec is more formal and states:

The C0 control percent-encode set are the C0 controls and all code points greater than U+007E (~).

The fragment percent-encode set is the C0 control percent-encode set and U+0020 SPACE, U+0022 ("), U+003C (<), U+003E (>), and U+0060 (`).

This would allow curly braces as valid.

Should AJV-formats follow the What-wg spec?

Kind regards, Hans

seriousme avatar Jul 10 '21 20:07 seriousme