Open webketje opened 1 year ago
The "name" property can be used to describe the full location, like in the example in the guide : https://www.belgif.be/specification/rest/api-guide/#bad-request
{
"type": "urn:problem-type:belgif:input-validation:schemaViolation",
"in": "body",
"name": "mandator.enterpriseNumber",
"value": "123456",
"detail": "An enterprise number should be 10 digits long"
}
We didn't want to mandate this, because it can be tricky to implement this correctly depending on framework used.
The in
parameter name was chosen to be consistent with how it's defined in OpenAPI, but this could be weighed against language support.
The OpenAPI code generator handles this. Reserved keywords are prefixed by a '_'. See AbstractCSharpCodegen.java
The word
in
is a reserved keyword in many languages used for web programming (Python, Javascript, C#, Groovy and probably many others). This makes it hard to access it from an object without extra safeguards:Javascript example:
Or even requires developers to add a mapping layer as in C#:
Possible alternative: context? location? origin? request_component?
(PS: I work for with belgif-conforming API's at BOSA but this is my personal account)