You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
belgifError.issues[0].detail// okbelgifError.issues[0].in// SyntaxErrorbelgifError.issues[0]['in']// clunky, disables type checking in Typescript
Or even requires developers to add a mapping layer as in C#:
classBelgifInputValidationIssue{stringin="body";// error CS1519: Unexpected symbol `in'staticvoidMain(string[]args){BelgifInputValidationIssueinstance=new BelgifInputValidationIssue();}}
Possible alternative: context? location? origin? request_component?
(PS: I work for with belgif-conforming API's at BOSA but this is my personal account)
The text was updated successfully, but these errors were encountered:
{
"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 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)
The text was updated successfully, but these errors were encountered: