chanzuckerberg / cryoet-data-portal-backend

CryoET Data Portal API server & ingestion scripts
MIT License
1 stars 2 forks source link

pydantic validation: `pydantic__no_name_validation` flag #149

Closed daniel-ji closed 1 month ago

daniel-ji commented 1 month ago

To be PR'd after #140.

Sometimes it doesn't make sense to check the ontology object's ID against the name and the name is intentionally different from what is stored online (this is for fields like annotation_object, cell_type, cell_component, tissue, cell_strain, etc.). With this PR, a new attribute can now be specified pydantic__no_name_validation (alongside the name and id attributes in the config file) to stop the Pydantic extended network validation from doing this check and throwing an error.

daniel-ji commented 1 month ago

We'll not use this method and instead store a json file that gives a whitelist of fields & corresponding values to not check for validation.