Fail to import record due to classificationTypeId mapping error
branchedelac opened this issue · comments
Fail to import record https://libris.kb.se/katalogisering/6j9dkng34248xnw6
Part of the error message reads:
REASON: StatusCodeError: 422 - {"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":"-1","parameters":[{"key":"classifications[0].classificationTypeId","value":"sudoc-identifier"}]}]}(node:17272) UnhandledPromiseRejectionWarning: StatusCodeError: 422 - {"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":"-1","parameters":[{"key":"classifications[0].classificationTypeId","value":"sudoc-identifier"}]}]}at new StatusCodeError
Here is the record we are trying to send to FOLIO:
"classifications":[{"classificationNumber":"HI.F 3/178-8:N 67/2019","classificationTypeId":"sudoc-identifier"}]
Note that classificationTypeId is not an actual FOLIO ID, but just ... text. I thougth we had a catch-all type, will check.
Created Classification type Government Document Classification Number in FOLIO Settings, and added the identifier to the code (renaming SuDOC to the slightly more comprehensive Government Document Classification Number.)