grtjn/Corona — comment on commit 5684c065103d22caa8a93bac38354d166e724d3b
File: config/endpoints.xqy line 28
By isubiker:

Technically we could create a configuration that marks the URI as required. But in general I'm very reluctant to mark any parameter as required (even though some currently are, I'd like to change them too). The reason for this is that the ml-rest-lib makes it very difficult to present users with good error messages when required parameters are missing. What happens is that the request ends up not matching any of the request definitions and simply falls back to a generic error handler that says it's an unknown request. However, if we mark them as not being required, the checks can be performed inside the code backing the endpoint and can give very descriptive messages (e.g.: corona:MISSING-PARAMETER: Must supply a URI when inserting, updating or fetching a document).