-
Notifications
You must be signed in to change notification settings - Fork 18.5k
fix: Failed to load API definition #28509
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @changkeke, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that prevented the API definition from loading correctly. The core problem stemmed from Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Please resolve those conflicts |
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.
Code Review
This pull request correctly addresses the issue where flask_restx fails to render API definitions that use dict instead of registered models. The changes are extensive, replacing dictionary-based field definitions with api.model() across many controllers, which is a crucial fix for generating correct API documentation. I've identified one high-severity issue where an endpoint's response schema will not match its actual output, and I've also included a medium-severity suggestion to improve code maintainability by centralizing common model definitions.
Resolved |
|
How about using the method #28236 mentioned here. |
Related to #25628 and #24421
In flask_restx, the
@marshal_withand@api.responsedecorators must use models registered viaapi.modelinstead ofdict; otherwise, proper rendering will not be achieved.The following is the error log:
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods