ajv-validator / ajv-validator/ajv

Should 'integer' type validate bigint ?

Offen
#1,116 26 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
TypeScript
Sterne
14.8k
Forks
1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This is more of a question than a proposal.

**What problem do you want to solve?**
I want to validate objects containing a bigint.

**What do you think is the correct solution to problem?**
Bigint instance could pass the validation against 'integer' type. This may sound weird as "regular" integer would also pass this validation, and in this way the "type" isn't really validated. But the JSON specifications do not impose a limit on the range of integers.

The other solution would be to extend the types to include BigInt.
Thanks for your answer.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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