We are using the "Validate Against OpenAPI Document" assertion to check the content of incoming requests against a static YAML specification
A request field is marked as '"nullable": true' in the spec, but the validation assertion fails if the content is null
Release : 10.0
Component : API GATEWAY
OpenAPI assertion uses json schema validator (v4) to validate the body. It seemed that nullable field is applicable to Open API 3.0 spec only. It is not part of JSON schema draft v4. We might need to find a way to translate this nullable field to JSON Schema v4.
The nullable field can be translated using anyOf. For now, this can be worked around by adjusting the schema like the example below:
EXISTING:
"comment": { "pattern": "aa.*", "type": "string", "nullable": true}
NEW:
"comment": { "anyOf": [ { "pattern": "aa.*", "type": "string" }, {"type": "null"} ]}
Also, another suggestion is to use the format like below:
EXISTING:
"comment": { "pattern": "aa.*", "type": "string", "nullable": true}
NEW:
"comment": {
"pattern": "aa.*",
"type":["string","null"]
}
This issue will be fixed in 10.0 CR06