[openstack-dev] [nova] api schema validation pattern changes

Ken'ichi Ohmichi ken1ohmichi at gmail.com
Mon Jan 13 02:28:10 UTC 2014

Hi Sean,

Thank you for reviewing patches,

2014/1/12 Sean Dague <sean at dague.net>:
> Ken'ichi,
> I've been going through a bunch of the API validation reviews, and while the
> specifics are fine, there are some overarching style patterns that I think
> we might want to change.
> First, the decorator -
> @validation.schema(request_body_schema=
>                     remote_consoles_schema.get_vnc_console)
> The decorator only takes 1 parameter, so calling it by name seems excessive,
> especially as it forces a line break.
> Second, the module names:
> We've already got schemas in the path, I don't think we need the module to
> also be _schema.py. If we are running into name space conflicts on import,
> just import as an alias. I think this will also tighten up the code.

I see, the above points are reasonable.
I have posted patch(https://review.openstack.org/#/c/66238/) for
applying the points.

> Last, is a question, is it possible to currently run the full API an build a
> json schema for it all? Or to query these validating schemas? We *really*
> want that over in tempest, so we can completely drop the manual creation of
> negative testing, and just fuzz known bad against the schema definitions.

Sorry, I'm not sure I understand this question correctly.
We need to define schemas for each API with the separated schema patches.
It is impossible to define one schema for all APIs.

Hi  David, Marc,

I guess the negative test generator of Tempest would need each API definition.
Glance can provide API definitions through API with jsonschema format, but
Nova does not have such feature.
We need to port these API schema from Nova to Tempest, I guess. right?

Ken'ichi Ohmichi

More information about the OpenStack-dev mailing list