vbabiy / djangorestframework-camel-case

Camel case JSON support for Django REST framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

helgi-hugfimi opened this issue · comments

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

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