@@ -1193,6 +1193,61 @@ func TestSchemaOfField(t *testing.T) {
11931193 Format : "boolean" ,
11941194 },
11951195 },
1196+ {
1197+ field : & descriptor.Field {
1198+ FieldDescriptorProto : & protodescriptor.FieldDescriptorProto {
1199+ Name : proto .String ("wrapped_field" ),
1200+ TypeName : proto .String (".google.protobuf.Struct" ),
1201+ Type : protodescriptor .FieldDescriptorProto_TYPE_MESSAGE .Enum (),
1202+ },
1203+ },
1204+ refs : make (refMap ),
1205+ expected : schemaCore {
1206+ Type : "object" ,
1207+ },
1208+ },
1209+ {
1210+ field : & descriptor.Field {
1211+ FieldDescriptorProto : & protodescriptor.FieldDescriptorProto {
1212+ Name : proto .String ("wrapped_field" ),
1213+ TypeName : proto .String (".google.protobuf.Value" ),
1214+ Type : protodescriptor .FieldDescriptorProto_TYPE_MESSAGE .Enum (),
1215+ },
1216+ },
1217+ refs : make (refMap ),
1218+ expected : schemaCore {
1219+ Type : "object" ,
1220+ },
1221+ },
1222+ {
1223+ field : & descriptor.Field {
1224+ FieldDescriptorProto : & protodescriptor.FieldDescriptorProto {
1225+ Name : proto .String ("wrapped_field" ),
1226+ TypeName : proto .String (".google.protobuf.ListValue" ),
1227+ Type : protodescriptor .FieldDescriptorProto_TYPE_MESSAGE .Enum (),
1228+ },
1229+ },
1230+ refs : make (refMap ),
1231+ expected : schemaCore {
1232+ Type : "array" ,
1233+ Items : (* swaggerItemsObject )(& schemaCore {
1234+ Type : "object" ,
1235+ }),
1236+ },
1237+ },
1238+ {
1239+ field : & descriptor.Field {
1240+ FieldDescriptorProto : & protodescriptor.FieldDescriptorProto {
1241+ Name : proto .String ("wrapped_field" ),
1242+ TypeName : proto .String (".google.protobuf.NullValue" ),
1243+ Type : protodescriptor .FieldDescriptorProto_TYPE_MESSAGE .Enum (),
1244+ },
1245+ },
1246+ refs : make (refMap ),
1247+ expected : schemaCore {
1248+ Type : "string" ,
1249+ },
1250+ },
11961251 {
11971252 field : & descriptor.Field {
11981253 FieldDescriptorProto : & protodescriptor.FieldDescriptorProto {
0 commit comments