-
Notifications
You must be signed in to change notification settings - Fork 185
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:
![image](https://private-user-images.githubusercontent.com/60655155/333036814-a3839672-0a8f-4df4-b9ab-dda0fe4de92b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNzQzMTMsIm5iZiI6MTcyNDI3NDAxMywicGF0aCI6Ii82MDY1NTE1NS8zMzMwMzY4MTQtYTM4Mzk2NzItMGE4Zi00ZGY0LWI5YWItZGRhMGZlNGRlOTJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDIxMDAxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5OTU3NmIyYWQzNmFhOWI5ZjcxNDc3ODU5MTkzYWFiY2E3MThlNjg1ODEwODc3ZTEyMjJjNjhmMWRiODE4ZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.jgZSh82HIncn6E31zFXhyeJBiJAGeK1nPpa3uh6y2O4)
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:
![image](https://private-user-images.githubusercontent.com/60655155/333039301-72e4b24a-e739-4025-b91c-3b9e0fc6d7af.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyNzQzMTMsIm5iZiI6MTcyNDI3NDAxMywicGF0aCI6Ii82MDY1NTE1NS8zMzMwMzkzMDEtNzJlNGIyNGEtZTczOS00MDI1LWI5MWMtM2I5ZTBmYzZkN2FmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDIxMDAxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ3ODNmNTQyOGNmZDMxN2U2YzhhYWM4MWJkYTkxZGM1M2NhYzY2Yjk3YTI3ZmNhNDk4ZGQ1YTllMmRmNjkwYWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hkgpTSqd9vQF3VFOREpHaISFcfdbM5JzpbXuFUd9Q6w)