Skip to content

feat(event_handler): add support for externalDocs attribute in OpenAPI schema #6945

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

Merged

Conversation

mhindery
Copy link
Contributor

@mhindery mhindery commented Jul 4, 2025

Issue number: #6948

Summary

OpenAPI generation: add support for passing the top-level externalDocs property in the schema generation.

See the field in the spec on https://swagger.io/docs/specification/v3_0/api-general-info/

Changes

A data model for ExternalDocumentation was already present in this repo. It was however not possible to pass it through in the configure_openapi() method, so it could not be specified by users. This PR adds an argument to this method (and similarly to the enable_swagger()) where such an object can be passed.

User experience

After this PR, users can pass in a link to external documentation to be put in the generated OpenAPI spec.

Checklist

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

Is this a breaking change?

No, the new argument is an optional one.

RFC issue number:

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.

@mhindery mhindery requested a review from a team as a code owner July 4, 2025 09:15
@mhindery mhindery requested a review from leandrodamascena July 4, 2025 09:15
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 4, 2025
Copy link

boring-cyborg bot commented Jul 4, 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

@leandrodamascena leandrodamascena changed the title feat: OpenAPI: support setting externalDocs attribute in schema feat(event_handler): add support for externalDocs attribute in OpenAPI schema Jul 4, 2025
@github-actions github-actions bot added the feature New feature or functionality label Jul 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 @mhindery thanks for sending this PR! Can you please fix the error in CI? Just need to remove the extra import.

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.

We need to fix this as well.

mhindery and others added 2 commits July 4, 2025 16:35
Co-authored-by: Leandro Damascena <[email protected]>
Signed-off-by: Mathieu Hinderyckx <[email protected]>
Copy link

sonarqubecloud bot commented Jul 4, 2025

Copy link

codecov bot commented Jul 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.20%. Comparing base (eaedf5e) to head (29cc623).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6945   +/-   ##
========================================
  Coverage    96.20%   96.20%           
========================================
  Files          273      273           
  Lines        12709    12713    +4     
  Branches       949      950    +1     
========================================
+ Hits         12227    12231    +4     
  Misses         377      377           
  Partials       105      105           

☔ 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 self-requested a review July 4, 2025 16:37
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.

Thanks for this PR @mhindery! Approved.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution and congrats for your first PR merged in this project 🎉 !

Whenever you can, please leave a comment under the original issue so we can assign it to you and track it properly (GitHub doesn't allow us to assign it without you interacting with it first).

Thanks

@leandrodamascena leandrodamascena merged commit 318036f into aws-powertools:develop Jul 4, 2025
12 checks passed
Copy link

boring-cyborg bot commented Jul 4, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_handlers feature New feature or functionality size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: add Support for Top-level externalDocs property in OpenAPI schema
3 participants