Skip to content
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

Reason to convert int64 to string type #3

Open
kak-tus opened this issue Mar 10, 2024 · 1 comment
Open

Reason to convert int64 to string type #3

kak-tus opened this issue Mar 10, 2024 · 1 comment

Comments

@kak-tus
Copy link

kak-tus commented Mar 10, 2024

What is reason to convert like this?

	"int64":    {Type: "string", Format: "int64"},

In OpenAPI 3 we can use "integer" type with "int64" format.

As I see in twirp-swagger-gen - same conversion.

@creker
Copy link

creker commented Nov 28, 2024

It's due to Protobuf JSON spec https://protobuf.dev/programming-guides/json/

int64, fixed64, uint64 string "1", "-10" JSON value will be a decimal string. Either numbers or strings are accepted. Empty strings are invalid.

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

No branches or pull requests

2 participants