Since we are making dataset_type required field on Dataset and Publication at entity creation time, the validator for Publication.dataset_type at both creation via POST call and update via PUT call should be updated to only allow one value publication (case-insensitive).
Currently the same validator of dataset_type is defined for both Dataset and Publication, and the ingest-ui only uses dataset_type == 'Publication' for Publication creation, which is rejected with the following error message:
The solution is for publication creation, we'll let the entity-api always use "Publication", so the ingest-ui code doesn't send over this dataset_type == 'Publication' (@BirdMachine needs to make the corresponding updates in UI code)
To implement:
in the schema yaml, define Publication.dataset_type property as generated: true (so it's not user provided) and immutable: true (so can't be updated). Remove required_on_create: true.
we'll also need a before_create_trigger: set_publication_dataset_type which always uses a fixed value of "Publication" and stores it in Noe4j.
Since we are makingdataset_type
required field on Dataset and Publication at entity creation time, the validator forPublication.dataset_type
at both creation via POST call and update via PUT call should be updated to only allow one valuepublication
(case-insensitive).Currently the same validator of
dataset_type
is defined for both Dataset and Publication, and the ingest-ui only usesdataset_type == 'Publication'
for Publication creation, which is rejected with the following error message:The solution is for publication creation, we'll let the entity-api always use "Publication", so the ingest-ui code doesn't send over this
dataset_type == 'Publication'
(@BirdMachine needs to make the corresponding updates in UI code)To implement:
Publication.dataset_type
property asgenerated: true
(so it's not user provided) andimmutable: true
(so can't be updated). Removerequired_on_create: true
.before_create_trigger: set_publication_dataset_type
which always uses a fixed value of "Publication" and stores it in Noe4j.