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
Support complex payload for OpenAPI skills #680
Merged
lemillermicrosoft
merged 4 commits into
microsoft:main
from
SergeyMenshykh:new-payload-resolution-mechanism-for-open-api-skills
Apr 27, 2023
Merged
Support complex payload for OpenAPI skills #680
lemillermicrosoft
merged 4 commits into
microsoft:main
from
SergeyMenshykh:new-payload-resolution-mechanism-for-open-api-skills
Apr 27, 2023
Conversation
This file contains 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
… PUT and POST operations.
github-actions
bot
added
.NET
Issue or Pull requests regarding .NET code
kernel.core
labels
Apr 26, 2023
SergeyMenshykh
added
the
PR: ready for review
All feedback addressed, ready for reviews
label
Apr 26, 2023
dotnet/src/Skills/Skills.OpenAPI/Extensions/RestApiOperationExtensions.cs
Show resolved
Hide resolved
lemillermicrosoft
added
the
PR: feedback to address
Waiting for PR owner to address comments/questions
label
Apr 27, 2023
SergeyMenshykh
removed
the
PR: feedback to address
Waiting for PR owner to address comments/questions
label
Apr 27, 2023
lemillermicrosoft
approved these changes
Apr 27, 2023
gitri-ms
added
PR: ready to merge
PR has been approved by all reviewers, and is ready to merge.
and removed
PR: ready for review
All feedback addressed, ready for reviews
labels
Apr 27, 2023
dluc
pushed a commit
that referenced
this pull request
Apr 29, 2023
### Motivation and Context This PR changes the way payload/body for POST and PUT operations is resolved. This change is required to support the following scenarios: - A POST/PUT operation payload has more than one property with the same name - { 'sender': { '**name**': 'val1'}, 'receiver': {'**name**': 'val2'} } - A POST/PUT operation payload has a property of array of objects with the same name - { 'receivers': [ {'**name**':'val1'}, {'**name**':'val2'} ] } - A POST/PUT operation payload metadata is missing. ### Description Curent RestApi functionality builds operation payload dynamically and relies on: - Payload metadata that describes the payload/body schema/shape and usually obtained from OpenAPI documents. - Arguments resolution mechanism that resolves payload parameters in SK context. As practice shows, in some cases (malformed OpenAPI document), the payload metadata is missing which means that it's not possible to create operation payload dynamically and as a result it's not possible to run the operation. In other cases, if a payload has two of more parameters with the same name or parameters of array type with object items it is impossible to resolve them from SK context. To support these scenarios, the RestApi functionality does not build the payload dynamically anymore and instead relies on either AI or a caller of the APi to create/supply it. To help AI generate the payload, a new schema property will be added to the ParameterView class to describe the payload structure/shape to AI.
dehoward
pushed a commit
to lemillermicrosoft/semantic-kernel
that referenced
this pull request
Jun 1, 2023
### Motivation and Context This PR changes the way payload/body for POST and PUT operations is resolved. This change is required to support the following scenarios: - A POST/PUT operation payload has more than one property with the same name - { 'sender': { '**name**': 'val1'}, 'receiver': {'**name**': 'val2'} } - A POST/PUT operation payload has a property of array of objects with the same name - { 'receivers': [ {'**name**':'val1'}, {'**name**':'val2'} ] } - A POST/PUT operation payload metadata is missing. ### Description Curent RestApi functionality builds operation payload dynamically and relies on: - Payload metadata that describes the payload/body schema/shape and usually obtained from OpenAPI documents. - Arguments resolution mechanism that resolves payload parameters in SK context. As practice shows, in some cases (malformed OpenAPI document), the payload metadata is missing which means that it's not possible to create operation payload dynamically and as a result it's not possible to run the operation. In other cases, if a payload has two of more parameters with the same name or parameters of array type with object items it is impossible to resolve them from SK context. To support these scenarios, the RestApi functionality does not build the payload dynamically anymore and instead relies on either AI or a caller of the APi to create/supply it. To help AI generate the payload, a new schema property will be added to the ParameterView class to describe the payload structure/shape to AI.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
.NET
Issue or Pull requests regarding .NET code
PR: ready to merge
PR has been approved by all reviewers, and is ready to merge.
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.
Motivation and Context
This PR changes the way payload/body for POST and PUT operations is resolved.
This change is required to support the following scenarios:
Description
Curent RestApi functionality builds operation payload dynamically and relies on:
As practice shows, in some cases (malformed OpenAPI document), the payload metadata is missing which means that it's not possible to create operation payload dynamically and as a result it's not possible to run the operation. In other cases, if a payload has two of more parameters with the same name or parameters of array type with object items it is impossible to resolve them from SK context.
To support these scenarios, the RestApi functionality does not build the payload dynamically anymore and instead relies on either AI or a caller of the APi to create/supply it. To help AI generate the payload, a new schema property will be added to the ParameterView class to describe the payload structure/shape to AI.
Contribution Checklist
dotnet format