mirror of
https://github.com/zulip/zulip.git
synced 2026-06-21 21:32:29 +08:00
We had a bug in `validate_against_openapi_schema` that prevented it from correctly inspecting nested arrays. Fix the bug and address all the exceptions, either via EXCLUDE_PROPERTIES or fixing them when simple. Also add a test case for nested verification.
137 lines
3.9 KiB
YAML
137 lines
3.9 KiB
YAML
test1:
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
top_array:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
obj:
|
|
oneOf:
|
|
- type: array
|
|
items:
|
|
type: string
|
|
- type: object
|
|
properties:
|
|
str3:
|
|
type: string
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
str1:
|
|
type: string
|
|
str2:
|
|
type: string
|
|
example:
|
|
{
|
|
"top_array": [
|
|
{
|
|
"obj": {
|
|
"str3": "test"
|
|
}
|
|
},
|
|
[
|
|
{
|
|
"str1": "success",
|
|
"str2": "success"
|
|
}
|
|
]
|
|
]
|
|
}
|
|
test2:
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
top_array:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
obj:
|
|
oneOf:
|
|
- type: array
|
|
items:
|
|
type: string
|
|
- type: object
|
|
properties:
|
|
str3:
|
|
type: string
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
str1:
|
|
type: string
|
|
str2:
|
|
type: string
|
|
example:
|
|
{
|
|
"top_array": [
|
|
{
|
|
"obj": {
|
|
"str3": "test",
|
|
"str4": "extraneous"
|
|
}
|
|
},
|
|
[
|
|
{
|
|
"str1": "success",
|
|
"str2": "success"
|
|
}
|
|
]
|
|
]
|
|
}
|
|
test3:
|
|
responses:
|
|
'200':
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
top_array:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
obj:
|
|
oneOf:
|
|
- type: array
|
|
items:
|
|
type: string
|
|
- type: object
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
str1:
|
|
type: string
|
|
str2:
|
|
type: string
|
|
example:
|
|
{
|
|
"top_array": [
|
|
{
|
|
"obj": {
|
|
"str3": "test"
|
|
}
|
|
},
|
|
[
|
|
{
|
|
"str1": "success",
|
|
"str2": "success"
|
|
}
|
|
]
|
|
]
|
|
}
|