-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
.Net: DefaultValue for OpenAPI payload properties #4612
Merged
SergeyMenshykh
merged 3 commits into
microsoft:main
from
SergeyMenshykh:default-value-for-payload-props
Jan 19, 2024
Merged
.Net: DefaultValue for OpenAPI payload properties #4612
SergeyMenshykh
merged 3 commits into
microsoft:main
from
SergeyMenshykh:default-value-for-payload-props
Jan 19, 2024
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
…eter class has been changed from string? to object? to better represent the actual type of the parameter's default value. 2. The DefaultType property has been added to the RestApiOperationPayloadProperty, making it consistent with the RestApiOperationParameter class.
SergeyMenshykh
requested review from
dmytrostruk,
RogerBarreto and
markwallace-microsoft
January 15, 2024 20:22
SergeyMenshykh
added
the
PR: ready for review
All feedback addressed, ready for reviews
label
Jan 17, 2024
dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperationPayloadProperty.cs
Show resolved
Hide resolved
RogerBarreto
approved these changes
Jan 18, 2024
markwallace-microsoft
approved these changes
Jan 19, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 19, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 19, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 19, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 19, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 19, 2024
stephentoub
reviewed
Jan 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Bryan-Roe
pushed a commit
to Bryan-Roe/semantic-kernel
that referenced
this pull request
Oct 6, 2024
### Motivation and Context Currently, the default values of parameters in OpenAPI plugins have the 'string?' type, even though their original type specified in the OpenAPI document schema might be different. A dedicated type conversion functionality exists to convert from the original type to a string. However, both the string type for the parameters/arguments and the type conversion logic are no longer necessary, as SK has moved away from string-type arguments and recently added support for .NET primitive types and complex types. Furthermore, the `RestApiOperationPayloadProperty` class does not have a property for default values, so a default value specified in an OpenAPI document is lost and cannot be accessed from the code. ### Description 1. The type of the `DefaultValue` property in the `RestApiOperationParameter` class has been changed from string? to object? to better represent the actual type of the parameter's default value and eliminate unnecessary conversion to string. 2. A new `DefaultValue` property has been added to the `RestApiOperationPayloadProperty`, making it consistent with the RestApiOperationParameter class.
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 for review
All feedback addressed, ready for reviews
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
Currently, the default values of parameters in OpenAPI plugins have the 'string?' type, even though their original type specified in the OpenAPI document schema might be different. A dedicated type conversion functionality exists to convert from the original type to a string. However, both the string type for the parameters/arguments and the type conversion logic are no longer necessary, as SK has moved away from string-type arguments and recently added support for .NET primitive types and complex types.
Furthermore, the
RestApiOperationPayloadProperty
class does not have a property for default values, so a default value specified in an OpenAPI document is lost and cannot be accessed from the code.Description
The type of the
DefaultValue
property in theRestApiOperationParameter
class has been changed from string? to object? to better represent the actual type of the parameter's default value and eliminate unnecessary conversion to string.A new
DefaultValue
property has been added to theRestApiOperationPayloadProperty
, making it consistent with the RestApiOperationParameter class.