ajv-validator / ajv-validator/ajv
Incomplete documentation for validateSchema method in _KeywordDef?
- Ngôn ngữ chính
- TypeScript
- Star
- 14.8k
- Fork
- 1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.