[openstack-dev] [Keystone] Use JSON Schemas to validate API requests data

Doug Hellmann doug.hellmann at dreamhost.com
Tue Jun 4 14:32:15 UTC 2013


On Mon, Jun 3, 2013 at 3:33 PM, Russell Bryant <rbryant at redhat.com> wrote:

> On 06/03/2013 02:38 PM, Monty Taylor wrote:
> >
> >
> > On 06/03/2013 02:14 PM, Jarret Raim wrote:
> >> On 6/3/13 10:24 AM, "Russell Bryant" <rbryant at redhat.com> wrote:
> >>
> >>
> >>> On 06/02/2013 11:09 AM, Jarret Raim wrote:
> >>>> Both the Barbican (Key Management) and Meniscus (Logging) projects are
> >>>> moving down the path of using jsonschema for message validation.
> >>>
> >>> But please take a look at WSME.  We've deprecated the home grown wsgi
> >>> code in Oslo.  Instead, we're encouraging all projects to adopt similar
> >>> tooling (pecan and WSME) when developing new APIs.
> >>
> >> We aren't using the oslo stuff, we've been using Falcon up until now. It
> >> seems to me like there still isn't much consensus on the common wsgi
> >> question. There seem to be quite a few projects who aren't going to use
> it
> >> or can't use it for some reason. I'm just pulling from memory so let me
> >> know if I've got the wrong impression. Do we have a list of which
> projects
> >> are currently using Pecan? And which ones are planning on migrating?
> >
> > I don't get the same impression. The consensus is that we're going to
> > move to Pecan/WSME as projects need to write an API, but we were not
> > going to both re-writing old API code just for the fun of it.
> >
> > Off the top of my head, I believe that in addition to ceilometer and
> > ironic are both using pecan, and someone else was talking about it for
> > their next api rev - but I honestly don't remember.
> >
> > At the very least I believe it was as decided as anything is around here
> > that we'd start using pecan/WSME for new things.
>
> Right.
>

Yes, that was my understanding as well.

I believe the cinder team is looking into Pecan & WSME this cycle, too,
although I don't know if that's just investigation or if they plan to
release a new service implementation.


>
> >>> If there are things lacking in WSME, it would be good to know so that
> it
> >>> can be improved.
> >>
> >> From a quick look at WSME, it seems like you still need to write
> >> validation code (obviously) so using JSON schema to perform that
> >> validation seems like something that could co-exist with WSME's strongly
> >> typed request / responses. Fair?
> >
> > That sounds completely sensible to me!
>
> WSME does type checking and validation.  Doug, can you comment further?
>

WSME does type conversion/checking. I typically implement validation in the
model class constructor so it's right there inline and easy to find.

Doug



>
> --
> Russell Bryant
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130604/b367e2b1/attachment.html>


More information about the OpenStack-dev mailing list