-
Notifications
You must be signed in to change notification settings - Fork 210
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
refs #4707 bug fix to handle string array querry parameters. #4708
refs #4707 bug fix to handle string array querry parameters. #4708
Conversation
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.
Ran another smoke tests and this seems to now be failing with DateOnly
error type at https://dev.azure.com/microsoftgraph/Graph%20Developer%20Experiences/_build/results?buildId=150372&view=logs&j=1b56eac7-e29c-5ce3-ffd5-9a54c8c4c465&t=be4c365e-b886-57e3-cf39-0a172b791b42
Any chance you can validate with a parameter of date format?
'/reports/getYammerActivityUserDetail(date={date})':
description: Provides operations to call the getYammerActivityUserDetail method.
get:
tags:
- reports.Functions
summary: Invoke function getYammerActivityUserDetail
operationId: reports.getYammerActivityUserDetail-41fe
responses:
2XX:
description: Success
content:
application/octet-stream:
schema:
type: object
properties:
value:
type: string
format: base64url
4XX:
$ref: '#/components/responses/error'
5XX:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: function
parameters:
- name: date
in: path
description: 'Usage: date={date}'
required: true
schema:
pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$'
type: string
format: date
x-ms-docs-grouped-path:
- '/reports/getYammerActivityUserDetail(period=''{period}'')'
Hi @andrueastman and @calebkiage, I reproduced the issue on my local and yes the Property is of Type I investigated further on why this is happening and found out that after the SourceModel Code is generated, the generated code is refined and that is changing the type of parameter/property from kiota/src/Kiota.Builder/KiotaBuilder.cs Lines 257 to 277 in f109c3b
Code for Property Refinement: kiota/src/Kiota.Builder/Refiners/CSharpRefiner.cs Lines 226 to 250 in f109c3b
And coming to type of option, it is generated with the help of kiota/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs Lines 721 to 784 in f109c3b
Looking into how to handle this, please provide your views, thanks |
It looks like the refiner is targeting
@rohitkrsoni Any chance you can make an update for the refiner to also include those parameters as well so that they are aligned. I believe this should resolve it. |
@andrueastman, Thanks for the info, made the changes |
Thanks @rohitkrsoni |
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.
Thanks again for the contribution @rohitkrsoni
fixes #4707
Working SS:
Build of sample project
Option Type - string[]:
var testStringArrayParameterOption = new Option<string[]>("--test-string-array-parameter", description: "Usage: newParameter=@newParameter") { Arity = ArgumentArity.ZeroOrMore };
Parameter Type:
[QueryParameter("testStringArrayParameter")] public string[]? TestStringArrayParameter { get; set; }
Tests Passing: