Encode OpenAPI server variable values - #14146
Merged
Tao Chen (TaoChenOSU) merged 2 commits intoJul 9, 2026
Merged
Conversation
Validate enum-constrained server variables and percent-encode substituted values before constructing OpenAPI server URLs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg (eavanvalkenburg)
requested a review
from a team
as a code owner
July 9, 2026 07:27
Copilot started reviewing on behalf of
Eduard van Valkenburg (eavanvalkenburg)
July 9, 2026 07:28
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens OpenAPI server URL construction for the Python OpenAPI plugin by validating enum-constrained server variables and percent-encoding substituted server variable values to prevent reserved characters from altering URL structure (e.g., host/path injection).
Changes:
- Added enum validation for server variables when provided via
argumentsduring server URL substitution. - Percent-encodes substituted server variable values (including defaults) during server URL construction.
- Added regression tests covering enum validation (argument path) and reserved-character/default encoding.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py | Adds enum validation for argument-provided server variables and percent-encodes substituted values in server URL templates. |
| python/tests/unit/connectors/openapi_plugin/test_sk_openapi.py | Adds unit tests for enum validation and percent-encoding behavior in get_server_url. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Apply enum validation to default server-variable substitutions and cover the default fallback path with a regression test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evan Mattson (moonbox3)
approved these changes
Jul 9, 2026
Eduard van Valkenburg (eavanvalkenburg)
enabled auto-merge
July 9, 2026 07:51
Roger Barreto (rogerbarreto)
approved these changes
Jul 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 9, 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.
Summary
Testing