refactor: remove marshal_with and inline api.model from app_import#34934
Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom Apr 13, 2026
Merged
Conversation
Contributor
Pyrefly DiffNo changes detected. |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the console app import controller to rely on Pydantic JSON serialization and centralized schema registration, removing legacy Flask-RESTX marshalling and inline Swagger model definitions.
Changes:
- Removed
@marshal_withusage and associated Flask-RESTXfields/app_fieldsmodel wiring fromapp_import.py. - Switched Swagger schema registration for the request payload to
register_schema_models(). - Cleaned up unused imports related to marshalling and field-based models.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Pyrefly DiffNo changes detected. |
asukaminato0721
approved these changes
Apr 13, 2026
HanqingZ
pushed a commit
to HanqingZ/dify
that referenced
this pull request
Apr 23, 2026
…anggenius#34934) Co-authored-by: ai-hpc <ai-hpc@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #28015
Summary
Remove
@marshal_withdecorators and inlineconsole_ns.model()definitions fromapp_import.py. The endpoints already serialize responses via Pydantic's.model_dump(mode="json"), making@marshal_withredundant. Useregister_schema_models()instead of manualschema_model()for Swagger registration. Remove unusedfields,marshal_with, andapp_fieldsimports.Checklist
make lintandmake type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods