mysociety / popit-api

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
17 stars 3 forks source link

Move popolo validation logic into mongoose models #100

Open chrismytton opened 9 years ago

chrismytton commented 9 years ago

Add explicit validations to the mongoose models rather than having the validation performed by json schemas. This is how django-popolo handles things.

This change would mean less magic going on with the validations, which are currently done in middleware. It would also make it easier to express things like "All memberships must assign values to either member, person, or person_id and to either organization, organization_id, post or post_id."

akuckartz commented 9 years ago

An aside: Validation of a JSON-LD serialisation could use RDFUnit.