Skip to content

refactor: replace bare dict with dict[str, Any] in OpenAPI tools parser#35061

Merged
asukaminato0721 merged 1 commit intolanggenius:mainfrom
wdeveloper16:refactor/typed-dict-openapi-parser
Apr 13, 2026
Merged

refactor: replace bare dict with dict[str, Any] in OpenAPI tools parser#35061
asukaminato0721 merged 1 commit intolanggenius:mainfrom
wdeveloper16:refactor/typed-dict-openapi-parser

Conversation

@wdeveloper16
Copy link
Copy Markdown
Contributor

Summary

  • Replace seven bare dict / dict | None annotations in ApiBasedToolSchemaParser with dict[str, Any] / dict[str, Any] | None:
    • parse_openapi_to_tool_bundle: extra_info, warning
    • _get_tool_parameter_type: parameter
    • parse_openapi_yaml_to_tool_bundle: extra_info, warning, local openapi variable
    • parse_swagger_to_openapi: swagger, extra_info, warning
    • parse_json_to_tool_bundle: extra_info, warning
    • auto_parse_to_tool_bundle: extra_info, warning
  • All are parsed JSON/YAML payloads with dynamic keys — dict[str, Any] is the correct shape. Any is already imported.

No behavior change — types only.

Part of #22651.

Test plan

  • make lint passes
  • make type-check-core passes
  • make test TARGET_TESTS=./api/tests/unit_tests/core/tools/utils/test_parser.py — 14 tests pass

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. refactor labels Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 13, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 13, 2026
Merged via the queue into langgenius:main with commit 2edd083 Apr 13, 2026
28 checks passed
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants