[Mailman-Developers] REST API returns are plain text for errors, JSON or nothing for successful

Barry Warsaw barry at list.org
Mon Jan 12 02:22:40 CET 2015


On Jan 11, 2015, at 06:23 AM, Andrew Stuart wrote:

>Happy to do so if you like.  Would you mind pointing me in the direction of
>some instructions for filing bugs please?
>
>FWIW I’d probably favor a REST API that is behaving improperly by returning
>plain text error responses (i.e. the current situation) rather than a REST
>API that returns application/json content type for valid responses and
>text/plain for errors.  Once that gets baked into release 1 it’ll be
>challenging to correct back to application/json later because people will
>write clients to expect text/plain for errors.
>
>It’s a whole lot easier conceptually to deal with a REST API that always
>returns the same content-type regardless of the outcome of the API call.
>
>Some REST tools don’t have any mechanism for defining mixed response type
>APIs which leads to some weird outcomes when querying successfully versus
>getting errors.  In short, I’d leave as-is and eventually turn the error text
>into json, but obviously Barry you should say what you want.

I think at least the Content-Type should be accurate.

Your response sounds a little contradictory, but let me see if I can summarize
it.  From a practicality view point, you prefer the current implementation,
even if it isn't conceptually pure, at least for now.

That works for me because then I don't have to worry about changing
anything. :)  I'm open to re-evaluating that in some future Mailman release.

Cheers,
-Barry


More information about the Mailman-Developers mailing list