vbabiy / djangorestframework-camel-case

Camel case JSON support for Django REST framework.
Other
634 stars 122 forks source link

Parsing camelcase to underscore on a string ending with a capital letter #107

Open helgi-hugfimi opened 2 years ago

helgi-hugfimi commented 2 years ago

Is this expected behaviour? (running v1.2.0)

In[1]: camel_to_underscore("emailOn_POS")
Out[1]: 'email_on_po_s'

I expected email_on_pos.

Note that the input string is the result of parsing from underscore to camelcase. Hence you can see that parsing forth and back from underscore results in this: email_on_pos -> emailOn_POS -> email_on_po_s

vbabiy commented 1 year ago

@helgi-hugfimi can you add a test case that shows this