Skip to content

Commit

Permalink
tests and fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
puellanivis committed Sep 19, 2024
1 parent 812af6b commit 0b326c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/converter/testdata/proto/WellKnown.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ message WellKnown {
map<int32, int32> map_of_scalar_integers = 3;
repeated google.protobuf.Int32Value list_of_integers = 4;

google.protobuf.BoolValue bool_value = 5;
google.protobuf.BoolValue bool_value = 5; // description
google.protobuf.BytesValue bytes_value = 6;
google.protobuf.DoubleValue double_value = 7;
google.protobuf.Duration duration = 8;
Expand Down
3 changes: 2 additions & 1 deletion internal/converter/testdata/wellknown.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const WellKnown = `{
{
"type": "boolean"
}
]
],
"description": "description"
},
"bytes_value": {
"oneOf": [
Expand Down
3 changes: 2 additions & 1 deletion internal/converter/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ func (c *Converter) convertField(curPkg *ProtoPackage, desc *descriptor.FieldDes
case pkgName == ".google.protobuf":
jsonSchemaType.Type = recursedJSONSchemaType.Type
jsonSchemaType.OneOf = recursedJSONSchemaType.OneOf
return recursedJSONSchemaType, nil
jsonSchemaType.AdditionalProperties = nil
return jsonSchemaType, nil

// Objects:
default:
Expand Down

0 comments on commit 0b326c7

Please sign in to comment.