analysispreservation.cern.ch icon indicating copy to clipboard operation
analysispreservation.cern.ch copied to clipboard

deposits/schemas: validate data without saving to db

Open pamfilos opened this issue 3 years ago • 2 comments

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

pamfilos avatar Nov 07 '22 13:11 pamfilos

Breaking out the tasks in steps:

  1. Create a endpoint in schema module to have basic schema validation (DRAFT4Validator)
  2. Replicate the deposit creation just before the deposit getting saved into db.
  3. Create a action for validation of schema in deposits module.

ParthS007 avatar Nov 08 '22 09:11 ParthS007

The deposit creation does following checks:

  1. User Authentication Check
  2. Metadata check (schema/ana_type)
  3. JSONschema validation (modifying and permission control)
  4. Indexing ..

ParthS007 avatar Nov 14 '22 13:11 ParthS007