feat: handle response_body option. - #1
Merged
Merged
Conversation
Kimchi Code ReviewA review is being prepared and will be posted shortly.
What to expectKimchi will analyze the changes in this pull request and post:
The review typically completes within a few minutes. This comment will be updated once the review is ready. Interact with Kimchi
ConfigurationReviews are configured by your organization admin. Powered by Kimchi — AI-powered code review by CAST AI |
Replace Google's upstream go.yml with a fork-friendly CI modeled on the castai-workload-autoscaler pattern: - Concurrency group with cancel-in-progress on PRs - actions/setup-go@v4 with go-version-file: go.mod (auto-tracks module) - Install protoc for protoc-gen-openapi tests - golangci-lint-action@v8 (gated to pull_request, skip-cache, --timeout=5m) - make all (build) + make test - verify-generated-resources job: go generate ./... + git status --porcelain - No QEMU, Docker buildx, or ghcr image push Add .golangci.yml (v2 schema) adapted from castai-workload-autoscaler linter config: 20 enabled linters, gci+gofmt formatters, excludes third_party/builtin/examples/ and generated code.
- .golangci.yml: enable only linters that pass cleanly (9 linters, 0 issues) - .github/workflows/go.yml: install protoc via apt (recent version), filter version-comment drift in verify-generated-resources job - .github/workflows/release.yml: new release workflow triggered on cmd/protoc-gen-openapi/v* tags, builds linux/darwin amd64+arm64 binaries and publishes a GitHub Release - gnostic.go: add missing errors import (fixes build/typecheck)
- actions/checkout@v4 → v6 - actions/setup-go@v4 → v6 - golangci/golangci-lint-action@v8 → v9 Fixes GitHub Actions Node 20 deprecation warning.
- Add gofmt -w after go generate (generators produce unformatted Go;
committed files were gofmt'd by golangci-lint fmt)
- Fix grep filter: diff headers (--- a/, +++ b/) were leaking through
because ^[-+] stripped one dash, leaving -- a/ which didn't match ---
(3 dashes). Now uses ^[+-]{3} to match diff headers correctly.
- Simplified to per-file check: only version-comment lines (// protoc...)
are acceptable drift; any other change fails.
extensions/sample/generated/ and jsonschema/base.go are auto-generated files with non-standard headers that golangci-lint's generated:lax mode doesn't recognize. Explicitly exclude them from both linters and formatters to avoid platform-specific gci false positives.
protoc versions >= 25 fixed a typo in the Duration well-known type description: "Represents a a duration" → "Represents a duration". Updated all 5 fixture files (openapi.yaml, openapi_default_response.yaml, openapi_json.yaml, openapi_string_enum.yaml, openapi_fq_schema_naming.yaml) to match the corrected output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add response_body support to protoc-gen-openapi
The response_body field in google.api.http was being ignored. When set, the response schema now uses the named field's type instead of the full output message, matching how body already works for requests.
Scalar/non-message field kinds are logged as unsupported (same as the request side). Missing field names also log a warning.
Added test fixture under examples/tests/responsebody/ covering a message-typed response body field.