From 840d08098aa60285a9f7e79040697ebeae479895 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Tue, 31 Aug 2021 14:47:20 +0200 Subject: [PATCH] nits Signed-off-by: Pierre Fenoll --- openapi3/schema.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/openapi3/schema.go b/openapi3/schema.go index 6878ad35d..69aee8d7c 100644 --- a/openapi3/schema.go +++ b/openapi3/schema.go @@ -824,8 +824,7 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val if v == nil { return foundUnresolvedRef(ref.Ref) } - err := v.visitJSON(settings, value) - if err == nil { + if err := v.visitJSON(settings, value); err == nil { if settings.failfast { return errSchema } @@ -865,8 +864,7 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val continue } - err := v.visitJSON(settings, value) - if err != nil { + if err := v.visitJSON(settings, value); err != nil { validationErrors = append(validationErrors, err) continue } @@ -910,8 +908,7 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val if v == nil { return foundUnresolvedRef(item.Ref) } - err := v.visitJSON(settings, value) - if err == nil { + if err := v.visitJSON(settings, value); err == nil { ok = true break } @@ -933,8 +930,7 @@ func (schema *Schema) visitSetOperations(settings *schemaValidationSettings, val if v == nil { return foundUnresolvedRef(item.Ref) } - err := v.visitJSON(settings, value) - if err != nil { + if err := v.visitJSON(settings, value); err != nil { if settings.failfast { return errSchema }