<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-03-07 21:10 GMT+08:00 Jay Pipes <span dir="ltr"><<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 03/07/2016 08:05 AM, Alex Xu wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
2016-03-07 19:23 GMT+08:00 Sean Dague <<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</a><br></span>
<mailto:<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</a>>>:<span class=""><br>
<br>
On 03/07/2016 01:18 AM, Alex Xu wrote:<br>
> Hi,<br>
><br></span>
> Due to this regression bughttps://<a href="http://launchpad.net/bugs/1552888" rel="noreferrer" target="_blank">launchpad.net/bugs/1552888</a>, found we<div><div class="h5"><br>
> are using 'formart' jsonschema keyword in wrong way. The 'format' is not<br>
> only for string instance, but all the types.<br>
<br>
Can you given an example of the kinds of things that are currently being<br>
rejected? And if we think those REST API calls are valid? I'd like to<br>
know what we started blocking in Option 3 that no one noticed until now.<br>
<br>
<br>
In the legacy v2 API, we create server with network like this:<br>
"networks": [{"uuid": "f4001fde-7bb8-4a73-b1a9-03b444d1f6f8", "port":<br>
null}]'<br>
The port can be null.<br>
<br>
With v2.1 API, you will get 400:<br>
<br>
curl -g -i -X POST<br>
<a href="http://192.168.2.176:8774/v2.1/b90b53ed87d74e19806da34dbaa056c9/servers" rel="noreferrer" target="_blank">http://192.168.2.176:8774/v2.1/b90b53ed87d74e19806da34dbaa056c9/servers</a><br>
-H "User-Agent: python-novaclient" -H "Content-Type: application/json"<br>
-H "Accept: application/json" -H "X-Auth-Token:<br>
e740965218754560a98d9ac188271253" -d '{"server": {"name": "vm4",<br>
"imageRef": "33a713dc-7efe-488c-bf12-d902ff5e6118", "flavorRef": "1",<br>
"max_count": 1, "min_count": 1, "networks": [{"uuid":<br>
"f4001fde-7bb8-4a73-b1a9-03b444d1f6f8", "port": null}]}}'<br>
HTTP/1.1 400 Bad Request<br>
X-Openstack-Nova-Api-Version: 2.1<br>
Vary: X-OpenStack-Nova-API-Version<br>
Content-Type: application/json; charset=UTF-8<br>
Content-Length: 117<br>
X-Compute-Request-Id: req-c5ab91ca-dc24-42ea-8272-7f35571b15da<br>
Date: Mon, 07 Mar 2016 13:01:58 GMT<br>
<br>
{"badRequest": {"message": "Invalid input for field/attribute port.<br>
Value: None. None is not a 'uuid'", "code": 400}}<br>
<br>
This is due to we write json-schema like this:<br>
'port': {<br>
'type': ['string', 'null'],<br>
format': 'uuid'<br>
},<br>
<br>
<br>
We assume 'type' will enable 'null' value and 'format' only against on<br>
string type. Actually 'null' will be passed to format check also, then<br>
the format check return fault.<br>
</div></div></blockquote>
<br>
So, 'null' should be removed from there and the required set of attributes should have 'uuid' removed. Is that correct? </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
If so, I think it should be fine to correct it without a microversion.<br></blockquote><div><br></div><div>Do you mean the option3? For option3, just need remove the 'null' from type.</div><div><br></div><div>For option 2, it looks like this <a href="https://review.openstack.org/#/c/288268/2">https://review.openstack.org/#/c/288268/2</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Best,<br>
-jay<div class=""><div class="h5"><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>