ajv-validator / ajv-validator/ajv-formats

uri-reference ?

Offen
#36 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
228
Forks
42
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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](https://url.spec.whatwg.org/#percent-encoded-bytes):
>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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.