Honor x-accessibility on operations#1145
Conversation
chamons
commented
Apr 12, 2021
- Fixes: [LLC] Add support for x-accessibility #1134
- Add LLC variant of TestProjects tests
- Fixes: Azure#1134 - Add LLC variant of TestProjects tests
|
Here is the current PR diff with no generated files - https://gist.github.com/chamons/561ebeb0f34bfc1424b3204c746d258b |
src/AutoRest.CSharp/Common/Generation/Writers/RequestWriterHelpers.cs
Outdated
Show resolved
Hide resolved
|
Can you please add a section to the README.md about this feature? |
|
Question @pakrym This PR previously didn't touch RestClientWriter because I don't have test coverage (or even know if this should apply there). I see a few options:
I'm strongly leaning towards #1, but I'm not sure if that is laziness due to lack of second cup of coffee or being smart. |
|
I'll go with # 2 and see if it changes any generated code. It should be pretty obvious if you've broken anything. |
|
Moving to draft given size of changes likely to go in. |
|
|
||
| Request request = new Request (method.Request.HttpMethod, method.Request.PathSegments, method.Request.Query, method.Request.Headers, body); | ||
| yield return new RestClientMethod (method.Name, method.Description, method.ReturnType, request, parameters.ToArray(), method.Responses, method.HeaderModel, method.BufferResponse, method.Accessibility); | ||
| yield return new RestClientMethod (method.Name, method.Description, method.ReturnType, request, parameters.ToArray(), method.Responses, method.HeaderModel, method.BufferResponse, accessibility); |
There was a problem hiding this comment.
pull it off method.BufferResponse?
There was a problem hiding this comment.
Not sure what you are asking here?
There was a problem hiding this comment.
Sorry. You seem to be passing accessibility both into BuildMethod and here. Why both?
There was a problem hiding this comment.
We're calculating the "base" method via _builder.BuildMethod and then clone it with modifications.
I think the way I'm doing it is technically correct, but just copying it over with:
yield return new RestClientMethod (method.Name, method.Description, method.ReturnType, request, parameters.ToArray(), method.Responses, method.HeaderModel, method.BufferResponse, method.Accessibility);
would be more clear.
|
Test failure a known issue (that i'm going to look at next) - #1152 |