Skip to content

docs(event_handler): improve routing rules syntax documentation #7094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

dap0am
Copy link
Contributor

@dap0am dap0am commented Aug 1, 2025

Issue number: #2962

Fixes #2962

Summary

This PR addresses issue #2962 by adding comprehensive documentation for routing rules syntax in the Event Handler.

Changes

  • Added detailed "Routing Rules Syntax" section explaining:

    • Dynamic path parameter syntax (<parameter_name>)
    • Supported characters for path parameters (including special chars like -._~()'\\!*:@,;=+&$%<> \[]{}|^)
    • How routes are converted to regex patterns behind the scenes
    • Advanced examples with multiple parameters
    • Complex routing scenarios
  • Enhanced "Catch-all routes" section with:

    • Detailed regex pattern examples
    • Common use cases for proxy routes and file paths
    • Route matching priority explanation
    • Mixed dynamic parameter + regex examples

User experience

Before: Developers had no documentation about routing rules syntax, leading to confusion about:

  • How the <parameter> syntax works
  • What regex patterns are supported
  • What characters are allowed in path parameters
  • How route matching priority works

After: Developers now have comprehensive documentation with:

  • Clear explanation of dynamic path parameter syntax
  • Table showing supported characters in path parameters
  • Examples of complex routing patterns
  • Regex pattern conversion details
  • Route matching behavior and priority rules

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number: N/A

This is a documentation-only change with no breaking changes.

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

Addresses issue aws-powertools#2962 by adding detailed documentation for:
- Dynamic path parameter syntax (<parameter_name>)
- Supported characters in path parameters
- Regex pattern conversion process
- Advanced routing examples with complex parameters
- Catch-all routes with regex patterns
- Route matching priority and behavior

The new documentation provides clear explanations of how routing rules work,
the regex syntax supported, and examples of complex routing patterns that
were previously undocumented.
@dap0am dap0am requested a review from a team as a code owner August 1, 2025 22:42
@dap0am dap0am requested a review from anafalcao August 1, 2025 22:42
Copy link

boring-cyborg bot commented Aug 1, 2025

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Aug 1, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 1, 2025
@leandrodamascena leandrodamascena requested review from leandrodamascena and removed request for anafalcao August 2, 2025 11:10
@leandrodamascena leandrodamascena changed the title docs: add comprehensive routing rules syntax documentation docs(event_handler): improve routing rules syntax documentation Aug 4, 2025
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dap0am thanks a lot for working in this PR! I left some comments before we move to the next round of review.

Please let me know if you have any question.

@dap0am
Copy link
Contributor Author

dap0am commented Aug 4, 2025

Hey @dap0am thanks a lot for working in this PR! I left some comments before we move to the next round of review.

Please let me know if you have any question.

Thanks for the comment @leandrodamascena , will work on them as soon as possible.

- Remove redundant routing rules syntax introduction section
- Update header levels from h5 to h4 for better hierarchy
- Move inline code examples to separate files in examples/event_handler_rest/src
- Add proper Lambda handlers with Logger and Tracer utilities
- Reorganize content by moving regex pattern table to Dynamic Path Parameters section
- Update tip formatting to match project style
- Simplify inline comments to follow project conventions
@dap0am
Copy link
Contributor Author

dap0am commented Aug 4, 2025

Hi @leandrodamascena all comments has been actioned, please review and let me know if there is anything that I missed. Thank you.

@leandrodamascena leandrodamascena linked an issue Aug 5, 2025 that may be closed by this pull request
1 task
Copy link

sonarqubecloud bot commented Aug 5, 2025

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dap0am, thank you so much for working on this PR! I just made a few minor final changes to follow some documentation guidelines we have, but nothing you missed!

It was great working with you on this PR! I'm opening more issues that might be interesting to work on. I hope to see you again here.

APPROVED!

Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.35%. Comparing base (bc06dfc) to head (57dde37).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7094   +/-   ##
========================================
  Coverage    96.35%   96.35%           
========================================
  Files          275      275           
  Lines        12980    12980           
  Branches       965      965           
========================================
  Hits         12507    12507           
  Misses         366      366           
  Partials       107      107           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena leandrodamascena merged commit bc3fcd5 into aws-powertools:develop Aug 5, 2025
16 checks passed
Copy link

boring-cyborg bot commented Aug 5, 2025

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@dap0am
Copy link
Contributor Author

dap0am commented Aug 5, 2025

Hi @dap0am, thank you so much for working on this PR! I just made a few minor final changes to follow some documentation guidelines we have, but nothing you missed!

It was great working with you on this PR! I'm opening more issues that might be interesting to work on. I hope to see you again here.

APPROVED!

No worries @leandrodamascena , will keep an eye on the issues to see if I fancy anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Syntax for routing rules doesn't seem to be documented anywhere
3 participants