digidem / osm-p2p-server

Peer-to-peer OpenStreetMap API v0.6 Server for osm-p2p-db
BSD 2-Clause "Simplified" License
87 stars 10 forks source link

Schema validation on all request bodies #24

Open gmaclennan opened 8 years ago

gmaclennan commented 8 years ago

We should validate the schema of all requests, to avoid getting corrupt data into the database, and avoiding things like nodes with no lat/lon or out of bounds.

This is easiest to do with the restructure branch since we can do JSON schema validation after the XML is parsed. Looks like ajv is the fastest and most spec compliant validator.