- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 226
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
Linting error when class has a property with the same name after snake case #1117
Comments
Note: I understand that |
Another option would be to change the name we use for the temporary value that's eventually returned, that way the property can keep its normal name. The challenge will be picking a name that is unlikely to be used as a property. I suppose |
This is an external API that I'm consuming so I can't really change the name of the property. I can, however, change the name of the class, which I changed to |
Seems to me like the only reason there's a variable name at all in that last part is that return cls(
email=email,
verified=verified,
type=type,
id=id,
additional_properties=d
) |
openapi-python-client
:0.21.4
Python:
3.10
OpenAPI spec version:
3.0.3
In OpenAPI specs where a property has the same name as the snake cased class name (in the example below, the snake casing is the lower case, but if it was, ex,
InstagramId
, then this would happen with a property namedinstagram_id
) the code generated has a duplicated variable name (see image below).The suggested fix is that the return variable name should have an underscore
_
, in this example,email_
.The text was updated successfully, but these errors were encountered: