-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use params
modifier for methods in RequestDescriptorBase
#4579
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
Use params
modifier for methods in RequestDescriptorBase
#4579
Conversation
This comment has been minimized.
This comment has been minimized.
Thanks @tkirill for taking on this challenge! Also your input into the documentation of this process is invaluable we'll work on improving our Contributing.md 👍 This is not a breaking change as per: https://docs.microsoft.com/en-us/dotnet/core/compatibility/#code-changes so LGTM. I do think wherever we accept |
@Mpdreamz Yes, sure I want, this is very interesting challenge. At least I'll try. I guess I don't fully understand the scope of the task. This is how I see it:
If this is far from being the whole story then I guess it will take unreasonably much of your time to explain me what to do. In this case I'll be happy to stop on current tiny contribution and just wait and look at full solution later. And if everything is actually fine then I can do it and it will be very interesting. |
Hey @tkirill your suggested scope is the whole nine yards :) I was talking about simply extending this PR so that ``src/Nest/Descriptors.cs also includes the overload. Keeps the PR small and manageable 👍 |
6d7429a
to
6a3e05e
Compare
Effectively it works for FilterPath only. Other methods doesn't have array parameters. fix elastic#4471
6a3e05e
to
0440bf1
Compare
Hey @Mpdreamz I added |
This is great @tkirill! thank you for your contribution. |
Backported to |
Hello!
This PR tries to fix #4471.
The only place I found to fix is
RequestDescriptorBase.FilterPath
so either this is a really low hanging fruit or I'm completely missing something. I searched for potential places to fix with naive search for(string[]
and with looking at usings ofTypeHighLevel
in views.I noticed that methods in
Descriptors.*.cs
already haveparams
modifier and then found that it is implemented with.DescriptorArgumentType
inDescriptor.cshtml
. Looks like it is suitable forRequestDescriptorBase
too.I'm not sure if
Descriptors.cs
should be commited. The whole process of testing codegen is a little bit confusing and I didn't figured out the right way to run tests locally for my changes (and will be glad if someone teach me). Anyway it was a very interesting exercise to look through the code generation tool.