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

Standard json type mapped from protobuf int64 is string #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cytommi
Copy link

@cytommi cytommi commented Feb 7, 2024

JSON value will be a decimal string. Either numbers or strings are accepted.

https://protobuf.dev/programming-guides/proto3/#json

Users of protojson have also been confused by encodings for int64 types being strings.
golang/protobuf#1414

This PR should ensure that the generated docs are in line with the protobuf standard.

@solo-build-bot
Copy link

solo-build-bot bot commented Feb 7, 2024

Waiting for approval from someone in the solo-io org to start testing.

@cytommi cytommi force-pushed the main branch 2 times, most recently from 5628747 to 9596e14 Compare February 7, 2024 22:29
@nfuden
Copy link

nfuden commented Apr 30, 2024

@shashankram how does this mesh or not mesh with discussions around the string versus int marshalling issues we had talked about .

@shashankram
Copy link
Contributor

@shashankram how does this mesh or not mesh with discussions around the string versus int marshalling issues we had talked about .

Since we primarily use this library to generate Kubernetes CRD schemas, we set use x-kubernetes-int-or-string to get around this. I understand the motivation of this PR though.

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.

3 participants