Configuring the JSON Schema validator
Configuring the JSON Schema specification
If you do not configure anything, miyagi uses the default of AJV, which is currently draft-07.
If you want to change this to e.g. draft-2012, you can do that by importing the correct AJV dist and adding it to your config export:
// .miyagi.js
import { Ajv2020 } from "ajv/dist/2020.js";
/* … */
export default {
/* … */
schema: {
ajv: Ajv2020,
},
};
Configuring options
miyagi uses Ajv for validating your mock data against JSON schema files.
If you want to configure Ajv, please refer to the the Ajv options on its website.
You can pass these options via config.schema.options.