Skip to content

Derived route names that collide get _2, _3 suffixes (#28) - #30

Merged
thorwhalen merged 2 commits into
masterfrom
fix/unique-derived-route-names-28
Oct 13, 2026
Merged

thorwhalen merged 2 commits into
masterfrom
fix/unique-derived-route-names-28

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Closes #28.

Routes named from operationId or method + path used to collide silently once sanitised (/a-b, /a_b, /a/b all gave get_a_b; last one won, so api_pkg_files dropped routes). HttpClient now suffixes derived names _2, _3, ... in spec order and warns; explicit x-method_name is never changed and is reserved against derived names, and natural names of later routes are reserved against suffixes. The root path / is get_root in HttpClient (openapi_to_py keeps get). Generated packages now require http2py>=0.1.40, the release shipping these names.

Review (fresh Opus adversarial pass): SHIP-WITH-FIXES. Confirmed and fixed: the generated-package floor was too low; the root rename dropped a route in openapi_to_py; a suffix could take a later route's natural name. Documented, not changed: names depend on spec order, so pin with x-method_name; a subclass skipping __init__ knows no explicit names.

Gate: priv test-dependents http2py --transitive: http2py, extrude, py2http pass.

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 13, 2026 07:25
…fixes; '/' is get_root (#28)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t name; raise generated-package floor (#28 review)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit a49d20b into master Oct 13, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the fix/unique-derived-route-names-28 branch October 13, 2026 07:30
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.

Derived route names that collide after sanitizing are not told apart

1 participant