Python: [Breaking] Update OpenAPI document parsing options#14009
Merged
SergeyMenshykh merged 4 commits intoMay 18, 2026
Merged
Python: [Breaking] Update OpenAPI document parsing options#14009SergeyMenshykh merged 4 commits into
SergeyMenshykh merged 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Python OpenAPI parsing to make external HTTP $ref resolution opt-in via execution settings, while adding tests around the new default behavior.
Changes:
- Added
enable_external_ref_resolutionto OpenAPI execution parameters. - Passed the new option through OpenAPI plugin creation into
OpenApiParser.parse. - Added parser tests for default HTTP ref blocking and internal ref resolution.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
python/semantic_kernel/connectors/openapi_plugin/openapi_parser.py |
Adds resolver type selection for OpenAPI $ref handling. |
python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py |
Propagates execution settings into parser options. |
python/semantic_kernel/connectors/openapi_plugin/openapi_function_execution_parameters.py |
Adds the new external ref resolution setting. |
python/tests/unit/connectors/openapi_plugin/test_openapi_parser.py |
Adds coverage for HTTP and internal $ref parsing behavior. |
python/tests/unit/connectors/openapi_plugin/test_openapi_manager.py |
Updates parser mock expectation for the new argument. |
Comments suppressed due to low confidence (1)
python/semantic_kernel/connectors/openapi_plugin/openapi_parser.py:60
- This only changes which refs prance resolves; it does not explicitly detect and reject HTTP/HTTPS
$refs. Depending on the validator backend, those refs can be left unresolved in the parsed spec or still be fetched during validation, so the default does not reliably enforce the intended "block external HTTP refs" behavior. Add an explicit pre-validation check or a resolver/handler that fails closed for HTTP refs when the option is disabled.
resolve_types = RESOLVE_INTERNAL | RESOLVE_FILES
if enable_external_ref_resolution:
resolve_types |= RESOLVE_HTTP
parser = ResolvingParser(openapi_document, resolve_types=resolve_types)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collapse multi-line ternary expressions in openapi_manager.py and remove stale revision line from uv.lock. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
moonbox3
approved these changes
May 15, 2026
eavanvalkenburg
approved these changes
May 18, 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.
Update OpenAPI document parsing to gate file and HTTP ref resolution separately.
Breaking change
RESOLVE_FILESis no longer enabled by default. Only internal JSON pointer references are resolved by default.enable_file_ref_resolution=TrueviaOpenAPIFunctionExecutionParameters.enable_external_ref_resolutionhas been renamed toenable_http_ref_resolution.