Skip to content

fix(openapi): parse YAML responses as binary so the spec sync generates - #374

Closed
subnetmarco wants to merge 2 commits into
mainfrom
fix/openapi-sync
Closed

subnetmarco wants to merge 2 commits into
mainfrom
fix/openapi-sync

Conversation

@subnetmarco

Copy link
Copy Markdown
Member

Summary

The automatic OpenAPI sync from Kong/volcano-hosting (sync-openapi-consumers.yml, job "Sync volcano-sdk-python") has failed on every run, while the CLI, JS, Ruby and web syncs pass. Because of that, the standing chore/sync-openapi PR here stopped updating after 2026-09-19.

Cause. The Hosting spec now documents GET /openapi.yaml (and HEAD), whose 200 response is application/yaml. openapi-python-client can't parse that content type, so it warns:

WARNING parsing GET /openapi.yaml within system.
Cannot parse response for status code 200 (Unsupported content_type {'application/yaml': ...})

scripts/generate_openapi.py runs the generator with --fail-on-warning, so the warning fails the job.

Fix. Add application/yaml: application/octet-stream to content_type_overrides in openapi-python-client.yaml, the same way the binary image types are already handled. The generated operation returns the raw bytes, and the wire Content-Type is unchanged.

Validation

  • Reproduced the sync job locally with uv 0.12.17: copied Hosting main's api/openapi.bundled.yaml into openapi/openapi.yaml and ran scripts/generate_openapi.py. It fails on main with the warning above and exits 0 with this change. python -m scripts.check_openapi then reports "OpenAPI generated client is up to date".
  • With the repository's current spec, the change leaves the committed generated client untouched (check_openapi passes), so this PR only unblocks the next sync.
  • scripts/check_quality_policy.sh passes.

The Hosting spec now documents GET /openapi.yaml with an application/yaml response. openapi-python-client cannot parse that content type, and the generator runs with --fail-on-warning, so every automatic spec sync failed. Map application/yaml to application/octet-stream as the binary image types already are; the wire Content-Type is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@subnetmarco
subnetmarco requested a review from a team as a code owner September 27, 2026 18:56
@subnetmarco
subnetmarco enabled auto-merge (squash) October 6, 2026 19:24
@subnetmarco
subnetmarco disabled auto-merge October 6, 2026 20:41
@subnetmarco

Copy link
Copy Markdown
Member Author

Superseded: main already maps application/yaml to application/octet-stream in openapi-python-client.yaml, so after updating the branch this PR only adds a duplicate key, which the generator rejects ("Unable to parse config").

@subnetmarco subnetmarco closed this Oct 6, 2026
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