-
Notifications
You must be signed in to change notification settings - Fork 30
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
Aligns request options with configuration revamp #146
Conversation
65481c4
to
7ac0e0a
Compare
817cf0e
to
61defb5
Compare
The configuration properties are the same for almost of the post/put/delete request configuration classes. These RequestConfigurations contain only headers and options. It varies for the My concern is this bulks up the SDK with a lot of duplicate code. Plus, an additional step is introduced to create and initiate headers or request options every time which can be skipped. The issue targeted by this PR considers that query params may not always be present and generating separate configurations for these optional parameters works fine. But headers and request options are commonly used and something the Kiota adds for every request. Instead of duplicating the code we could maintain a separate common wrapper for the headers and request options configurations and another one for the query params specific to request paths. |
Thanks @nikithauc. I do see that there is the possibility of optimization here if the request configuration object only has the two properties of the (headers and options). Let me investigate this and push an update on the same. |
9419eac
to
0316f5c
Compare
@andrueastman Thank you so much for taking in the comments! Few thoughts but I don't have a strong preference:
|
0316f5c
to
e78cc03
Compare
e78cc03
to
926ec61
Compare
Hey @nikithauc, Apologies but I have had to revert the PR to the changes made earlier. While working on the other languages, I realized I had sort of missed a major problem Vincent was also trying to solve. Essentially, the reason behind the multiple classes is to avoid unnecessary breaking changes on the API surface (e.g. if QueryParameters are added to an endpoints description). If we have a common/shared request configuration class and it results in the generation of an API method like this, public get(requestConfiguration?: CommonRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<InferenceClassification | undefined> { In the event the metadata of the API is updated (in this case to add request parameters), the type of the request configuration parameter would have to change to a specific model/type that caters for it(from public get(requestConfiguration?: InferenceClassificationGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<InferenceClassification | undefined> { This would therefore cause a breaking change in the API surface of the SDK needing to rev it up. Hopefully, this is helpful and looking forward to your feedback/thoughts on the PR. |
Any chance you can take a second look? @nikithauc |
Thanks @nikithauc. |
09d4305
to
9a428d5
Compare
@andrueastman There is a demo is being worked on for https://devblogs.microsoft.com/microsoft365dev/get-inspired-with-microsoft-365-apps-at-microsoft-tech-days/ and the latest releases contained bug fixes reported by the team making the demo. I am waiting on confirmation that the latest releases work for them. It looks like they are using an older generated code. The changes in the PR is breaking so I will hold onto merging in case I need to make another bug fix release. |
This PR is part of microsoft/kiota#1494 and depends on microsoft/kiota#1520
Changes include
preview.3
To make the PR easier to review due to the number of changes in the generation samples, the changes specifically tied to the Abstraction library can isolated by following the link below.
373ff2d