Open NikkiBytes opened 11 months ago
@newgene just pushed a fourmat check
update, this has been reviewed and is ready to merge.
@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 |
# | 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 |
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.