зеркало из https://github.com/Azure/sway.git
Update package version (#73)
This commit is contained in:
Родитель
2743fdbd9a
Коммит
bed0b058a0
|
@ -136,12 +136,12 @@ function validateDiscriminator (report, schema, json) {
|
|||
|
||||
// to conform to the Azure specs, we accept a lenient discriminator. if the type is missing in the
|
||||
// payload we use the base class. Also if the type doesn't match anything, we use the base class.
|
||||
var basePolymorphicSchemaDiscriminatorType =
|
||||
var basePolymorphicSchemaDiscriminatorValue =
|
||||
basePolymorphicSchema.__$refResolved.properties[discriminatorPropertyName].enum[0]
|
||||
|
||||
var jsonDiscriminatorValue =
|
||||
json[discriminatorPropertyName] ||
|
||||
basePolymorphicSchemaDiscriminatorType
|
||||
basePolymorphicSchemaDiscriminatorValue
|
||||
|
||||
var schemaToValidate =
|
||||
schema.oneOf.find(
|
||||
|
@ -153,7 +153,7 @@ function validateDiscriminator (report, schema, json) {
|
|||
|
||||
// if the schema to validate is the base schema, we dont need to validate the discriminator enum value.
|
||||
if (schemaToValidate === basePolymorphicSchema) {
|
||||
json[discriminatorPropertyName] = basePolymorphicSchemaDiscriminatorType
|
||||
json[discriminatorPropertyName] = basePolymorphicSchemaDiscriminatorValue
|
||||
}
|
||||
ZSchemaValidator.validate.call(this, report, schemaToValidate, json)
|
||||
return true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "yasway",
|
||||
"version": "1.7.1",
|
||||
"version": "1.7.2",
|
||||
"description": "A library that simplifies Swagger integrations.",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
|
@ -81,4 +81,4 @@
|
|||
"swagger-methods": "^1.0.8",
|
||||
"swagger-schema-official": "2.0.0-bab6bed"
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче