-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protobuf well known types aren't represented in swagger output correctly #160
Comments
@yugui do you have thoughts here on how we should handle this problem? I'm happy to hack on a patch but have only been lightly watching the swagger and marshaler work. |
I don't have much idea. But the number of the well-known types is limited. So we could extend the mapping table to the swagger types. |
@tmc with #209 in that provides a template for handling the custom times. The special types are as follows:
Do you need any of the other ones? |
Bump, and confirm that the issue is still there |
Why is this? The Timestamp type by default will serialize as |
There is a set of well known types that are special coded in the proto3 spec when they are converted to JSON. This is the spec for duration https://github.com/golang/protobuf/blob/master/jsonpb/jsonpb.go#L167 |
I believe this has been fixed in recent months. |
Durations appear in swagger as {"seconds": 0, "nanos": 0} though jsonpb marshals and unmarshals them in a string form like: "45.000s"
The text was updated successfully, but these errors were encountered: