Skip to content

Python: 11769 - Enabling support for additional extended headers support with application/json #12555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

sshandilya1991
Copy link
Contributor

Enhanced the OpenAPI plugin's media type validation by implementing regex pattern matching and improved Content-Type header handling for better flexibility and operation support - primarily resolving #11769

Key Changes

  • Replaced static list matching with flexible regex pattern matching which supports JSON variants (e.g., application/vnd.api+json) through pattern matching
  • Added is_supported_media_type() method with comprehensive validation logic
  • Prioritizes request body media type when available & falls back to first response media type for operations without request bodies

…mple for patch calls.

2. Changed the order how headers are built by giving preference to what is given in openapi spec responsebody.content
@sshandilya1991 sshandilya1991 requested a review from a team as a code owner June 20, 2025 17:57
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Jun 20, 2025
@github-actions github-actions bot changed the title 11769 - Enabling support for additional extended headers support with application/json Python: 11769 - Enabling support for additional extended headers support with application/json Jun 20, 2025
sshandilya1991 and others added 4 commits June 20, 2025 23:29
file was mistakenly added
… github.com:sshandilya1991/semantic-kernel into sshandilya/additional_headers_support_openapi_11769
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jun 24, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
connectors/openapi_plugin
   openapi_parser.py136894%78, 135, 200, 257, 271–272, 275–276
   openapi_runner.py110496%163–164, 169–170
TOTAL26450451982% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3654 22 💤 0 ❌ 0 🔥 2m 8s ⏱️

@moonbox3
Copy link
Contributor

Hi @sshandilya1991, the pre-commit checks are failing. Please make sure you have them installed locally so they run before committing code. See here for more details: https://github.com/microsoft/semantic-kernel/blob/main/python/DEV_SETUP.md#using-uv.

# Install pre-commit hooks
uv run pre-commit install -c python/.pre-commit-config.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants