Ensure mapping rule has only local and remote properties
As per the API spec, a mapping rule reference should only have a local and remote properties. This change ensures that the schema used to validate mappings fulfills that requirement. bp mapping-distributed-admin Change-Id: I00468c56d9b6689789b2123c3797c56cc73517d1
This commit is contained in:
parent
8c3e79495f
commit
15916152d8
|
@ -29,6 +29,8 @@ MAPPING_SCHEMA = {
|
|||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ['local', 'remote'],
|
||||
"additionalProperties": False,
|
||||
"properties": {
|
||||
"local": {
|
||||
"type": "array"
|
||||
|
|
|
@ -306,3 +306,28 @@ MAPPING_EXTRA_REMOTE_PROPS_JUST_TYPE = {
|
|||
}
|
||||
]
|
||||
}
|
||||
|
||||
MAPPING_EXTRA_RULES_PROPS = {
|
||||
"rules": [
|
||||
{
|
||||
"local": [
|
||||
{
|
||||
"group": {
|
||||
"id": "0cd5e9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"invalid_type": {
|
||||
"id": "xyz",
|
||||
},
|
||||
"remote": [
|
||||
{
|
||||
"type": "orgPersonType",
|
||||
"not_any_of": [
|
||||
"SubContractor"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -579,3 +579,8 @@ class MappingCRUDTests(FederationTests):
|
|||
url = self.MAPPING_URL + uuid.uuid4().hex
|
||||
self.put(url, expected_status=400,
|
||||
body={'mapping': {}})
|
||||
|
||||
def test_create_mapping_extra_rules_properties(self):
|
||||
url = self.MAPPING_URL + uuid.uuid4().hex
|
||||
self.put(url, expected_status=400,
|
||||
body={'mapping': mapping_fixtures.MAPPING_EXTRA_RULES_PROPS})
|
||||
|
|
Loading…
Reference in New Issue