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

[NancyFx] Allow for override of PackageContext #6592

Closed
craffael opened this issue Sep 29, 2017 · 1 comment
Closed

[NancyFx] Allow for override of PackageContext #6592

craffael opened this issue Sep 29, 2017 · 1 comment

Comments

@craffael
Copy link
Contributor

craffael commented Sep 29, 2017

Description

The current NancyFX generator constructs the C# namespace as follows: <packageName>.<packageContext>. Currently <packageContext> is set to a (sanitized) version of the swagger basepath.

In cases where the base path is non-simple, this can lead to strange namespaces. For example for packageName=company.security and basePath=/security.svc/v1 the resulting namespace would be company.security.security_svcv1 which is rather ugly.

Swagger-codegen version

Current master branch.

Command line used for generation

java -jar .\swagger-codegen-cli.jar generate -i ..\swagger\pos\swagger.yaml -l nancyfx -o . --additional-properties packageName=company.security

Suggest a fix/enhancement

I suggest to add a new nancyfx specific option called packageContext that allows us to overwrite the packageContext. I.e. we could use the command line

java -jar .\swagger-codegen-cli.jar generate -i ..\swagger\pos\swagger.yaml -l nancyfx -o . --additional-properties packageName=company.security,packageContext=v1

to get the namespace company.security.v1 which would be much nicer.

@wing328
Copy link
Contributor

wing328 commented Oct 2, 2017

Closed via #6593

@wing328 wing328 closed this as completed Oct 2, 2017
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

2 participants