You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generated Go Client code will use t.Format(time.RFC3339) in the function parameterAddToHeaderOrQuery. This call will cause the time object to loose millisecond resolution when adding the query param to the request.
Time object that has the following timestamp 2024-05-14 02:43:39.7551 will be converted to 2024-05-14T02:43:39Z instead of 2024-05-14T02:43:39.7551Z
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g go -o /gen/out/go-petstore -p packageName=petstore
Steps to reproduce
Generate the go code with petstore.yaml
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g go -o /gen/out/go-petstore -p packageName=petstore
Suggest a fix
In file modules/openapi-generator/src/main/resources/go/client.mustache function parameterAddToHeaderOrQuery.
Description
Generated Go Client code will use
t.Format(time.RFC3339)
in the functionparameterAddToHeaderOrQuery
. This call will cause the time object to loose millisecond resolution when adding the query param to the request.Time object that has the following timestamp
2024-05-14 02:43:39.7551
will be converted to2024-05-14T02:43:39Z
instead of2024-05-14T02:43:39.7551Z
openapi-generator version
7.5.0
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
Command line used for generation
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g go -o /gen/out/go-petstore -p packageName=petstore
Steps to reproduce
Generate the go code with petstore.yaml
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g go -o /gen/out/go-petstore -p packageName=petstore
Suggest a fix
In file
modules/openapi-generator/src/main/resources/go/client.mustache
functionparameterAddToHeaderOrQuery
.Using
t.Format(time.RFC3339Nano)
instead oft.Format(time.RFC3339)
will keep the millisecond resolution.Pull Request: #18673
The text was updated successfully, but these errors were encountered: