2016-03-07 19:23 GMT+08:00 Sean Dague <s...@dague.net>: > On 03/07/2016 01:18 AM, Alex Xu wrote: > > Hi, > > > > Due to this regression bug https://launchpad.net/bugs/1552888, found we > > are using 'formart' jsonschema keyword in wrong way. The 'format' is not > > only for string instance, but all the types. > > Can you given an example of the kinds of things that are currently being > rejected? And if we think those REST API calls are valid? I'd like to > know what we started blocking in Option 3 that no one noticed until now. > > In the legacy v2 API, we create server with network like this: "networks": [{"uuid": "f4001fde-7bb8-4a73-b1a9-03b444d1f6f8", "port": null}]' The port can be null.
With v2.1 API, you will get 400: curl -g -i -X POST http://192.168.2.176:8774/v2.1/b90b53ed87d74e19806da34dbaa056c9/servers -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}]}}' HTTP/1.1 400 Bad Request X-Openstack-Nova-Api-Version: 2.1 Vary: X-OpenStack-Nova-API-Version Content-Type: application/json; charset=UTF-8 Content-Length: 117 X-Compute-Request-Id: req-c5ab91ca-dc24-42ea-8272-7f35571b15da Date: Mon, 07 Mar 2016 13:01:58 GMT {"badRequest": {"message": "Invalid input for field/attribute port. Value: None. None is not a 'uuid'", "code": 400}} This is due to we write json-schema like this: 'port': { 'type': ['string', 'null'], format': 'uuid' }, 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. > -Sean > > -- > Sean Dague > http://dague.net > > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > >
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev