From 1ae037f515461987f9de0c43758121a89fd240c1 Mon Sep 17 00:00:00 2001 From: ar026 Date: Tue, 26 Jul 2022 22:48:40 +0800 Subject: [PATCH] Update goai_path.go (#2029) --- net/goai/goai_path.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/goai/goai_path.go b/net/goai/goai_path.go index 2de4fca39..3602927ed 100644 --- a/net/goai/goai_path.go +++ b/net/goai/goai_path.go @@ -311,6 +311,12 @@ func (oai *OpenApiV3) removeOperationDuplicatedProperties(operation Operation) { } for _, requestBodyContent := range operation.RequestBody.Value.Content { + + // Check request body schema + if requestBodyContent.Schema == nil { + continue + } + // Check request body schema ref. if schema := oai.Components.Schemas.Get(requestBodyContent.Schema.Ref); schema != nil { schema.Value.Required = oai.removeItemsFromArray(schema.Value.Required, duplicatedParameterNames)