Repository navigation
Name routes without x-method_name; pin http2py floor in generated packages (#25, #26) - #27
Merged
Merged
Conversation
…ackages (#25, #26) A route with no x-method_name is now named from its operationId, else from method + path, so such routes no longer all register as request_func. Generated setup.cfg requires http2py>=0.1.37, the first release with HttpClient.routes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gnore the server base path Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes #26, fixes #25.
x-method_nameis named from itsoperationId(made a safe identifier), else from method + path via the existingdefault_path_to_func_name(get /users/{id}givesget_users_id).x-method_namestill wins and is used verbatim. The path is the spec's, so the server base url does not change names. The duplicate-name warning from Routes live in client.routes; a route name cannot replace a client attribute (#23) #24 stays for genuine collisions.setup.cfgnow requireshttp2py>=0.1.37(MIN_HTTP2PY_VERSIONinapi_pkg_maker), the first PyPI release containingHttpClient.routes(checked in the 0.1.37 wheel). A constant rather thanhttp2py.__version__at generation time, because a dev or unreleased version would otherwise be pinned, giving an unnecessarily high floor.tests/test_route_namespace.py; suite passes (89). Dependents gate (priv test-dependents http2py --transitive: http2py, extrude, py2http) passes.Adversarial review (fresh Opus subagent): confirmed (1) an operationId that sanitizes to nothing was used raw, and (2) the server base path leaked into derived names; both fixed in the second commit with tests. (3) Names that collide after sanitizing are not told apart: not a regression, filed as a follow-up issue.
🤖 Generated with Claude Code