docs: document responders for hyphenated HTTP methods#2653
Open
mvanhorn wants to merge 4 commits into
Open
Conversation
vytas7
reviewed
Jun 8, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2653 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 64 64
Lines 7985 7985
Branches 1103 1103
=========================================
Hits 7985 7985 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CaselIT
requested changes
Jun 9, 2026
CaselIT
left a comment
Member
There was a problem hiding this comment.
Prose is fine, just a minor note on the example code
| pass | ||
|
|
||
|
|
||
| resource = VersionControlResource() |
Member
There was a problem hiding this comment.
I would dp this on the class instead
Contributor
Author
There was a problem hiding this comment.
Done in 094df54. Moved the setattr onto the class and verified the example end to end: a VERSION-CONTROL request against the snippet resolves the responder and returns 200.
Per review, set the responder with setattr on the class rather than on a bound instance method.
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.
Summary of Changes
Falcon resolves responders by looking up
on_<method>attributes on a resource. That means a responder for an HTTP method whose name contains a hyphen or other non-alphanumeric character (for example a WebDAV-styleVERSION-CONTROLmethod) cannot be written as an ordinary method, becauseon_version-controlis not a valid Python identifier. This is a real but rare limitation, and the maintainers confirmed in the thread that no routing code change is warranted.Both vytas7 and CaselIT converged on a documentation-only resolution: explain the limitation and show the supported workaround. The agreed workaround is to register the responder imperatively with
setattr(resource, 'on_version-control', handler), which the existing attribute-based dispatch picks up at request time exactly as it would for a normally-named responder.This change adds a short note to the routing docs describing the limitation and that workaround, keeping the example minimal and consistent with the surrounding Google-style docs. It also adds a
2647.misc.rsttowncrier news fragment. No runtime routing or dispatch code is touched, matching the maintainers' stated decision in the issue.Related Issues
Closes #2647
Pull Request Checklist
docs/_newsfragments/(2647.misc.rst)