belgif / rest-guide

REST Guidelines of Belgian government institutions
https://www.belgif.be/specification/rest/api-guide/
Apache License 2.0
24 stars 4 forks source link

Standardized Belgif problem type(s) for 409 Conflict #185

Open jpraet opened 3 months ago

jpraet commented 3 months ago

The Belgif REST Guidelines make various references to HTTP 409 Conflict:

But no standardized Belgif problem type is currently provided. It should probably use the InputValidationProblem model, so additional details can be returned in the issues property.

pvdbosch commented 3 months ago

We should probably change to http code 412 for optimistic locking scenarios; there's still open issue #37 for that. For the others, we'll need to evaluate if single level of problem suffices for most of these use cases vs more complex InputValidationProblem model that allows bundling of multiple issues.

jpraet commented 3 months ago

we'll need to evaluate if single level of problem suffices for most of these use cases vs more complex InputValidationProblem model that allows bundling of multiple issues.

Yes, that relates to the discussion on https://github.com/belgif/rest-guide/issues/114#issuecomment-1482464264.

pvdbosch commented 3 months ago

409 Conflict may also be used for PUT operation when a resource can't be updated bc of business rules; similar to the above DELETE scenario. Do we need a generic problem type for such business-specific cases or should it be an API-specific problem type?