diff --git a/generate-gnostic/generate-compiler.go b/generate-gnostic/generate-compiler.go index 997db1a5..a6241646 100644 --- a/generate-gnostic/generate-compiler.go +++ b/generate-gnostic/generate-compiler.go @@ -843,7 +843,12 @@ func (domain *Domain) generateToRawInfoMethodForType(code *printer.Code, typeNam } code.PrintIf(!isRequired, "}") } else if propertyModel.MapType == "string" { - code.Print("// %+v", propertyModel) + code.Print("if m.%s != nil {", propertyModel.FieldName()) + code.Print("for _, item := range m.%s {", propertyModel.FieldName()) + code.Print("info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name))") + code.Print("info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Value))") + code.Print("}") + code.Print("}") } else if propertyModel.MapType != "" { code.Print("if m.%s != nil {", propertyModel.FieldName()) code.Print("for _, item := range m.%s {", propertyModel.FieldName()) diff --git a/openapiv2/OpenAPIv2.go b/openapiv2/OpenAPIv2.go index 0f179076..28c2777d 100644 --- a/openapiv2/OpenAPIv2.go +++ b/openapiv2/OpenAPIv2.go @@ -7887,7 +7887,12 @@ func (m *Oauth2Scopes) ToRawInfo() *yaml.Node { if m == nil { return info } - // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} + if m.AdditionalProperties != nil { + for _, item := range m.AdditionalProperties { + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Value)) + } + } return info } diff --git a/openapiv3/OpenAPIv3.go b/openapiv3/OpenAPIv3.go index 5f4a7025..d54a84db 100644 --- a/openapiv3/OpenAPIv3.go +++ b/openapiv3/OpenAPIv3.go @@ -8560,7 +8560,12 @@ func (m *Strings) ToRawInfo() *yaml.Node { if m == nil { return info } - // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} + if m.AdditionalProperties != nil { + for _, item := range m.AdditionalProperties { + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Value)) + } + } return info }