-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: Fix mapping of the KernelParameterMetadata.IsRequired property #11309
Merged
SergeyMenshykh
merged 9 commits into
microsoft:main
from
SergeyMenshykh:fix-parameter-isrequired-detection
Apr 1, 2025
Merged
.Net: Fix mapping of the KernelParameterMetadata.IsRequired property #11309
SergeyMenshykh
merged 9 commits into
microsoft:main
from
SergeyMenshykh:fix-parameter-isrequired-detection
Apr 1, 2025
+53
−2
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
…om/SergeyMenshykh/semantic-kernel into fix-parameter-isrequired-detection
westey-m
approved these changes
Apr 1, 2025
RogerBarreto
approved these changes
Apr 1, 2025
eavanvalkenburg
pushed a commit
to eavanvalkenburg/semantic-kernel
that referenced
this pull request
Apr 2, 2025
…icrosoft#11309) ### Motivation, Context and Description This PR fixes the issue caused by accessing the `required` property value as if it were a boolean property, instead of accessing it as an array of strings. Additionally, it reads the `required` property from the object root instead of reading it from each individual property of the object because the `required` property is defined at the root level to specify which properties are mandatory for the entire object. So, when iterating over the object root level properties, the code now uses the `"required": ["options"]` property declared at the root level instead of the `"required": ["outputPath"]` declared at the `options` property level. ```json { "type": "object", "properties": { "options": { "type": "object", "description": "Code generation options", "properties": { "outputPath": { "type": "string", "description": "Directory path where generated tests will be saved (use absolute path)" }, "testNamePrefix": { "type": "string", "description": "Prefix to use for generated test names (default: \u0027GeneratedTest\u0027)" }, "includeComments": { "type": "boolean", "description": "Whether to include descriptive comments in generated tests" } }, "required": [ "outputPath" ] } }, "required": [ "options" ] } ``` JsonSpec: https://json-schema.org/understanding-json-schema/reference/object#required Fixes: microsoft#11292 Contributes to: microsoft#11212
glorious-beard
pushed a commit
to glorious-beard/semantic-kernel
that referenced
this pull request
Apr 6, 2025
…icrosoft#11309) ### Motivation, Context and Description This PR fixes the issue caused by accessing the `required` property value as if it were a boolean property, instead of accessing it as an array of strings. Additionally, it reads the `required` property from the object root instead of reading it from each individual property of the object because the `required` property is defined at the root level to specify which properties are mandatory for the entire object. So, when iterating over the object root level properties, the code now uses the `"required": ["options"]` property declared at the root level instead of the `"required": ["outputPath"]` declared at the `options` property level. ```json { "type": "object", "properties": { "options": { "type": "object", "description": "Code generation options", "properties": { "outputPath": { "type": "string", "description": "Directory path where generated tests will be saved (use absolute path)" }, "testNamePrefix": { "type": "string", "description": "Prefix to use for generated test names (default: \u0027GeneratedTest\u0027)" }, "includeComments": { "type": "boolean", "description": "Whether to include descriptive comments in generated tests" } }, "required": [ "outputPath" ] } }, "required": [ "options" ] } ``` JsonSpec: https://json-schema.org/understanding-json-schema/reference/object#required Fixes: microsoft#11292 Contributes to: microsoft#11212
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kernel.core
kernel
Issues or pull requests impacting the core kernel
.NET
Issue or Pull requests regarding .NET code
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, Context and Description
This PR fixes the issue caused by accessing the
required
property value as if it were a boolean property, instead of accessing it as an array of strings. Additionally, it reads therequired
property from the object root instead of reading it from each individual property of the object because therequired
property is defined at the root level to specify which properties are mandatory for the entire object.So, when iterating over the object root level properties, the code now uses the
"required": ["options"]
property declared at the root level instead of the"required": ["outputPath"]
declared at theoptions
property level.JsonSpec: https://json-schema.org/understanding-json-schema/reference/object#required
Fixes: #11292
Contributes to: #11212