dc4eu / vc

European Wallet
BSD 2-Clause "Simplified" License
6 stars 9 forks source link

API 2.9: Change Request to be discussed: HTTP 404 return in case no results were found instead of 400 #86

Open JuAlMan opened 3 months ago

JuAlMan commented 3 months ago

This topic refers to (presumably) the following endpoints: POST /notification PUT /document/identity DELETE /document/identity DELETE /document POST /document/collect_id POST /identity/mapping POST /document POST /consent/get POST /document/revoke

Some of these methods return HTTP 400 with some error message from MongoDB in case that no results were found. Returning Code 404 instead would be helpful to differentiate this kind of condition from other kind of errors.

Maybe this Code could also be returned in endpoints like PUT /document/identity in case that no document exists for the given parameters (i guess it should not be possible to upload an identity for a non existing document?).

This is just a proposal that needs to be discussed.