[katello-devel] How should we post objects

Bryan Kearney bkearney at redhat.com
Thu Jul 12 15:49:10 UTC 2012


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






More information about the katello-devel mailing list