avoid panic on empty swagger info element

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-11-25 23:10:54 +03:00
parent f814b489db
commit f6cfb2de1e

View File

@ -87,7 +87,9 @@ func (g *openapiv3Generator) buildDocumentV3(plugin *protogen.Plugin) *v3.Docume
if doc.Openapi != "" {
d.Openapi = doc.Openapi
}
d.Info = proto.Clone(doc.Info).(*v3.Info)
if doc.Info != nil {
d.Info = proto.Clone(doc.Info).(*v3.Info)
}
d.Servers = append(d.Servers, doc.Servers...)
}