forked from microsoft/semantic-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: OpenAPI parameter resolution mechanism - part 1 (microsoft#9668)
### Motivation and Context Today, the SK OpenAPI plugin's functionality does not support OpenAPI operations that include parameters with the same name. For example, a parameter named "id" can be used in the operation path, payload, header, and query string, each representing the ID of a different entity in those contexts. An attempt to import an OpenAPI operation containing multiple parameters with the same name will fail with the error message: "The function has two or more parameters with the same name '{parameter name}'." Therefore, the SK OpenAPI plugin needs a way to gracefully manage operations that include parameters with identical names. ### Description This PR adds the `ArgumentName` property to the `RestApiPayloadProperty` and `RestApiServerVariable` classes and renames the `RestApiParameter.AlternativeName` property to `RestApiParameter.ArgumentName` to better represent its purpose, as it was used as an argument name before. The property allows associating argument names with OpenAPI parameters and is used by the `RestApiOperationRunner` to look up values for them in the arguments the function was invoked with. The next PR will allow consumers to access the OpenAPI document model and provide argument names for the "clashing" parameters. Additionally, this PR adds functionality that allows "freezing" the classes to prevent their modification after the OpenAPI document has been parsed and imported, and its operations have become available via the `KernelFunction.Metadata.AdditionalProperties["operation"]` item. Contributes to: microsoft#4666
- Loading branch information
1 parent
d604e55
commit 50bc6f3
Showing
14 changed files
with
894 additions
and
103 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.