You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to add a validation endpoint to the InspireHEP service to validate different types of records, specifically for author workflows. The endpoint should accept a record as a payload and validate it according to the specified type.
TECH NOTES
Add a new endpoint in the class AuthorWorkflowViewSet(viewsets.ViewSet) located here.
The endpoint should be a POST request to /api/workflows/authors/validate.
The endpoint should receive a record as the payload and perform validation using the get_validation_errors method from the inspire_schemas.utils package (ensure inspire_schemas is installed). You can reference the usage of this method in the record class here.
Integrate the validation check when creating or updating an author workflow.
Update the record editor to use this new endpoint instead of the existing /validate_workflow endpoint for author submissions.
Expected Behavior:
If the record validation fails, the endpoint should respond with a 400 status code and include a payload of errors.
If the validation passes, the endpoint should respond with a 200 status code.
Acceptance Criteria:
Endpoint /api/workflows/authors/validate is implemented and functional.
Endpoint correctly validates records based on their type.
Returns 400 with validation errors if validation fails.
Returns 200 if validation is successful.
Validation check is added for create/update operations in author workflows.
The record editor is updated to use the new validation endpoint.
Unit tests are written for the new endpoint to ensure proper validation behavior.
The text was updated successfully, but these errors were encountered:
We first have to make some changes to inspire-schemas 🫠 pyyaml and urllib3 versions need to be bumped in order to use it in inspire backoffice.
They needed changes are included in: inspirehep/inspire-schemas#465
We need to add a validation endpoint to the InspireHEP service to validate different types of records, specifically for author workflows. The endpoint should accept a record as a payload and validate it according to the specified type.
TECH NOTES
/api/workflows/authors/validate
.get_validation_errors
method from theinspire_schemas.utils
package (ensure inspire_schemas is installed). You can reference the usage of this method in the record class here.Expected Behavior:
Acceptance Criteria:
The text was updated successfully, but these errors were encountered: