We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context : Validate input data with Ajv
Request.Body
{ "type":"FeatureCollection", "features":[ { "type":"Feature", "geometry":{ "type":"Point", "coordinates":[ 102, 0.5 ] }, "properties":{ "prop0":"value0" } }, { "type":"Feature", "geometry":{ "type":"LineString", "coordinates":[ [ 102, 0 ], [ 103, 1 ], [ 104, 0 ], [ 105, 1 ] ] }, "properties":{ "prop0":"value0", "prop1":0 } }, { "type":"Feature", "geometry":{ "type":"Polygon", "coordinates":[ [ [ 100, 0 ], [ 101, 0 ], [ 101, 1 ], [ 100, 1 ], [ 100, 0 ] ] ] }, "properties":{ "prop0":"value0", "prop1":{ "this":"that" } } } ] }``` **Schema generated from the request.body** ```json { "$id":"http://json-schema.org/draft-04/schema#", "$schema":"http://json-schema.org/draft-04/schema#", "title":"Product", "type":"object", "properties":{ "type":{ "type":"string" }, "features":{ "type":"array", "items":{ "type":"object", "properties":{ "type":{ "type":"string" }, "geometry":{ "type":"object", "properties":{ "type":{ "type":"string" }, "coordinates":{ "type":"array", "items":{ "oneOf":[ { "type":"number" }, { "type":"number" }, { "type":"number" }, { "type":"number" }, { "type":"number" } ], "type":"array" } } } }, "properties":{ "type":"object", "properties":{ "prop0":{ "type":"string" }, "prop1":{ "type":"object", "properties":{ "this":{ "type":"string" } } } } } }, "required":[ "type", "geometry", "properties" ] } } } }
Schema validation with Ajv
[ { keyword: 'type', dataPath: '.features[0].geometry.coordinates[0]', schemaPath: '#/properties/features/items/properties/geometry/properties/coordinates/items/type', params: { type: 'array' }, message: 'should be array' } ]
Why Ajv detects an issue ?
Thx
The text was updated successfully, but these errors were encountered:
See link : https://gist.github.com/ThomasG77/d9c04724e63f3d327bd3ff7534bc0968
Sorry, something went wrong.
No branches or pull requests
Context : Validate input data with Ajv
Request.Body
Schema validation with Ajv
Why Ajv detects an issue ?
Thx
The text was updated successfully, but these errors were encountered: