refactor(api): migrate console recommended-app response to BaseModel#35206
Merged
asukaminato0721 merged 3 commits intolanggenius:mainfrom Apr 14, 2026
Conversation
Contributor
Pyrefly DiffNo changes detected. |
Contributor
Pyrefly DiffNo changes detected. |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the console “recommended apps” list endpoint to return responses serialized via Pydantic BaseModel/ResponseModel schemas registered with register_schema_models(), replacing Flask-RESTX api.model(...)/@marshal_with while preserving the documented response shape and icon_url behavior.
Changes:
- Replace Flask-RESTX field models/marshalling with Pydantic response schemas for
/explore/apps. - Add computed
icon_urlon the response model based onicon_type/icon. - Add unit tests covering response model serialization and
icon_urlcomputation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
api/controllers/console/explore/recommended_app.py |
Migrates the recommended-app list response to ResponseModel Pydantic schemas and registers them for Swagger docs. |
api/tests/unit_tests/controllers/console/explore/test_recommended_app.py |
Adds tests for the new response models and their computed icon_url behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
api/tests/unit_tests/controllers/console/explore/test_recommended_app.py
Outdated
Show resolved
Hide resolved
auto-merge was automatically disabled
April 14, 2026 19:28
Head branch was pushed to by a user without write access
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-14 19:29:45.065830142 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-14 19:29:34.745611640 +0000
@@ -1,5 +1,5 @@
ERROR Object of class `App` has no attribute `access_mode` [missing-attribute]
- --> controllers/console/app/app.py:561:13
+ --> controllers/console/app/app.py:552:13
ERROR Argument `str | None` is not assignable to parameter `language` with type `str` in function `services.account_service.AccountService.send_email_register_email` [bad-argument-type]
--> controllers/console/auth/email_register.py:75:108
ERROR Object of class `MissingRouter` has no attribute `get` [missing-attribute]
|
asukaminato0721
approved these changes
Apr 14, 2026
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
Migrate console recommended-app list response from Flask-RESTX
api.model(...)/@marshal_withto PydanticBaseModelschemas registered viaregister_schema_models(). Preserve response shape and icon URL behavior with computedicon_urlbased onicon_type.Checklist
make lintandmake type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods