Merge "[placement] disallow additional fields in allocations"

This commit is contained in:
Zuul 2018-07-23 18:56:26 +00:00 committed by Gerrit Code Review
commit a79d0e09a0
2 changed files with 16 additions and 0 deletions

View File

@ -115,6 +115,7 @@ ALLOCATION_SCHEMA_V1_12 = {
"maxLength": 255
}
},
"additionalProperties": False,
"required": [
"allocations",
"project_id",

View File

@ -65,6 +65,21 @@ tests:
- JSON does not validate
- does not have enough properties
- name: put unused field
PUT: /allocations/a0b15655-273a-4b3d-9792-2e579b7d5ad9
data:
allocations:
$ENVIRON['RP_UUID']:
resources:
VCPU: 1
DISK_GB: 20
project_id: 42a32c07-3eeb-4401-9373-68a8cdca6784
user_id: 66cb2f29-c86d-47c3-8af5-69ae7b778c70
bad_field: moo
status: 400
response_strings:
- JSON does not validate
- name: create the resource provider
POST: /resource_providers
request_headers: