<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-03-07 19:23 GMT+08:00 Sean Dague <span dir="ltr"><<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</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 01:18 AM, Alex Xu wrote:<br>
> Hi,<br>
><br>
> Due to this regression bug <a href="https://launchpad.net/bugs/1552888" rel="noreferrer" target="_blank">https://launchpad.net/bugs/1552888</a>, found we<br>
> are using 'formart' jsonschema keyword in wrong way. The 'format' is not<br>
> only for string instance, but all the types.<br>
<br>
</span>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>
<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>In the legacy v2 API, we create server with network like this:</div><div><span style="font-family:Calibri;font-size:11pt">"networks": [{"uuid":
"f4001fde-7bb8-4a73-b1a9-03b444d1f6f8", "port": null}]'</span></div><div>The port can be null.<br></div><div><br></div><div>With v2.1 API, you will get 400:</div><div><br></div><div><div>curl -g -i -X POST <a href="http://192.168.2.176:8774/v2.1/b90b53ed87d74e19806da34dbaa056c9/servers">http://192.168.2.176:8774/v2.1/b90b53ed87d74e19806da34dbaa056c9/servers</a> -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: e740965218754560a98d9ac188271253" -d '{"server": {"name": "vm4", "imageRef": "33a713dc-7efe-488c-bf12-d902ff5e6118", "flavorRef": "1", "max_count": 1, "min_count": 1, "networks": [{"uuid": "f4001fde-7bb8-4a73-b1a9-03b444d1f6f8", "port": null}]}}'</div><div>HTTP/1.1 400 Bad Request</div><div>X-Openstack-Nova-Api-Version: 2.1</div><div>Vary: X-OpenStack-Nova-API-Version</div><div>Content-Type: application/json; charset=UTF-8</div><div>Content-Length: 117</div><div>X-Compute-Request-Id: req-c5ab91ca-dc24-42ea-8272-7f35571b15da</div><div>Date: Mon, 07 Mar 2016 13:01:58 GMT</div><div><br></div><div>{"badRequest": {"message": "Invalid input for field/attribute port. Value: None. None is not a 'uuid'", "code": 400}}</div></div><div><br></div><div>This is due to we write json-schema like this:</div><div><div>'port': {</div><div>       'type': ['string', 'null'],</div><div>       format': 'uuid'</div><div> },</div></div><div><br></div><div><br></div><div>We assume 'type' will enable 'null' value and 'format' only against on string type. Actually 'null' will be passed to format check also, then the format check return fault.</div><div><br></div><div><br></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"><span class=""><font color="#888888">
        -Sean<br>
<br>
--<br>
Sean Dague<br>
<a href="http://dague.net" rel="noreferrer" target="_blank">http://dague.net</a><br>
<br>
</font></span><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>
<br></blockquote></div><br></div></div>