Skip to content

fix: use TitleCase for cancel endpoint path parameter title#2913

Merged
markphelps merged 1 commit intoschema-compare-harnessfrom
fix-schema-param-title
Apr 7, 2026
Merged

fix: use TitleCase for cancel endpoint path parameter title#2913
markphelps merged 1 commit intoschema-compare-harnessfrom
fix-schema-param-title

Conversation

@markphelps
Copy link
Copy Markdown
Contributor

Summary

One-line fix for a schema mismatch between the static (Go) and runtime (Python) schema generators.

The bug

The static schema generator used TitleCaseSingle for the cancel endpoint's path parameter title, which only uppercases the first character:

TitleCaseSingle("prediction_id") → "Prediction_id"  // wrong
TitleCase("prediction_id")       → "Prediction Id"   // correct (matches Python)

The Python runtime hardcodes the correct "Prediction Id" title, so the two schemas diverged.

The fix

pkg/schema/openapi.go:232 — change TitleCaseSingle(cancelParam) to TitleCase(cancelParam).

Found by the test harness schema-compare command.

The static schema generator was using TitleCaseSingle (which only
uppercases the first character) instead of TitleCase (which splits on
underscores) for the cancel endpoint path parameter. This produced
"Prediction_id" instead of "Prediction Id", diverging from the
Python runtime schema generator.

Found by the test harness schema-compare command.
@markphelps markphelps requested a review from a team as a code owner April 7, 2026 18:49
@ask-bonk
Copy link
Copy Markdown

ask-bonk bot commented Apr 7, 2026

LGTM

github run

@markphelps markphelps requested a review from michaeldwan April 7, 2026 18:58
@markphelps markphelps merged commit a2883e3 into schema-compare-harness Apr 7, 2026
51 of 53 checks passed
@markphelps markphelps deleted the fix-schema-param-title branch April 7, 2026 20:00
github-merge-queue bot pushed a commit that referenced this pull request Apr 7, 2026
* feat: add schema-compare command to test harness

Add a new `schema-compare` command that builds each model twice — once
with COG_STATIC_SCHEMA=1 (Go tree-sitter) and once without (Python
runtime) — then compares the resulting OpenAPI schemas for exact JSON
equality. Differences are reported with a structured diff showing the
exact JSON paths that diverge.

Also add 7 local fixture models covering the full input type matrix:
scalar types, optional types (PEP 604 + typing.Optional), list types,
optional list types, constraints/choices, File/Path types, and
structured BaseModel output.

* feat(test-harness): add --cog-ref flag and parallel schema builds

Add --cog-ref to build cog CLI + SDK wheel from any git ref (branch,
tag, or commit SHA), enabling testing against main or feature branches
without manual builds. When used, the SDK wheel is automatically built
from the same ref and passed via COG_SDK_WHEEL.

Also parallelize the static/runtime builds in schema-compare using
ThreadPoolExecutor with distinct image tags, roughly halving wall-clock
time per model.

Extract _resolve_versions() helper to consolidate version resolution
logic across all commands and produce clearer log output (no spurious
PyPI lookups when --cog-ref provides a wheel).

* fix: use TitleCase for cancel endpoint path parameter title (#2913)

The static schema generator was using TitleCaseSingle (which only
uppercases the first character) instead of TitleCase (which splits on
underscores) for the cancel endpoint path parameter. This produced
"Prediction_id" instead of "Prediction Id", diverging from the
Python runtime schema generator.

Found by the test harness schema-compare command.

---------

Co-authored-by: Michael Dwan <code@michaeldwan.com>
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.

2 participants