-
-
Notifications
You must be signed in to change notification settings - Fork 227
Convert property and endpoint names to snake case in Python code #29
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
Conversation
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.
Awesome work, thank you! A couple tiny suggestions, the only semi-important change is about calculating python_name
on properties once instead of as a property which runs every time. Will affect performance a bit.
My only other request is, if you feel comfortable, try to add a property which doesn't use snake_case in the FastAPI app used for end to end testing so we verify that it preserves the name of the param while making a more appropriate one for Python. If not, I can stick one in there at a later time.
Codecov Report
@@ Coverage Diff @@
## master #29 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 9 +1
Lines 532 553 +21
=========================================
+ Hits 532 553 +21
Continue to review full report at Codecov.
|
Great project! A few contributions in this PR and more to come from a similar - but much shoddier! - tool I had knocked out for a current project.
This adds conversion to snake_case for property and API operation names. I've added some regex to avoid awkward conversions like
h_t_t_p__response
.