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

Peter Meier peter.meier at immerda.ch
Wed Dec 7 16:52:04 UTC 2011


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?

~pete

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?




More information about the Pulp-list mailing list