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

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
TOTAL26525453882% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3664 22 💤 0 ❌ 0 🔥 1m 46s ⏱️

@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

@moonbox3 moonbox3 enabled auto-merge July 4, 2025 23:49
@moonbox3
Copy link
Contributor

moonbox3 commented Jul 7, 2025

Hi @sshandilya1991, the pre-commit check that is failing is related to the uv.lock check. If you delete your local uv file, and then re-run uv sync --all-extras --dev, it should regenerate the file properly without errors. You'll want to make sure you have the latest uv version installed on your machine.

auto-merge was automatically disabled July 7, 2025 11:17

Head branch was pushed to by a user without write access

@moonbox3
Copy link
Contributor

moonbox3 commented Jul 9, 2025

Hi @sshandilya1991, please make sure you have the pre-commit installed, so the necessary pre-commit steps are run before committing code. The ruff pre-commit check is failing. It will make a local modification, which you can then git add . and git commit -m "<some commit msg>", which will then run the checks again. Once all checks pass locally, they should also pass in CI/CD.

@moonbox3
Copy link
Contributor

Hi @sshandilya1991, please re-open the PR when you're able to install the pre-commit and fix the checks. Thanks.

@moonbox3 moonbox3 closed this Jul 17, 2025
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