-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow setting of the client interface access modifier based on the model access modifier #4820
base: master
Are you sure you want to change the base?
Allow setting of the client interface access modifier based on the model access modifier #4820
Conversation
Looks like the same failure I got in #4785 - I wondered if the test timeout I mentioned at #4785 (comment) simply isn't long enough for the macOS CI runner, though I don't have a Mac to test it locally with so I'm just guessing |
Awesome, thanks for your work @pbolduc ! |
Are there any issues with this PR? Our team is prevented using the MS Build task to auto generate our C# client because our models are internal. I have to keep reminding my team, they have to manually generate client using the UI and after generating the C# client, they need to edit the generated interface from public to internal. Please advise if you would like changes by providing feedback on this PR. I have tried to ensure this PR does not introduce any regressions and only makes minimal changes to allow types to be generated as internal to the assembly. |
I am not a maintainer on this Repo. I am not clear on how I would "re-run the Macos build". Usually a maintainer needs to re-run the github actions. |
Ok thanks for your answer. I thought maybe the creator of the PR could manually re-run the build without having to push a new commit. I guess we just have to wait for a maintainer then. |
This PR allows changing the client interface access modifier. This PR is to address #1363.
Changes:
TypeAccessModifier
is used. WhenTypeAccessModifier
is set in theOpenApiToCSharpClientCommand
, it sets the settingsClientInterfaceAccessModifier
to the same value. This is required becauseTypeAccessModifier
is found in the Newtonsoft library and not inCSharpClientGeneratorSettings
.CSharpClientGeneratorSettings
defaultsClientInterfaceAccessModifier
topublic
Client.Interface.liquid
to use the newClientInterfaceAccessModifier
settingThis PR does not address valid combination of setting the generated C# class and model to public, but the interface internal. This would require additional work to expose additional arguments to the command line tool and changes to the UI tools. Someone would need to justify the use case that make this additional combination valid and the effort to implement.
Valid in the table means it is valid C# and will compile. This PR really addresses the last item in the table.