ajv Questions

5

Solved

I'm stumbling on an error every time I run npm run build error: /node_modules/mini-css-extract-plugin/node_modules/schema-utils/dist/validate.js:66 const ajv = new Ajv({ ^ TypeError: Ajv is not a...
Pannier asked 14/2, 2022 at 11:45

8

Solved

I am getting three warning messages when importing request in a barebone webpack project. A minimal example to reproduce the bug is available on GitHub (run npm install and npm start). Critical de...
Antemortem asked 20/3, 2017 at 15:50

4

Solved

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 ValidateJsonSe...
Jawbone asked 8/2, 2017 at 1:54

2

I am trying to validate array of objects using AJV schema validation. Below is the sample code var Ajv = require('ajv'); var schemaValidator = Ajv(); var innerSchema = { "type" : "object", "prope...
Onfroi asked 23/5, 2017 at 11:23

1

I'm having trouble getting this line to resolve at the top of my JSON Schema when compiling it with AJV: "$schema": "node_modules/ajv/lib/refs/json-schema-draft-04#" I've also tried this line to ...
Balanced asked 5/12, 2018 at 17:2

4

I have TypeScript NestJS project. I need to validate incoming DTO to my API. It can be described as "creating of project" where we have type of building (House, Flat, Garden) and depending on that...
Alcaic asked 14/2, 2020 at 10:3

4

I have an object which contains one or more properties of type date. I would like to validate the object using the ajv json schema validator package. I could convert the properties of type date to ...
Onia asked 4/4, 2019 at 16:42

3

Solved

I'm trying to validate a string(Phone number) with this regex ^+[0-9]{9,12}$ but I get this error ... .pattern should match format "regex" ... I've been through the documentation at https://ajv....
Priester asked 5/6, 2020 at 15:43

3

Assuming I have the schema & JSON: JSON Schema: const schema = { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": [ "countries" ], "definitions": { "eu...
Sailfish asked 3/4, 2020 at 16:57

2

Solved

I want to validate a JSON against a JSON schema with Ajv in JavaScript. I get the error: throw new it.MissingRefError(it.baseId, $schema, $message); ^ Error: can't resolve reference #/definitions...
Burck asked 16/4, 2019 at 10:50

6

Solved

I am using Ajv for validating my JSON data. I am unable to find a way to validate empty string as a value of a key. I tried using pattern, but it does not throw appropriate message. Here is my sch...
Vidar asked 25/8, 2017 at 19:50

1

Solved

I'm using ajv and want to add a custom validator inspecting a given object. This custom validator should either return true or fail with the correct error message. Based on (deprecated syntax) AJV...
Julio asked 30/3, 2022 at 7:52

0

Using ajv v8.6.3 nodejs and typescript Trying to parse JSON however I am getting this Error: strict mode: unknown keyword: "$schema" anyone shed some light on this? export const mySchema ...
Tarantella asked 11/10, 2021 at 13:0

1

Solved

To give some background, I am trying to add proper schema validation error message formatting (to sugercoat the validation errors) for AJV JSON Schema Validation. I am using Fastify middleware. My ...
Bagworm asked 26/7, 2021 at 6:19

1

I am using AJV library https://github.com/ajv-validator/ajv to validate the input of my nodejs express api. However, im having trouble extracting the property name in question for each error object...
Raceway asked 19/7, 2021 at 13:50

1

I have been experimenting with ajv-cli and trying to make it to verify a json scheme that makes use of standard formats like "ipv4" and "host-name". Despite of having ajv-format...
Coulson asked 24/2, 2021 at 17:24

2

i was exploring Ajv with ajv-errors for validating json schema and producing custom error messages. everything works as of now but i can't set custom error message for type for individual values. ...
Flooded asked 10/3, 2018 at 18:41

5

I need to validate some object in my NodeJS app. I have already used an awesome library express-validator, it works perfectly, but now I need to validate different object, not only requests and as ...
Embryo asked 25/6, 2017 at 12:50

0

Is there any way to load a json schema in AJV with URL. I was using this code to load a json schema from mockable.io. var ajv = new Ajv({ loadSchema: loadSchema }); ajv.compileAsync("http://demo3...
Sleuth asked 12/11, 2019 at 2:50

1

Solved

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-sc...
Pleasurable asked 22/7, 2019 at 7:55

1

I'm trying to use AJV with the below code, when I validate an object with multiple errors, AJV throws only one error at a time. const schema = { type: 'object', properties: { name: {type...
Patricide asked 29/5, 2019 at 16:25

1

There was an answer to similar question but that was too specific to an example and doesn't answer in general. Can any one please tell how to handle the below scenario if models are not versioned?...
Alpestrine asked 25/5, 2019 at 10:29

4

Solved

I just created a new React application using this command: create-react-app mysite.com After installation, when I tried to open it using npm start and yarn start, I got the following error. t...
Phenacetin asked 9/2, 2019 at 23:10

1

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 th...
Seating asked 17/1, 2019 at 3:21

1

Solved

Problem: After I upgraded AJV.js to Version 6.4 my vendor bundle includes the "uri-js" ESNEXT version instead the ES5 version what breaks IE11 compatibillity. Analysis: I figured that that AJV r...
Goggles asked 16/5, 2018 at 6:57

© 2022 - 2025 — McMap. All rights reserved.