LowerCase nos Fields
WillHubner opened this issue · 4 comments
Dentro da função DataSetToJSONObject quanto eu utilizo, eu coloco key := LowerCase(dataSet.Fields[i].FieldName) afim de manter um "padrão" para o JSON com as keys em letras minúsculas. Você acharia interessante colocar isso no projeto principal?
Seria interessante sim. O ideal seria ter uma forma de configurar se deseja utilizar Lower, Upper, Camel ou Pascal Case.
Estou envolvido em outros projetos, você acha que consegue fazer um PR com esta alteração?
How would you implement automatic pascal/camel/snake case on field names?
A lowercase / original option would be enough. Or even just adding lowercase() is fine.
I believe a good solution would be to have a configuration class (could be a Singleton) that would do this definition. Here you could specify whether you want Lower, Upper, Camel or Pascal Case. By default it leaves the way it is and if configured it would take the defined value.
Or it could be a general class (singleton) or inject at the time of using the converter. It would have to implement and see the best way. I'm short on time to do this, if anyone can do a PR.