Convert property and endpoint names to snake case in Python code#29
Convert property and endpoint names to snake case in Python code#29dbanty merged 5 commits intoopenapi-generators:masterfrom
Conversation
dbanty
left a comment
There was a problem hiding this comment.
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.