-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Compiler errors in generated client when property name matches namespace of Json library #4578
Comments
Maybe you could submit a PR to fix the problem? |
Yeah! Great idea. |
Maybe this? It's also referenced from |
@RicoSuter hello, can you give a hint, how to fix this problem? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You get compile errors when you consume a service that has a property called Newtonsoft.
It will generate the following code:
Compiler error:
CS0120 An object reference is required for the non-static field, method, or property 'BreakOpenApiModel.Newtonsoft'
This should be an easy fix: Just prefix with global:: to fix it:
If you switch to System.Text.Json then a property named System will cause similar problems.
Sample application that demonstrates the problem: github.com/PolarbearDK/OpenApiTest
I have previously mentioned this in #2243
The text was updated successfully, but these errors were encountered: