[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] API: Consider to only return JSON parseable results

On 12/07/2011 11:52 AM, Peter Meier wrote:
Hi all,

Currently some actions on the API return results that are not parseable
as JSON.

For example the add_note or delete_note action on the repository. These
actions return just the string "true", which is in my opinion a string
that can not be parsed by JSON libraries. Actually, ruby's json can't
parse it.

It would make it easier for people working with the API, if they can
count on it that if they get a 200 answer, that the body can be parsed
as json.

So for example these actions could return '{"result":true}', if they
only would like to return true or false.

What do you think?

100% agree. We're taking a much more REST-like approach with our APIs in the future (truth be told, the current ones are a bit sloppy) where all of the responses will be JSON parsable in the future.


Btw: The documentation sometimes tells in that region that the result is
Unspecified or "return: a Repo object". While this is not true for all
actions, at least add_note returns "true" instead of a repo object.
Should I file bzs?

Pulp-list mailing list
Pulp-list redhat com

Jay Dobies
Freenode: jdob @ #pulp
http://pulpproject.org | http://blog.pulpproject.org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]