Skip to content

feat: handle response_body option. - #1

Merged
jozuenoon merged 12 commits into
mainfrom
feat/handle-response-body-option
Jul 30, 2026
Merged

jozuenoon merged 12 commits into
mainfrom
feat/handle-response-body-option

Conversation

@jozuenoon

Copy link
Copy Markdown

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.

@kimchi-review

kimchi-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

Kimchi Code Review

A review is being prepared and will be posted shortly.

Property Value
Commit eb34914
Author @jozuenoon
Files changed 8
Review status Pending
What to expect

Kimchi will analyze the changes in this pull request and post:

  • A summary of the overall changes
  • Inline comments on specific lines with findings categorized by issue type

The review typically completes within a few minutes. This comment will be updated once the review is ready.

Interact with Kimchi
  • @getkimchi review — re-trigger a full review on the latest commit
  • @getkimchi summary — regenerate the PR summary
  • @getkimchi ignore — skip this PR (no review will be posted)
  • Reply to any inline comment to ask follow-up questions or request clarification
Configuration

Reviews are configured by your organization admin.
Review instructions, excluded directories, and severity thresholds can be adjusted per repository in the Kimchi dashboard.


Powered by Kimchi — AI-powered code review by CAST AI

jozuenoon added 11 commits July 29, 2026 14:26
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.
@jozuenoon jozuenoon self-assigned this Jul 29, 2026
@jozuenoon
jozuenoon merged commit 1654ece into main Jul 30, 2026
2 checks passed
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.

1 participant