-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[csharp] Mustache fully qualify namespace for Path #19349
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
[csharp] Mustache fully qualify namespace for Path #19349
Conversation
The generated code of Csharp get a fully quallify namespace for PATH using Path = global::System.IO.Path;
|
Intends to fix #19344 |
| using RestSharp.Serializers; | ||
| using RestSharpMethod = RestSharp.Method; | ||
| using FileIO = System.IO.File; | ||
| using Path = global::System.IO.Path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an alias might lead to more conflicts with other apis that have objects called Path. Please just fully qualify the Path method without using an alias.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the PR. Fully qualify Path class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using RestSharpMethod = RestSharp.Method;
using FileIO = System.IO.File;
given that we're already using aliases above, shall we follow the same pattern for Path to make it consistent? e.g.
using PathIO = System.IO.Path;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we should be using aliases. That will make it easier for unexpected conflicts to occur. Using the fully qualified name is more verbose, but also more concise. We don't care about verbosity here because it is generated code anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care about verbosity here because it is generated code anyway.
some users do care about it based on feedback we'd previously when using fully qualified namespace
i don't think giving this one a try
|
thanks for the PR with name mapping option for fallback, can this PR target upcoming minor release (breaking with fallback allowed)? ref: https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#name-mapping |
|
This is not a breaking change. It is only fully qualifying a method, a very safe thing to do. I don't see any harm in merging it now. |
The generated code of Csharp get a fully quallify namespace for PATH
using Path = global::System.IO.Path;
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming 7.6.0 minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)@mandrean @shibayan @Blackclaws @lucamazzanti @iBicha