Chemical-Curation / chemcurator_django

Backend services for chemical curation
https://api.chemreg.epa.gov
MIT License
1 stars 0 forks source link

As a curator I want to be able to save synonyms without synonym types So that (I actually don't know what synonym types are used for #295

Open jtumkur opened 3 years ago

jtumkur commented 3 years ago

Synonyms are allowed to be saved without a synonym type Sample CURL request if you want to test it yourself. You may need to change the ids to reflect whatever you have in your system. Synonym Curl Request - 500 curl --location --request POST '127.0.0.1:8000/synonyms' \ --header 'Content-Type: application/vnd.api+json' \ --header 'Authorization: Basic a2FyeW46c3BlY2lhbFBANTV3b3Jk' \ --header 'Cookie: csrftoken=uYUMbbFCLDbtJE39gpJzQN5Ln1njZa3sp0JjtwdNHL4DVAnaiwa8jPp3CelFKFOS' \ --data-raw '{ "data": { "type": "synonym", "attributes": { "identifier": "Demo Synonym" }, "relationships": { "source": { "data": { "id": "down-indeed-other-4", "type": "source" } }, "substance": { "data": { "id": "DTXSID502000000", "type": "substance" } }, "synonymQuality": { "data": { "id": "area-professor-fromage", "type": "synonymQuality" } } } } }'

jtumkur commented 3 years ago

Change Synonyms to as a required input. It should return a clear error message. (Generic synonym type that should be entered).

cmgrulke commented 3 years ago

Ok, to be very clear: Synonym_type should not be nullable on a synonym post or patch. Error messages should be clear if the user attempts to submit a synonym resource with a null synonym_type.