snac-cooperative / snac-openrefine-extension

OpenRefine extension for connecting with SNAC
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Validate EntityType #5

Open glassjoseph opened 3 years ago

glassjoseph commented 3 years ago

We've had requests to validate allowed types of CPF and Resource.

On the one hand, it would be a straightforward safety check that could run on a schema save and warn editors in the Issues page. On the other hand, we should consider how much client-side validation the extension should handle, or if it is better to rely more on the API for error handling. If the latter, the API error handling on incorrect CPF entityType should be improved, as it currently returns an html xdebug warning. Warning: pg_execute(): Query failed: ERROR: null value in column "entity_type" violates not-null constraint

deternitydx commented 3 years ago

Interesting. I think we should update the validation engine on the server to check for entity type, even if we do add that validation on the OpenRefine client side. I would like to stop any non-JSON error messages before they make it out to the user.