Skip to content

Conversation

@ajorgensen
Copy link
Contributor

@ajorgensen ajorgensen commented Oct 29, 2025

context:

Originally, this was changed so that int64 fields would be written to
the openapi spec as integer types which is supported by the OpenAPI
spec. However, jsonpb and other related projects have chosen to enforce
that int64 fields are written as strings. This is because JavaScript
represents integers as 32 bit numbers and if you pass it a value that is
outside of that range it will overflow. Since we are using jsonpb to
transform the protos to json, we need to make sure that the generated
schema is consistent with the jsonpb behavior.

context:
- grpc-ecosystem/grpc-gateway#438
- golang/protobuf#1414
- https://github.com/OpenAPITools/openapi-generator-cli

Originally, this was changed so that int64 fields would be written to
the openapi spec as integer types which is supported by the OpenAPI
spec. However, jsonpb and other related projects have chosen to enforce
that int64 fields are written as strings. This is because JavaScript
represents integers as 32 bit numbers and if you pass it a value that is
outside of that range it will overflow. Since we are using jsonpb to
transform the protos to json, we need to make sure that the generated
schema is consistent with the jsonpb behavior.
@ajorgensen ajorgensen requested a review from a team October 29, 2025 01:28
@ajorgensen ajorgensen force-pushed the aj/handle-int64 branch 2 times, most recently from 3d72650 to 2e9f9d6 Compare October 29, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants