[openstack-dev] [nova] How to fix the wrong usage of 'format' jsonschema keyword in server create API

Ken'ichi Ohmichi ken1ohmichi at gmail.com
Mon Mar 7 16:29:40 UTC 2016

Hi Alex,

Thanks for pointing this up.

2016-03-06 22:18 GMT-08:00 Alex Xu <soulxu at gmail.com>:
> Due to this regression bug https://launchpad.net/bugs/1552888, found we are
> using 'formart' jsonschema keyword in wrong way. The 'format' is not only
> for string instance, but all the types.
> So checking the server create API, we have problem at
> https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/servers.py#L38.
> The original purpose of jsonschema want to allow 'null' value by the 'type'
> keywordl. Actually the 'null' value isn't allowed, as the 'uuid' format will
> return fault for 'null' value.
> So what we need to do for this:
> Option1: Fix it with microversion
> Option2: Fix it without microversion
> Option3: Keep it as 'null' isn't allowed.
> If we choice to fix it, I think we need Microversion, due to this bug is
> introduced before v2.1 API release.
> But I prefer to not fix it, as we said v2.1 strict the API input. And 'null'
> isn't valuable valid value(If port isn't provided by user, user can just
> ignore this parameter.). I think we can just disable it, keep this current
> behaviour as the v2.1 API behaviour.
> What would you think?

I believe we don't need to bump a new microversion for this situation.
We have already fixed this kind of regression from v2.0 API *without*
a new microversion.


Ken Ohmichi

More information about the OpenStack-dev mailing list