HomeSoftware Heritage

Add a validation proxy for _add() methods.

Description

Add a validation proxy for _add() methods.

It converts input dictionaries into swh-model objects, which
validates them and raises an appropriate error.

This removes duplicated validation code that is currently present
in all three storage backends.

It also uses well-defined object types instead of loose dicts,
which gives these _add() methods a more strict type.

Details

Provenance
vlorentzAuthored on Feb 7 2020, 4:35 PM
vlorentzPushed on Feb 10 2020, 12:16 PM
Differential Revision
D2640: Add a validation proxy for _add() methods.
Parents
rDSTO638363763aa8: Unify exception raised by invalid input to API endpoints.
Branches
Unknown
Tags
Unknown
Build Status
Buildable 10518
Build 15682: test-and-buildJenkins