Closed ggrell closed 7 years ago
We also use https://github.com/SwiftGen/StencilSwiftKit which has few other filters like snakeToCamelCase / snakeToCamelCaseNoPrefix
, I think that might actually cover this already?
Woah, I didn't know StencilSwiftKit had additional filters added to it! Looks like snakecase
hasn't been exposed as a filter, happy to take care of it if needed.
sounds great, but we should do it on the StencilSwiftKit repo 👍
In our JSON structures, we generally name fields similarly to the JSON data field name counterparts. When generating JSON mapping code, it would be nice to be able to directly map from
someFieldName
tosome_field_name
. I see that Stencil hascapitalize
,uppercase
&lowercase
, and Sourcery additionally providesupperFirst
(via what looks like a Stencil custom filter).I'm interested in contributing a
lowercaseUnderscore
filter if that's something that people would find valuable.