-
Notifications
You must be signed in to change notification settings - Fork 3.7k
.Net: Mechanism for transforming OpenAPI documents - part2 #9689
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
SergeyMenshykh
merged 12 commits into
microsoft:main
from
SergeyMenshykh:name-resolution-mechanism-part2
Nov 14, 2024
Merged
.Net: Mechanism for transforming OpenAPI documents - part2 #9689
SergeyMenshykh
merged 12 commits into
microsoft:main
from
SergeyMenshykh:name-resolution-mechanism-part2
Nov 14, 2024
Conversation
This file contains hidden or 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
dmytrostruk
approved these changes
Nov 13, 2024
dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiFunctionExecutionParameters.cs
Show resolved
Hide resolved
dotnet/src/Functions/Functions.OpenApi/OpenApi/OperationSelectionPredicateContext.cs
Outdated
Show resolved
Hide resolved
markwallace-microsoft
approved these changes
Nov 14, 2024
…ernelExtensions.ImportPluginFromOpenApi methods with the experimental attribute
dmytrostruk
approved these changes
Nov 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is the second PR to add a mechanism to transform OpenAPI documents before creating a kernel plugin from them.
Description
This PR:
Makes the
OpenApiDocumentParser
public, allowing for the parsing of OpenAPI documents and accessing the instance of theRestApiSpecification
class representing the parsed document, which can be modified, by the consumer, if needed, before creating a plugin from it. Currently, it's only possible to modify argument name property of parameters and server variables.Adds a few kernel extension overload methods to create and import OpenAPI document represented by the
RestApiSpecification
model class. This is the final element of the transformation mechanism that receives the specification model class instance returned by the parser and transformed by the consumer and creates an SK plugin from it.Adds the
OpenApiDocumentParserOptions
class to represent existing parser options and allows adding new ones with no breaking changes.Replaces the
operationsToExclude
exclusion list, which is limited to filtering out operations by operation id, with theOperationSelectionPredicate
callback that can filter out operations based on id, method, path, and description.Removes the internal
IOpenApiDocumentParser
unneeded interface that was not used all that time.Other: XML comments + OpenAPI specification transformation sample
Contributes to the issue: #4666
The first PR: #9668