When working with JSON Schema, one of the challenges I have faced is the limitation on supporting ‘double’ and ‘float’ types for numeric values. While using AJV in JavaScript to validate a schema, it fails due to this restriction. Is there a way to specifically validate these double and float types?
It should be noted that my goal is to validate two main things - 1. The JSON schema itself 2. The JSON data against the defined schema
However, I am currently experiencing difficulties with the first step.
I have attempted to add a custom keyword in AJV, but it doesn't quite match up with the default type validation process.
For instance, my schema includes:
"lineSpacing": {
"type": "double",
"description": "Spacing between two lines"
},
The AJV compilation does not seem to accept ‘double’ as a valid type. How can this issue be resolved? Am I overlooking a very basic concept? Any alternative solutions or suggestions in other programming languages would also be appreciated.