Skip to content

docs(apigateway): add all resolvers in testing your code section for accuracy #1688

New issue

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

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

Already on GitHub? # to your account

Merged
merged 11 commits into from
Nov 9, 2022
Merged

docs(apigateway): add all resolvers in testing your code section for accuracy #1688

merged 11 commits into from
Nov 9, 2022

Conversation

bnsouza
Copy link

@bnsouza bnsouza commented Nov 7, 2022

Issue number: #1686

Summary

Changes

I've changed the example for testing API Gateway. Changed the examples/event_handler_rest/src/assert_http_response.py and docs/core/event_handler/api_gateway.md.

Checklist

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

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.


View rendered docs/core/event_handler/api_gateway.md

Bruno Souza added 2 commits November 7, 2022 17:09
Signed-off-by: Bruno Souza <bruno@komu.com.br>
Signed-off-by: Bruno Souza <bruno@komu.com.br>
@bnsouza bnsouza requested a review from a team as a code owner November 7, 2022 20:17
@bnsouza bnsouza requested review from mploski and removed request for a team November 7, 2022 20:17
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Nov 7, 2022
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 7, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 7, 2022

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 AWS Lambda Powertools Discord: Invite link

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 8, 2022
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2022
@heitorlessa heitorlessa requested review from heitorlessa and removed request for mploski November 8, 2022 17:05
@heitorlessa
Copy link
Contributor

@bnsouza could you review the changes I've made just in case I missed anything?

Changes:

  • Split testing snippets per resolver to prevent the confusion we've had
  • Ensure imports, minimal_event, and correlation path used match the specific resolver

Copy link
Author

@bnsouza bnsouza left a comment

Choose a reason for hiding this comment

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

It's perfect! If you don't mind, can I insert as a comment the URL from AWS Docs with full examples of the events payload?

I had to search because when I tested with query parameters, I made it wrong! 🤣

Bruno Souza added 4 commits November 8, 2022 17:22
Signed-off-by: Bruno Souza <bruno@komu.com.br>
Signed-off-by: Bruno Souza <bruno@komu.com.br>
Signed-off-by: Bruno Souza <bruno@komu.com.br>
Signed-off-by: Bruno Souza <bruno@komu.com.br>
@bnsouza
Copy link
Author

bnsouza commented Nov 8, 2022

I made it! But if you think it's better remove or change, it's ok!

Abraços!

@heitorlessa
Copy link
Contributor

np at all! For future reference, we add all variants of the payloads we encounter under "test/events" - we found docs not to be a reliable source at times

https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/tests/events/apiGatewayProxyV2Event.json

@heitorlessa heitorlessa changed the title docs: Fix example for testing API Gateway REST/HTTP API docs(apigateway): add all resolvers in testing your code section for accuracy Nov 9, 2022
@heitorlessa
Copy link
Contributor

Merging now - thank you again! Nice touch on adding the payload link as a comment!

@heitorlessa heitorlessa merged commit 4d6026c into aws-powertools:develop Nov 9, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 9, 2022

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

@bnsouza bnsouza deleted the docs/fix-example-test-apigateway branch November 9, 2022 12:12
heitorlessa added a commit to ascopes/aws-lambda-powertools-python that referenced this pull request Nov 14, 2022
* develop: (155 commits)
  chore: apigw test event wrongly set with base64
  chore(deps-dev): bump types-requests from 2.28.11.3 to 2.28.11.4 (aws-powertools#1701)
  update changelog with latest changes
  feat(apigateway): multiple exceptions in exception_handler (aws-powertools#1707)
  chore(deps-dev): bump mypy-boto3-logs from 1.25.0 to 1.26.3 (aws-powertools#1702)
  update changelog with latest changes
  chore(ci): revert custom hw for E2E due to lack of hw
  update changelog with latest changes
  docs: project name consistency
  chore(ci): prevent dependabot updates to trigger E2E
  chore(ci): use new custom hw for E2E
  chore(ci): limit to src only to prevent dependabot failures
  update changelog with latest changes
  docs(examples): linting unnecessary whitespace
  chore(deps-dev): bump pytest-xdist from 2.5.0 to 3.0.2 (aws-powertools#1655)
  update changelog with latest changes
  docs(apigateway): add all resolvers in testing your code section for accuracy (aws-powertools#1688)
  chore(deps-dev): bump mkdocs-material from 8.5.7 to 8.5.9 (aws-powertools#1697)
  update changelog with latest changes
  docs(homepage): update default value for `POWERTOOLS_DEV` (aws-powertools#1695)
  ...
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation event_handlers 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.

2 participants