[katello-devel] How should we post objects

Lukas Zapletal lzap at redhat.com
Fri Jul 13 13:46:49 UTC 2012


We already discussed this some time ago. There are no big
(dis)advantages for any of these. It's just about what we decide to go
for.

I am for having the wrapper "person" dictionary there.

LZ

On Thu, Jul 12, 2012 at 11:49:10AM -0400, Bryan Kearney wrote:
> The API Conventions Document
> (https://fedorahosted.org/katello/wiki/APIConventions) says that
> objects should be fully qualified. So, if we return a person object
> the json should be:
> 
> 
> {
>   person: {
>     name: "JarJar Binks",
>     id: "1"
>   }
> }
> 
> My question is, if I want to create or update a person, what should
> the body of the html messgae be? Should it be:
> 
> POST /people
> {
>   person: {
>     name: "Anakin Skywalker",
>   }
> }
> 
> POST /people/1
> {
>   person: {
>     name: "Jar Jar Binkage",
>   }
> }
> 
> 
> OR
> 
> POST /people
> {
>     name: "Anakin Skywalker",
> }
> 
> POST /people/1
> {
>     name: "Jar Jar Binkage",
> }
> 
> 
> Opinions? I ask because both are used in the API today :)
> 
> -- bk
> 
> 
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel

-- 
Later,

 Lukas "lzap" Zapletal
 #katello #systemengine




More information about the katello-devel mailing list