Skip to content
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

EnumNameGeneratorType not working at all #3039

Open
LeonidEfremov opened this issue Sep 8, 2020 · 7 comments
Open

EnumNameGeneratorType not working at all #3039

LeonidEfremov opened this issue Sep 8, 2020 · 7 comments

Comments

@LeonidEfremov
Copy link

Hi, @RicoSuter!

It seems like openApiToCSharpClient.enumNameGeneratorType (13.7.0) property not working at all... Trying to set any value - no changes at generated cs-code =(

@RicoSuter
Copy link
Owner

enumNameGeneratorType can only be change when set in-process - not via configuration (e.g. nswag.json file) because it currently cannot dynamically load types from assemblies, etc.

@RicoSuter
Copy link
Owner

To use this you'd need to write your own CLI based on the NSwag packages and then you have full flexibility...

@johndoese
Copy link

It seems that InitCustomTypes should be called somewhere up to top, as stated in TODO item :)

@RicoSuter
Copy link
Owner

It seems that InitCustomTypes should be called somewhere up to top, as stated in TODO item :)

It's not that easy... how would you be able to "inject" custom types into the CLI? Just calling InitCustomTypes might work when the custom type is in the CLI DLLs but probably you'd want to load your own DLL in the CLI and for that you'd also need a config to define external additional DLLs (which currently does not exist).

@johndoese
Copy link

It seems that InitCustomTypes should be called somewhere up to top, as stated in TODO item :)

It's not that easy... how would you be able to "inject" custom types into the CLI? Just calling InitCustomTypes might work when the custom type is in the CLI DLLs but probably you'd want to load your own DLL in the CLI and for that you'd also need a config to define external additional DLLs (which currently does not exist).

Yes, i know that's not so easy, using AssemblyLoaders in any way may cause some unpredictable behaviour. Anyway, i keep in mind that this feature might be implemented, but i made a temporary console app built on NSWag code generator libraries to keep the pipeline cross-platform and simple. Have a nice day and thanks for your work!

@RicoSuter
Copy link
Owner

Ref: #924

@jhermsen
Copy link

Any plans on looking into this again?
I'm also in need of the enumNameGeneratorType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants