diff --git a/openapi3/validation_options.go b/openapi3/validation_options.go index c9d7d7225..5932ea59a 100644 --- a/openapi3/validation_options.go +++ b/openapi3/validation_options.go @@ -24,13 +24,6 @@ func EnableSchemaFormatValidation() ValidationOption { } } -// DisableSchemaDefaultsValidation disables schemas' default field validation. -func DisableSchemaDefaultsValidation() ValidationOption { - return func(options *ValidationOptions) { - options.schemaDefaultsValidationDisabled = true - } -} - // DisableSchemaFormatValidation does the opposite of EnableSchemaFormatValidation. // By default, schema format validation is disabled. func DisableSchemaFormatValidation() ValidationOption { @@ -54,6 +47,22 @@ func DisableSchemaPatternValidation() ValidationOption { } } +// EnableSchemaDefaultsValidation dies the opposite of DisableSchemaDefaultsValidation. +// By default, schema default values are validated against their schema. +func EnableSchemaDefaultsValidation() ValidationOption { + return func(options *ValidationOptions) { + options.schemaDefaultsValidationDisabled = false + } +} + +// DisableSchemaDefaultsValidation disables schemas' default field validation. +// By default, schema default values are validated against their schema. +func DisableSchemaDefaultsValidation() ValidationOption { + return func(options *ValidationOptions) { + options.schemaDefaultsValidationDisabled = true + } +} + // EnableExamplesValidation does the opposite of DisableExamplesValidation. // By default, all schema examples are validated. func EnableExamplesValidation() ValidationOption {