-
Notifications
You must be signed in to change notification settings - Fork 420
fix(event_handler): OpenAPI schema version respects Pydantic version #3860
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
@rubenfonseca Note that the swagger-ui version that aws-lambda-powertools ships (4.x) doesn't support OpenAPI schema version 3.1.x – you'll get an error when using it (the entire ui is inaccessible):
It does seem like passing See compatibility table here: https://github.com/swagger-api/swagger-ui?tab=readme-ov-file#compatibility |
This is awesome feedback, thank you so much @kbakk ! |
I've updated Swagger-UI to 5.x and verified that it works when using Pydantic v2 (which generated a 3.1.0 schema). @leandrodamascena this is now ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rubenfonseca! I left some comments and we need to resolve them before I review this PR again and merge. Thanks for fixing this issue.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APPROVED!
Issue number: #3731
Summary
Changes
This PR forces the OpenAPI schema version to follow the Pydantic version. Pydantic v1 only generates OpenAPI Schema 3.0.x, and Pydantic v2 only generates OpenAPI Schema 3.1.x.
List of tasks in this PR:
Pending items:
Updated Bedrock Agents documentation to explain why it will not work if you use Pydantic v2 (Agents for Amazon Bedrock seems to only support 3.0.x OpenAPI schemas)moved this checklist to the Bedrock Agents PRUser experience
After this change, the generated OpenAPI schema should always validate correctly against the official schemas
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
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.