mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

Don't allow empty identifiers #103

Open graft opened 5 years ago

graft commented 5 years ago

Somehow it is possible to create records with no identifiers or empty identifiers. Since all records are currently created using the /update API, the culprit must lie there.

Magma should refuse to create records with empty identifiers; in this case the /update endpoint should simply ignore the attempt to create a null identifier. In general for an identifier field a 'null' entry should cause a validation error.

graft commented 4 years ago

Not all records are created using the /update API - some are created using loaders, so there might also be a source of empty identifiers. In any case since both use the same validation mechanism, refusing a 'null' or 'empty' identifier in the validation step should suffice.