belgif / rest-problem-java

Java library for RFC 9457 Problems with support for standard problem types of the Belgif REST guide (https://www.belgif.be/specification/rest/api-guide/#error-handling)
https://belgif.github.io/rest-problem-java/
Apache License 2.0
3 stars 0 forks source link

Add optional replacedByHref property to replacedSsin issue type #67

Closed jpraet closed 3 months ago

jpraet commented 3 months ago

Add optional replacedByHref property to replacedSsin issue type, containing the url for the new SSIN.

e.g. https://api.company.com/v1/employees?ssin=12345678900

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json

{
  "type": "urn:problem-type:belgif:badRequest",
  "href": "https://www.belgif.be/specification/rest/api-guide/problems/badRequest.html",
  "status": 400,
  "title": "Bad Request",
  "detail": "The input message is incorrect",
  "issues": [
    {
      "type": "urn:problem-type:cbss:input-validation:replacedSsin",
      "title": "SSIN has been replaced, use new SSIN",
      "detail": "SSIN 12345678900 has been replaced by 23456789000",
      "in": "query",
      "name": "ssin",
      "value": "12345678900",
      "replacedBy": "23456789000",
      "replacedByHref": "https://api.company.com/v1/employees?ssin=23456789000"
    }
 ]
}