chore: add script to generate openapi v2 json and add in README #35474#35477
Merged
asukaminato0721 merged 5 commits intolanggenius:mainfrom Apr 23, 2026
Merged
chore: add script to generate openapi v2 json and add in README #35474#35477asukaminato0721 merged 5 commits intolanggenius:mainfrom
asukaminato0721 merged 5 commits intolanggenius:mainfrom
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-22 03:43:24.730744063 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-22 03:43:12.181685087 +0000
@@ -82,6 +82,10 @@
--> core/tools/utils/web_reader_tool.py:66:35
ERROR `list[Never]` is not assignable to attribute `tools` with type `Never` [bad-assignment]
--> core/tools/workflow_as_tool/provider.py:238:26
+ERROR `str` is not assignable to attribute `STORAGE_TYPE` with type `Literal['aliyun-oss', 'azure-blob', 'baidu-obs', 'clickzetta-volume', 'google-storage', 'huawei-obs', 'local', 'oci-storage', 'opendal', 's3', 'supabase', 'tencent-cos', 'volcengine-tos']` [bad-assignment]
+ --> dev/generate_swagger_specs.py:53:32
+ERROR Object of class `object` has no attribute `model` [missing-attribute]
+ --> dev/generate_swagger_specs.py:93:13
ERROR Cannot index into `Literal['']` [bad-index]
--> extensions/storage/huawei_obs_storage.py:27:23
ERROR Cannot index into `Literal['']` [bad-index]
|
Contributor
Author
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-22 03:53:25.146338620 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-22 03:53:14.228373295 +0000
@@ -82,6 +82,8 @@
--> core/tools/utils/web_reader_tool.py:66:35
ERROR `list[Never]` is not assignable to attribute `tools` with type `Never` [bad-assignment]
--> core/tools/workflow_as_tool/provider.py:238:26
+ERROR Object of class `object` has no attribute `model` [missing-attribute]
+ --> dev/generate_swagger_specs.py:95:13
ERROR Cannot index into `Literal['']` [bad-index]
--> extensions/storage/huawei_obs_storage.py:27:23
ERROR Cannot index into `Literal['']` [bad-index]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-22 03:55:43.667215074 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-22 03:55:32.557126345 +0000
@@ -82,6 +82,10 @@
--> core/tools/utils/web_reader_tool.py:66:35
ERROR `list[Never]` is not assignable to attribute `tools` with type `Never` [bad-assignment]
--> core/tools/workflow_as_tool/provider.py:238:26
+ERROR Object of class `Swagger` has no attribute `_anonymous_inline_models` [missing-attribute]
+ --> dev/generate_swagger_specs.py:77:13
+ERROR Object of class `object` has no attribute `model` [missing-attribute]
+ --> dev/generate_swagger_specs.py:96:13
ERROR Cannot index into `Literal['']` [bad-index]
--> extensions/storage/huawei_obs_storage.py:27:23
ERROR Cannot index into `Literal['']` [bad-index]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-22 04:24:43.023643616 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-22 04:24:32.193630869 +0000
@@ -82,6 +82,8 @@
--> core/tools/utils/web_reader_tool.py:66:35
ERROR `list[Never]` is not assignable to attribute `tools` with type `Never` [bad-assignment]
--> core/tools/workflow_as_tool/provider.py:238:26
+ERROR Object of class `Swagger` has no attribute `_anonymous_inline_models` [missing-attribute]
+ --> dev/generate_swagger_specs.py:77:13
ERROR Cannot index into `Literal['']` [bad-index]
--> extensions/storage/huawei_obs_storage.py:27:23
ERROR Cannot index into `Literal['']` [bad-index]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-04-22 04:26:49.621271353 +0000
+++ /tmp/pyrefly_pr.txt 2026-04-22 04:26:39.424278145 +0000
@@ -82,6 +82,8 @@
--> core/tools/utils/web_reader_tool.py:66:35
ERROR `list[Never]` is not assignable to attribute `tools` with type `Never` [bad-assignment]
--> core/tools/workflow_as_tool/provider.py:238:26
+ERROR Object of class `Swagger` has no attribute `_anonymous_inline_models` [missing-attribute]
+ --> dev/generate_swagger_specs.py:77:13
ERROR Cannot index into `Literal['']` [bad-index]
--> extensions/storage/huawei_obs_storage.py:27:23
ERROR Cannot index into `Literal['']` [bad-index]
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a lightweight developer script to export the backend’s Flask-RESTX Swagger (OpenAPI v2) JSON specs, plus documentation and a unit test to validate the export output.
Changes:
- Added
api/dev/generate_swagger_specs.pyto generate Swagger 2.0 JSON for console/web/service APIs without starting the full backend. - Added a unit test covering JSON generation and basic schema expectations.
- Updated
api/README.mdwith instructions to run the generator and convert to TypeScript.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| api/dev/generate_swagger_specs.py | New standalone script to mount API blueprints and write Swagger v2 JSON specs to disk. |
| api/tests/unit_tests/commands/test_generate_swagger_specs.py | New unit test validating that the generator writes the expected spec files and that they look like Swagger v2. |
| api/README.md | Documents how to run the generator and a manual TS conversion step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wylswz
approved these changes
Apr 22, 2026
Contributor
wylswz
left a comment
There was a problem hiding this comment.
Tested locally, works fine.
Contributor
|
It would be nice if APIs were grouped by domains. |
Contributor
Author
In next pr will do it |
asukaminato0721
added a commit
to asukaminato0721/dify
that referenced
this pull request
Apr 24, 2026
…enius#35474 (langgenius#35477) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
fatelei
pushed a commit
that referenced
this pull request
Apr 29, 2026
#35477) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@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.

Important
Fixes #<issue number>.Summary
fix #35474
Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods