Closed RaySinnema closed 9 years ago
See also #39.
The use case makes sense. Three questions / suggestions:
status-code
would be a better name for this attribute?Yes. No. OK.
The proposal is:
error = element error { name, error-status-code?, documentation* }
error-status-code = attribute status-code { HTTP-status-enum }
Let's leave the issue open until William responds, but I'll add it to the schema right now.
On Wed, Sep 9, 2015 at 4:06 AM, Rémon (Ray) Sinnema < notifications@github.com> wrote:
The proposal is:
error = element error { name, error-status-code?, documentation* } error-status-code = attribute status-code { HTTP-status-enum }
— Reply to this email directly or view it on GitHub https://github.com/restful-api-description-language/RADL/issues/42#issuecomment-138818679 .
+1
Should we add a
status
attribute to theerror
element?This is not so much for clients, who shouldn't tightly couple to status codes, but more for servers. For instance, we could use this information to generate exception classes and a central exception-to-status mapper.
Here's an example error condition for RESTBucks:
And here's the Spring code we could generate from that:
Without the
status
attribute, we wouldn't know what base class to generate forInvalidItemException
.