[openstack-dev] [api] Request Validation - Stoplight

Ken'ichi Ohmichi ken1ohmichi at gmail.com
Tue Oct 21 05:11:08 UTC 2014


Hi Chris,

2014-10-21 13:41 GMT+09:00 Christopher Yeoh <cbkyeoh at gmail.com>:
>
> On Tue, Oct 21, 2014 at 12:15 PM, Kenichi Oomichi <oomichi at mxs.nes.nec.co.jp> wrote:
>>
>> Hi Amit,
>>
>> Thanks for picking this topic up,
>>
>> Honestly I don't have a strong opinion about validation libraries.
>> Each project implements based on different web frameworks and
>> the options of validation libraries would be limited from its web
>> framework. For example, Nova implements its own wsgi framework and
>> it is difficult to use pecan/wsme due to its API routing/parameter
>> names. So Nova uses jsonschema for a new API(Nova v2.1 API) because
>> of its flexibility and portability.
>> From quick seeing, stoplight seems flexible and it could cover many
>> cases. That would be nice for me, but I'm not sure that stoplight is
>> the best library because jsonschema is a common way/library and portable.
>>
>> Related to this topic, I'd like to suggest that we have common validation
>> patterns across OpenStack projects. Now each project contains its owns
>> validation patterns for the other project's resource. For example, Nova
>> contains validation patterns for project-id and image-id on the code[1].
>> Ideally, these validation patterns would be nice to be ported/shared from
>> Keystone and Glance and it is the best to use the same validation patterns
>> between whole OpenStack projects for consistent interfaces. Maybe we can
>> implement these patterns even if using different validation libraries.
>>
>
> This sounds good. Would you mind adding it to the wiki here?
>
> https://wiki.openstack.org/wiki/Governance/Proposed/APIGuidelines
>
> So we don't lose track of it - we don't have the git/gerrit repository up quite yet.


I see, I wrote it as "POST/PUT body validation" on the wiki.

Thanks
Ken Ohmichi



More information about the OpenStack-dev mailing list