Merge "[placement] Require at least one allocation when PUT"

This commit is contained in:
Jenkins 2017-08-04 09:18:27 +00:00 committed by Gerrit Code Review
commit 01b3ae2e70
2 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,7 @@ ALLOCATION_SCHEMA = {
"properties": {
"allocations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {

View File

@ -54,6 +54,16 @@ tests:
response_json_paths:
$.errors[0].title: Bad Request
- name: put an allocation empty list
PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
request_headers:
content-type: application/json
data:
allocations: []
status: 400
response_strings:
- "Failed validating 'minItems'"
- name: put an allocation violate schema
PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
request_headers: