ajv-validator / ajv-validator/ajv

$data support for minContains/maxContains

Offen
#2,130 0 Kommentare 0 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

**What version of Ajv you are you using?**
8.11
**What problem do you want to solve?**
It would be good: minContains/maxContains keywords to be supported by the $data proposal
According to the docs

> $data reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems.

This yet doesn't include minContains/maxContains.

**What do you think is the correct solution to problem?**
Implement support for $data in minContains/maxContains keywords.
For example:
```typescript
{
"type": "object",
"properties": {
"data": {
"type": "array",
"contains": {
"properties": {
"foo": {
"const": "bar"
}
}
},
"minContains": {
"$data": "1/params/min_contains"
}
},
"params": {
"type": "object",
"properties": {
"min_contains": {
"type": "integer"
}
}
}
}
}

```
**Will you be able to implement it?**
Not sure, I'm quite new to this.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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