Skip to content

Python: Fix OpenAPI concept sample #12418

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

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Jun 9, 2025

Motivation and Context

An OpenAPI concept sample that we have is broken. This PR fixes it to run properly based on the current OpenAPI plugin handling.

Description

Fixes the broken OpenAPI sample.

Contribution Checklist

@moonbox3 moonbox3 requested a review from a team as a code owner June 9, 2025 04:51
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel documentation labels Jun 9, 2025
@moonbox3 moonbox3 self-assigned this Jun 9, 2025
@moonbox3 moonbox3 requested a review from Copilot June 9, 2025 05:00
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the broken OpenAPI sample by updating the server, client, YAML configuration, and documentation to align with the current OpenAPI plugin handling.

  • Updated the server docstring to clearly indicate its purpose.
  • Modified the client to compute the absolute path for the OpenAPI specification and updated the kernel arguments.
  • Changed the header parameter in the OpenAPI YAML from optional to required and updated the README instructions.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
python/samples/concepts/plugins/openapi/openapi_server.py Updated docstring to "OpenAPI Sample Server" for clearer identification.
python/samples/concepts/plugins/openapi/openapi_client.py Revised client code to compute the spec path and pass updated KernelArguments.
python/samples/concepts/plugins/openapi/openapi.yaml Changed the header parameter to be required in accordance with sample requirements.
python/samples/concepts/plugins/openapi/README.md Updated navigation instructions to reflect the current directory structure.
Comments suppressed due to low confidence (1)

python/samples/concepts/plugins/openapi/openapi_client.py:24

  • [nitpick] The parameter name 'input' may be confused with Python's built-in function. Consider using a more descriptive name if it doesn't conflict with the intended API.
        input="hello world",

@moonbox3 moonbox3 added this pull request to the merge queue Jun 9, 2025
Merged via the queue into microsoft:main with commit e0221e5 Jun 9, 2025
27 checks passed
@moonbox3 moonbox3 deleted the update-openapi-plugin-sample branch June 9, 2025 21:40
@github-project-automation github-project-automation bot moved this to Sprint: Done in Semantic Kernel Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

4 participants