ajv-validator / ajv-validator/ajv

Incomplete documentation for validateSchema method in _KeywordDef?

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

Beschreibung

I want to implement a keyword called `order` for `object` schema type. However, I can't access the `object` schema in `validateSchema` function.

**What version of Ajv are you using? Does the issue happen if you use the latest version?**
8.1

**Ajv options object**

```javascript

```

**JSON Schema**

```json
{
type: 'object',
properties: {
name: {
type: 'string'
},
age: {
type: 'integer'
}
},
order: ['name', 'age'],
required: ['name', 'age']
}
```

**Sample data**

```json
{ name: 'test', age: 10 }
```

**Your code**

```javascript
ajv.addKeyword({
keyword: 'order',
type: 'object',
schemaType: 'array',
});
```

**Validation result, data AFTER validation, error messages**

```

```

**What results did you expect?**
I wanted to be able to use `validateSchema` to look at my `object`'s `properties` to validate my keyword schema. Specifically to verify that the strings inside `order` keyword to be the `properties` in the object.

**Are you going to resolve the issue?**
No, I can't

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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