ajv-validator / ajv-validator/ajv

Retrieve additional properties keys and values

Đang mở
#1,004 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
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ả

Hello,

Is there an easy way to retrieve additional properties ?

```javascript
const Ajv = require('ajv');
const ajv = new Ajv();

const schema = {
"properties": {
"property1": {
"type": "string"
},
"property2": {
"type": "number"
}
},
"additionalProperties": true
}

const data = {
"property1": "Hello!",
"property2": 15,
"property3": "This is an additional property"
}

let validate = ajv.compile(schema)
let valid = validate(data)
```

Can I validate this data, then somehow obtain key & values of additional properties ?

Thanks !

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.