-
Notifications
You must be signed in to change notification settings - Fork 13
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
Class Name clashes with Member in generated code #54
Comments
Checkout v5.0.0-preview.1 |
Thanks for the fast reply. It's not working completely. Generated code with the above schema produces this snippet:
The |
My bad. The v5.0.0-preview.2 should definitely work. |
Found a new edge case when referencing the type multiple times. The above schema was trying to reproduce it with minimum nesting. Rerun with our schema and still not all occurences have been replaced. An updated reproducer schema:
The generated source:
|
Just saw that you released a new preview. Really appreciate it. Directly ran it against our schema again and found the next issue with the suffixes when such a clashing type is used in a List.
The relevant part here in the generated client code:
|
Checkout v5.0.0-preview.4 |
🥳 It works now! Appreciating the effort. Now I have to figure out what kind of interface incompatibility is in our schema. |
Describe the bug
The generated schema stumbles across properties which have the same name as the type itself
How to Reproduce
As it's not allowed to have Members with the same name as the class in CSharp:
[CS0542] 'Limit': member names cannot be the same as their enclosing type
Expected behavior
The class or member may be pre-/suffixed to avoid these name clashes and be able to generate a compiling client
The text was updated successfully, but these errors were encountered: