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
2 changed files with 11 additions and 0 deletions

View File

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

View File

@@ -54,6 +54,16 @@ tests:
response_json_paths: response_json_paths:
$.errors[0].title: Bad Request $.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 - name: put an allocation violate schema
PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958 PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
request_headers: request_headers: