{{ message }}
fix(openapi): make unsupported-method warning reachable#93
Merged
Conversation
The convert() loop pre-filtered operations to SUPPORTED_HTTP_METHODS, so the validation guard in _create_tool could never run and its warning never fired — dead code. Split the method sets: the loop now filters on the full set of OpenAPI operation methods (so it still skips non-operation path-item keys like parameters/summary/$ref), and _create_tool remains the single place that validates against SUPPORTED_HTTP_METHODS, warning and skipping options/head/ trace operations. Strengthens the skip test to assert the warning is emitted. Bumps utcp-http 1.1.8 -> 1.1.9. Co-Authored-By: Claude Opus 4.8 (1M context) <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.

Problem
P3 dead-code bug introduced in #88.
convert()pre-filtered operations toSUPPORTED_HTTP_METHODS:So unsupported verbs (
options/head/trace) never reached_create_tool, making its validation guard — and the intended skip warning — unreachable dead code.Root cause
The method check was duplicated: once in the loop filter, once in
_create_tool. The loop filter excluded exactly the methods the inner guard was meant to warn about.Fix
Split into two sets:
OPENAPI_OPERATION_METHODS(get/put/post/delete/options/head/patch/trace) — used by the loop only to tell operations apart from non-operation path-item keys (parameters,summary,$ref,servers).SUPPORTED_HTTP_METHODS(the call-template subset) —_create_toolvalidates against this and warns+skips anything else.Now unsupported operations reach
_create_tooland emit the warning instead of being silently dropped.Tests
Strengthened
test_openapi_converter_skips_unsupported_methodsto assert the warning is actually emitted (viacapsys), not just that the tools are absent. Full converter suite: 5 passed.Bumps
utcp-http1.1.8 → 1.1.9.🤖 Generated with Claude Code
Summary by cubic
Fixes a dead-code path in the OpenAPI converter so unsupported HTTP methods emit a warning instead of being silently dropped. Ensures all OpenAPI operations reach validation while still skipping non-operation keys.
OPENAPI_OPERATION_METHODSfor loop filtering; keptSUPPORTED_HTTP_METHODSfor_create_toolvalidation.method.lower()against OpenAPI operations;_create_toolwarns and skipsoptions,head, andtrace.test_openapi_converter_skips_unsupported_methodsto assert the warning viacapsys.utcp-httpto1.1.9.Written for commit a3bb75f. Summary will update on new commits.