@@ -83,7 +83,7 @@ func (g *Generator) buildSchema(doc *openapi3.T, message *protogen.Message, pare
8383 fieldSchemaRef .Value .Example = example
8484 }
8585
86- // Try to set deprecated
86+ // Deprecated option.
8787 if standardOptions , ok := field .Desc .Options ().(* descriptorpb.FieldOptions ); ok {
8888 fieldSchemaRef .Value .Deprecated = standardOptions .GetDeprecated ()
8989 }
@@ -172,7 +172,7 @@ func (g *Generator) buildSchema(doc *openapi3.T, message *protogen.Message, pare
172172 msg := allMessages .Get (fieldMessageName )
173173 if msg != nil {
174174 // Use the message to build it out inline instead of using a ref.
175- err := g .buildSchema (doc , msg , fieldSchemaRef )
175+ err := g .buildSchema (doc , msg , fieldSchemaRef . Value . Items )
176176 if err != nil {
177177 return err
178178 }
@@ -223,7 +223,7 @@ func newSchemaRef(name string) string {
223223func newFieldSchema (field protoreflect.FieldDescriptor ) * openapi3.Schema {
224224 kind := field .Kind ()
225225 schema := & openapi3.Schema {
226- Type : protoKindToAPIType (field . Kind () ),
226+ Type : protoKindToAPIType (kind ),
227227 Properties : make (openapi3.Schemas ),
228228 }
229229
@@ -238,11 +238,14 @@ func newFieldSchema(field protoreflect.FieldDescriptor) *openapi3.Schema {
238238// protoKindToAPIType returns an OAPI type based on the proto kind sent.
239239func protoKindToAPIType (kind protoreflect.Kind ) string {
240240 switch kind {
241- case protoreflect .StringKind :
241+ case protoreflect .StringKind ,
242+ protoreflect .Int64Kind ,
243+ protoreflect .Uint64Kind ,
244+ protoreflect .Sint64Kind :
242245 return openapi3 .TypeString
243- case protoreflect .Int32Kind , protoreflect . Int64Kind ,
244- protoreflect .Uint32Kind , protoreflect . Uint64Kind ,
245- protoreflect .Sint32Kind , protoreflect . Sint64Kind :
246+ case protoreflect .Int32Kind ,
247+ protoreflect .Uint32Kind ,
248+ protoreflect .Sint32Kind :
246249 return openapi3 .TypeInteger
247250 case protoreflect .BoolKind :
248251 return openapi3 .TypeBoolean
0 commit comments