Replacing `oneOf` with `anyOf`.
This commit is contained in:
Родитель
d549cfcd57
Коммит
9b527592e8
|
@ -1,3 +1,7 @@
|
|||
### 06/19/2018 0.4.49
|
||||
- Bug fix: Data is valid against more than one schema from `oneOf` [#248](https://github.com/Azure/oav/pull/248)
|
||||
The problem occurs when referenced model may also accept `null`. The fix is replacing `oneOf` with `anyOf`.
|
||||
|
||||
### 05/14/2018 0.4.38
|
||||
- Bug fix: `oav extract-xmsexamples` also extracts request headers. [#241](https://github.com/Azure/oav/pull/241)
|
||||
- Bug fix: x-ms-parametrized-host is not validated correctly [#240](https://github.com/Azure/oav/issues/240)
|
||||
|
|
|
@ -559,11 +559,12 @@ export interface Model {
|
|||
additionalProperties?: Model|false
|
||||
"x-nullable"?: Unknown
|
||||
in?: Unknown
|
||||
oneOf?: Unknown
|
||||
oneOf?: Model[]
|
||||
$ref?: string
|
||||
required?: Unknown[]|false
|
||||
schema?: Model
|
||||
allOf?: Ref[]
|
||||
anyOf?: Model[]
|
||||
description?: Unknown
|
||||
discriminator?: string
|
||||
"x-ms-discriminator-value"?: string
|
||||
|
@ -698,8 +699,9 @@ export function allowNullType(entity: Model, isPropRequired?: boolean|{}): Model
|
|||
&& entity.$ref
|
||||
&& shouldAcceptNullValue(entity["x-nullable"], isPropRequired)) {
|
||||
const savedEntity = entity
|
||||
entity = {}
|
||||
entity.oneOf = [savedEntity, { type: "null" }]
|
||||
entity = {
|
||||
anyOf: [savedEntity, { type: "null" }]
|
||||
}
|
||||
}
|
||||
return entity
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "0.4.48",
|
||||
"version": "0.4.49",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -5663,9 +5663,9 @@
|
|||
}
|
||||
},
|
||||
"validator": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-10.3.0.tgz",
|
||||
"integrity": "sha512-bn7dcJcdkpSjcujYlf8lrY9VL660h5njEkFzQzQOFMQgJ3Id1C4+MkazHKgHE45NoGsyQYEPmo4dCIbDQ7eTdw=="
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-10.4.0.tgz",
|
||||
"integrity": "sha512-Q/wBy3LB1uOyssgNlXSRmaf22NxjvDNZM2MtIQ4jaEOAB61xsh1TQxsq1CgzUMBV1lDrVMogIh8GjG1DYW0zLg=="
|
||||
},
|
||||
"z-schema": {
|
||||
"version": "3.22.0",
|
||||
|
@ -5675,7 +5675,7 @@
|
|||
"commander": "2.15.0",
|
||||
"lodash.get": "4.4.2",
|
||||
"lodash.isequal": "4.5.0",
|
||||
"validator": "10.3.0"
|
||||
"validator": "10.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "0.4.48",
|
||||
"version": "0.4.49",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation",
|
||||
"email": "azsdkteam@microsoft.com",
|
||||
|
|
Загрузка…
Ссылка в новой задаче