Create and update endpoints modified to validate MARC record based on MARC specification
Description
Environment
Potential Workaround
Attachments
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
- 08 Oct 2024, 01:52 PM
defines
Checklist
hideActivity
Valery_Pilko October 9, 2024 at 3:33 PM
Hey @Pavlo Smahin - separate ticket created https://folio-org.atlassian.net/browse/MODQM-451
Current story is ready for PO review.
Pavlo Smahin October 9, 2024 at 10:05 AM
@Valery_Pilko it will be helpful!
Valery_Pilko October 9, 2024 at 9:07 AM
@Pavlo Smahin - should I create a ticker for it?
Pavlo Smahin October 9, 2024 at 8:29 AM
Hey @Valery_Pilko, as for your question it’s more tech-dept that existed from time when we implement the authority control feature. I believe we could postpone it.
Valery_Pilko October 8, 2024 at 1:52 PM
Re-tested on Snapshot environment:
Found issues are fixed, user can create and derive new marc bib record, see attached screencast:
User cannot Create/Edit MARC record via API using mod-quick-marc endpoints if record has Fail errors.
See screenshots for example:
No required field:
Multiple not-repeatable fields:
Undefined field:
Invalid field tag:
Invalid indicator:
Undefined indicator:
No required subfield:
Not-repeatable subfield:
Undefined subfield:
Not-repeatable 1XX:
Question:
Hey @Pavlo Smahin , @Svitlana Kovalova - could you please review the question below?
On UI we have validation for cases when linkable (but not linked field) has $9 / linked field has additional $9 added by user
See attached screenshots for example:
Should we have validation for case when user added $9 subfield in linkable field manually on back-end side?
I’m asking because if user added $9 in linkable field manually via API request - record will not be created/updated because of error.
See attached screenshots:"errorMessage": "io.vertx.core.impl.NoStackTraceThrowable: {\"errors\":[{\"message\":\"must match \\\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$\\\"\",\"type\":\"1\",\"code\":\"jakarta.validation.constraints.Pattern.message\",\"parameters\":[{\"key\":\"contributors[0].authorityId\",\"value\":\"test\"}]}]}",
Requirements
Create and update endpoints modified to validate MARC record based on MARC specification
return validation issues only if it has at least one issue with ERROR severity and prevent saving
response body for validation issues should same as in https://folio-org.atlassian.net/browse/MODQM-433
endpoints are:
https://s3.amazonaws.com/foliodocs/api/mod-quick-marc/s/records-editor-async.html#tag/records-editor-async/operation/putRecord
https://s3.amazonaws.com/foliodocs/api/mod-quick-marc/s/records-editor.html#tag/records-editor/operation/createNewRecord
do validation before any other process
Bump major version of API (don’t merge until UI updates it)
Create Karate tests update story