-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
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.