I would like to apply an additional "required" property in an array sub schema based on the presence of a property in the root schema. I have my schema set like this: { "$schema": "http://json-schema.org/draft-07/schema#"...
I have this class where I try to instantiate Ajv with the new keyword and I get this error: TypeError: Ajv is not a constructor Code: import * as Ajv from "ajv"; export class ValidateJsonService { validateJson(json, schema...
Functions returns object which looks something like this: { "answer": { "vehicle_type": 1, "message": "Car" }, "model": "VW", "color":...
I am deciding on a validation library that I can use for both client and server side validation. I have been comparing JOI (+ joi-browser) and AJV. As I understand it JOI and AJV can accomplish the same things. AJV can even perform async validation...
Here's my JSON Schema: { "required": [ "username", "password", "confirmPassword" ], "properties": { "username": { "minLength": 3, "type": "stri...
I am trying to create conditional validation using if / then / else keywords from ajv-keywords, however I am getting the following error in my browser console: “Uncaught Error: Keyword if is already defined”. What am I doing wrong? import * as...
I want to add conditionally required based on value of some other property. 'companyName' and 'companyAddress' should be required only if 'isInexperienced' value is false. Schema { "type": "object", "...
I need to get a list of the required fields out of a JSON-Schema+Data. Currently, we are using AJV to get error messages in our forms with JSON Schema and it is working great. I need a way to get all the required fields (even if filled) in order to...
I'm evaluating using JSON Schema for validating form data. I can use it to validate my form data when you click submit using AJV and then check it again on the server using a PHP implementation of JSON Schema. That part sounds great, but I'...
I have an AJV schema like this: // schema.js module.exports = { title: 'task', description: 'A Task Schema', type: 'object', properties: { object_city: { title: 'City', type:'string'...
©2020 All rights reserved.