Include pattern regular expression in JSON schema for properties that contain UUIDs

Description

Please include pattern properties with a regular expression for validating id properties that contain UUID values as is done in other modules. For example, the metadata JSON schema has the following:

For example, the following in the instance JSON schema

should be

Similarly, include "format": "date-time" for date/time values such as

I.e. do the same thing the metadata JSON schema does.

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Marc JohnsonAugust 10, 2020 at 10:19 AM

You are correct that this has not been fully resolved. Unfortunately, changes have been made and were included in a release, that means the issue needs to be closed. Another can be opened for subsequent work.

Jon MillerAugust 7, 2020 at 7:30 PM

I don't think this issue was ever fully resolved. I was just looking at some of the JSON schemas in the Inventory module and it didn't take long to find several fields that are still missing UUID regex validation patterns. For example, right off the top, the item schema is missing one on the id property and the holdingsRecordId property.

Niels Erik NielsenJuly 10, 2019 at 1:08 PM

Resolved on slack channel. We are going with the pattern match everywhere.

Niels Erik NielsenJuly 10, 2019 at 12:55 PM
Edited

RMB already fails records where the 'id' column is not a UUID.

The response is of type text with the code HTTP_BAD_REQUEST (400) and the message "ID must be a UUID".

I cannot readily decide whether to keep this particular check as is or change it to the UUID pattern check that I'm applying to all other UUIDs in the JSON (the foreign keys basically)

The UUID pattern check response is of type JSON with response code 422 (unprocessable entity) and the message

Which is better?

Niels Erik NielsenJuly 2, 2019 at 11:41 AM

The stricter validation pattern from FOLIO-2034 was applied for mod-inventory-storage/instance-note-types instead. Relaxing it later, ie once a cross-module decision on the desired pattern has been made, would be non-breaking.

https://github.com/folio-org/mod-inventory-storage/blob/master/ramls/uuid.json

Done

Details

Assignee

Reporter

Priority

Development Team

Thunderjet

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created June 19, 2019 at 7:28 PM
Updated August 10, 2020 at 6:12 PM
Resolved November 28, 2019 at 4:27 PM
TestRail: Cases
TestRail: Runs