analysispreservation.cern.ch
analysispreservation.cern.ch copied to clipboard
deposits/schemas: validate data without saving to db
Feature request
What is the expected behavior? Create API endpoints e.g
- [x] for
/deposits/<id>/actions/validation - [x] for
/schema/<schema_name[/schema_version]/validate
that will receive data (item OR list) from the request and validate data against schema/deposit_schema
What is motivation or use case for adding/changing the behavior? To be able to test data before sending for update
Breaking out the tasks in steps:
- Create a endpoint in schema module to have basic schema validation (DRAFT4Validator)
- Replicate the deposit creation just before the deposit getting saved into db.
- Create a action for validation of schema in deposits module.
The deposit creation does following checks:
- User Authentication Check
- Metadata check (schema/ana_type)
- JSONschema validation (modifying and permission control)
- Indexing ..