nullable is not supported
Closed this issue · 1 comments
mknj commented
const Ajvoai = require('ajv-oai')
const ajvoai = new Ajvoai({ coerceTypes: false });
console.log( ajvoai.compile({ type: 'string', nullable: true })(null));
should return true, but returns false
amazing-gao commented
nullable
is false
default. you should enable it.
const Ajvoai = require('ajv-oai')
const ajvoai = new AjvOAI({ coerceTypes: false, nullable: true });
console.log(ajvoai.compile({ type: 'string', nullable: true })(null));
It will as you wish. And you also can see the unit test.