-
Notifications
You must be signed in to change notification settings - Fork 251
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
Generating openapi from proto gives field of type string and format RFC3339 but not vice versa #310
Comments
I'm having a similar issue, but under a slightly different use case. I'm going from Protobuf to OpenAPI to a Rest Client. In that process I'm losing the timestamp type information and ending up with a plain string as well. I believe this is caused by an invalid string
It appears gnostic is inserting "RFC3339" where "date-time" appears to be the correct format value: gnostic/cmd/protoc-gen-openapi/generator/openapi-v3.go Lines 766 to 770 in 3334dd9
I propose that the "RFC3339" format be replaced with the correct "date-time" format. This will enable other tools such as OpenAPI-Generator, etc. to do the right thing when it comes to generating timestamps for each respective language. It's not clear if this was an intentional value that is used downstream, or a simple oversight, but I'd gladly open a PR if the maintainers agree with this change. /cc @morphar @timburks |
Addressed in #319 |
I need such output in my proto
During the conversion from openapi google.protobuf.Timestamp type is being just translated as string.
In openapi I'm defining it as a:
To conclude generating openapi file from proto gives me field with type string and format RFC3339 but when I convert it back to proto the google.protobufTImestamp is lost.
I might be missing something please point me into right direction how I can arrive with google.protobuf.Timestamp responseTime from openapi.
The text was updated successfully, but these errors were encountered: