Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to transform camel case properties into snake case field names #19

Open
anti-social opened this issue Sep 22, 2021 · 0 comments
Open
Labels
easy Easy to implement

Comments

@anti-social
Copy link
Owner

anti-social commented Sep 22, 2021

It is really boring to explicitly name fields like:

class UserDoc : Document(transformCamelToSnakeCase = true) {
    val userId = int("user_id")
    val firstName = text("first_name")
    val lastName = text("last_name")
}
class UserDoc : Document(transformCamelToSnakeCase = true) {
    val userId = int()
    val firstName = text()
    val lastName = text()
}

assert UserDoc.userId.getFieldName() == "user_id"
assert UserDoc.firstName.getFieldName() == "first_name"
assert UserDoc.lastName.getFieldName() == "last_name"
@anti-social anti-social added the easy Easy to implement label Sep 22, 2021
@anti-social anti-social changed the title Allow to transform kebab case properties into snake case field names Allow to transform camel case properties into snake case field names Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Easy to implement
Projects
None yet
Development

No branches or pull requests

1 participant