Update goai_path.go (#2029)

This commit is contained in:
ar026
2022-07-26 22:48:40 +08:00
committed by GitHub
parent 6f7cd96a7f
commit 1ae037f515

View File

@ -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)