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

Sean Dague sean at dague.net
Sun Jan 12 13:13:15 UTC 2014


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.


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.

	-Sean

-- 
Sean Dague
Samsung Research America
sean at dague.net / sean.dague at samsung.com
http://dague.net



More information about the OpenStack-dev mailing list