-
Notifications
You must be signed in to change notification settings - Fork 214
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
Fix go scalar collection cast #4388
Conversation
@microsoft-github-policy-service agree |
I did not create a new test as there was already existing one checking that specific scenarion: |
Hi @baywet , here my proposal to fix the linked issue. I was not able to try that locally as I am facing issues while building the project following the steps here, I am getting: MSBuild version 17.8.5+b5265ef37 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
KiotaGenerated -> /home/alampare/repos/kiota/src/Kiota.Generated/bin/Debug/netstandard2.0/KiotaGenerated.dll
CSC : error CS9057: The analyzer assembly '/home/alampare/repos/kiota/src/Kiota.Generated/bin/Debug/netstandard2.0/KiotaGenerated.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'. [/home/alampare/repos/kiota/src/Kiota.Builder/Kiota.Builder.csproj] Here you are suggesting to update to the latest SDK but I am already on that one, any other hint? Sorry but I am not .NET expert 🙏 |
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.
Great work! thanks for putting this together!
About dotnet: what does dotnet --version and dotnet --list-sdks return? what OS are you running things on?
Can you also add a entry to the changelog please?
Here all infos:
Updated 7089517 |
latest is 203, but because you're on linux, you might be getting only the 100 patch branch for some reason. |
TBH I never used Codespace, I just tried but it looks like it automatically setups a dev container with .NET 7 instead of .NET 8, maybe there are some configuration in the repo that are forcing that dev container setup (?) [edit] I also tried to use Fedora 39 locally but the latest sdk version is still the same |
My bad, I forgot to upgrade the dev container configuration when we moved to net 8.
This way you should be able to run/debug unit tests (I just tried in my own container instance). Once you have fixes, you can cherry pick the changes from that temp branch onto the current branch. (or if it's too much gitfu, you can wait for my other PR to get merged, and rebase your branch) |
Thanks @baywet ! I was able to run test using ther devcontainer approach and now they should be fixed ✔️ Is there a way to build the CLI from this branch (download it) and run against my example ? Just to be 100% sure the change works as expected and no regressions are introduced. |
bd1a795
to
da0febc
Compare
da0febc
to
b0337cf
Compare
With commit b0337cf I fixed the broken test and I also added some additional checks on other test cases to check whether the cast is generated or not. [edit] I also rebased on top of |
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 for the continuous work on this!
Is there a way to build the CLI from this branch (download it) and run against my example ? Just to be 100% sure the change works as expected and no regressions are introduced.
yes, you can directly run dotnet run -c Release --project src/kiota/kiota.csproj -- <arguments you would pass>
to test things out.
You can alternatively edit one of the launch.json profiles (make sure you don't commit it)
I'll hold merging until you give me a confirmation
Thanks, it worked! Maybe that's something that could be added in CONTRIBUTING.md as this could be a very useful information, especially for those who are not familiar with
I was able to run it against my use cases and it works fine! @baywet green light fmpov 🚀 |
Thanks for the contribution! |
Fixes #4380
Given openapi:
The expected
ToPostRequestInformation
would be:Note the array cast:
Which is requried as you cannot pass
[]int32
as[]interface{}
without this trick.