-
-
Notifications
You must be signed in to change notification settings - Fork 229
Attributes cannot start with underscore #383
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
Comments
I actually encountered this same issue in one of our internal generated clients. We're going to have to normalize parameters somehow to make it happy 😞. We already have to rename some parameters automatically to make Python happy so we'll probably just have to do the same here and accept that certain combinations of parameter names won't be viable. I believe long ago we used |
@dblanchette this will get better with 0.9.0 (coming soon) as on main we switched from |
We've abandoned the project to use this library for now, but I think it is promising and would like to be able to use it in the future. For us, we're stuck with both Ideas:
Just sharing my thoughts here :) |
Thanks for responding @dblanchette! We probably will move off of |
Describe the bug
If a response attribute in the API starts with
_
, the client fails when loading the response.To Reproduce
Steps to reproduce the behavior:
_
Expected behavior
Be able to have attributes that starts with
_
OpenAPI Spec File
I cannot share publicly, but here is the gist of it:
Desktop (please complete the following information):
Additional context
This is caused by python-attrs/attrs#391
I can fix it easily in the generated code of the model:
instead of
(this is in
from_dict
)But what happens if we have
url
and_url
? I tried creating such a class withattrs
and it crashes.This is probably a tricky one, because of the reliance on attrs which refuses to add an option to disable the behavior of stripping leading underscore.
The text was updated successfully, but these errors were encountered: