Skip to content

fix: preserve numeric formats for 64-bit OpenAPI fields - #484

Open
akasakariko wants to merge 1 commit into
google:mainfrom
akasakariko:fix/openapi-int64-format
Open

akasakariko wants to merge 1 commit into
google:mainfrom
akasakariko:fix/openapi-int64-format

Conversation

@akasakariko

Copy link
Copy Markdown

Summary

  • Preserve type: string for ProtoJSON 64-bit numbers while adding the numeric kind to format for int64, uint64, sint64, fixed64 and sfixed64 and Int64Value/UInt64Value wrappers
  • Add NewStringSchemaWithFormat while retaining the existing NewStringSchema signature and behavior
  • Add 39 table-driven regression cases spanning scalar, repeated and map values plus ordinary string and 32-bit controls
  • Regenerate 25 affected OpenAPI golden YAML fixtures

Fixes #483

Testing

  • The new tests failed before the production fix due to missing formats and passed afterward
  • Full repository tests passed
  • Plugin race tests passed
  • Minimum supported Go 1.24.6 plugin build/tests/vet passed
  • go vet ./... passed
  • Formatting and git diff --check passed

Actual test commands:

  • go test -count=1 ./cmd/protoc-gen-openapi/...
  • go test -count=1 ./...
  • go test -race -count=1 ./cmd/protoc-gen-openapi/...
  • go vet ./...
  • GOTOOLCHAIN=go1.24.6 go test -count=1 ./cmd/protoc-gen-openapi/...
  • GOTOOLCHAIN=go1.24.6 go vet ./cmd/protoc-gen-openapi/...
  • gofmt -l on the three changed Go source files and git diff --check

@akasakariko
akasakariko requested a review from a team as a code owner October 6, 2026 04:09
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.

for int64 type is string but format field is not generated

1 participant