@socketkit/ajv-uuid
v1.0.1
Published
Ajv plugin for validating UUID type fields
Downloads
6
Readme
ajv-uuid
Adds a uuid
format to Ajv.
Install
npm i --save @socketkit/ajv-uuid
Setup
import Ajv from 'ajv'
import base64 from '@socketkit/ajv-base64'
const ajv = new Ajv()
base64(ajv)
Usage
When defining your JSON schema, use the format
keyword with ther value set to uuid
. For example
{
"type": "object",
"properties": {
"uuid": {
"type": "string",
"format": "uuid"
}
}
}