[openstack-dev] [glance] Models and validation for v2
Jay Pipes
jaypipes at gmail.com
Wed Sep 30 16:04:11 UTC 2015
On 09/30/2015 09:31 AM, Kairat Kushaev wrote:
> Hi All,
> In short terms, I am wondering why we are validating responses from
> server when we are doing
> image-show, image-list, member-list, metadef-namespace-show and other
> read-only requests.
>
> AFAIK, we are building warlock models when receiving responses from
> server (see [0]). Each model requires schema to be fetched from glance
> server. It means that each time we are doing image-show, image-list,
> image-create, member-list and others we are requesting schema from the
> server. AFAIU, we are using models to dynamically validate that object
> is in accordance with schema but is it the case when glance receives
> responses from the server?
>
> Could somebody please explain me the reasoning of this implementation?
> Am I missed some usage cases when validation is required for server
> responses?
>
> I also noticed that we already faced some issues with such
> implementation that leads to "mocking" validation([1][2]).
The validation should not be done for responses, only ever requests (and
it's unclear that there is value in doing this on the client side at
all, IMHO).
-jay
More information about the OpenStack-dev
mailing list