How to handle negative value validation in json schema

Hi, I’m facing an issue in schema validation. My response is having a negative value for json key but AJV validation is failing by saying “should be number”. I checked schema and its having type as “number”. Can someone help me validating negative values for any json key?

For schema validation which tool you are using
postman
or any other automation tool??
@vaibhavbarmkar

I’m using AJV lib of postman.

Are you sure the value is coming back as a number and not a string? Is the failing value in quotes?

A simple Schema validation tool, although not always perfect, that I use is https://www.jsonschemavalidator.net/.

Place your schema in the left box and your failing response in the right box.

It will highlight were exactly it is failing and might give some more insight into what is happening.

did you find a solution for this ?

This is a five year old question.

I would recommend creating your own topic, and including an example response, and details of your code for asserting the schema.

ok, thanks. will create my own post.