[openstack-dev] [api] Optional Properties in an Entity

Jay Pipes jaypipes at gmail.com
Mon Feb 9 21:22:48 UTC 2015


On 01/20/2015 10:54 AM, Brian Rosmaita wrote:
> From: Kevin L. Mitchell [kevin.mitchell at rackspace.com]
> Sent: Monday, January 19, 2015 4:54 PM
>
>> When we look at consistency, we look at everything else in OpenStack.
>>  From the standpoint of the nova API (with which I am the most familiar),
>> I am not aware of any property that is ever omitted from any payload
>> without versioning coming in to the picture, even if its value is null.
>> Thus, I would argue that we should encourage the first situation, where
>> all properties are included, even if their value is null.
>
> That is not the case for the Images API v2:
>
> "An image is always guaranteed to have the following attributes: id,
> status, visibility, protected, tags, created_at, file and self. The other
> attributes defined in the image schema below are guaranteed to
> be defined, but is only returned with an image entity if they have
> been explicitly set." [1]

This was a mistake, IMHO. Having entirely extensible schemas means that 
there is little guaranteed consistency across implementations of the API.

This is the same reason that I think API extensions are an abomination.

Best,
-jay



More information about the OpenStack-dev mailing list