@socketkit/ajv-base64
v1.0.1
Published
Ajv validation for base64 strings
Readme
ajv-base64
Adds a uuid format to Ajv.
Install
npm i --save @socketkit/ajv-base64Setup
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 base64. For example
{
"type": "object",
"properties": {
"field_name": {
"type": "string",
"format": "base64"
}
}
}