biothings / discovery-app

The Data Discovery Engine project by the CD2H Data working-group
http://discovery.biothings.io
Apache License 2.0
4 stars 9 forks source link

Error handling #231

Open NikkiBytes opened 11 months ago

NikkiBytes commented 11 months ago

Upgraded with comprehensive error catching in the validation endpoint and schema metadata endpoint. Added a a test file that tests scenarios in the validation endpoint.

NikkiBytes commented 11 months ago

@newgene just pushed a fourmat check update, this has been reviewed and is ready to merge.

newgene commented 11 months ago

@NikkiBytes just to make sure we (you, @marcodarko and I) are on the same page about the error-handling behavior, can you please document all handled cases in this PR. A table looks like this might be an option:

is schema.org class class exists class contains validation ... /schema/\<id> status code /schema/\<id>/validation status code
200 404
NikkiBytes commented 10 months ago
# Is schema.org class/property Is registered schema class/property Class contains validation /schema/<id> status code /schema/<id>/validation status code
1 404 (Unknown/invalid schema id) 404 (Unknown/invalid schema id)
2 200 404(validation field not found)
3 200 200
4 404 (Metadata from schema.org cannot be retrieved this way) 404