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

Adding kebab-case naming strategy #2531

Merged
merged 3 commits into from
Jan 24, 2024
Merged

Adding kebab-case naming strategy #2531

merged 3 commits into from
Jan 24, 2024

Conversation

Kantis
Copy link
Contributor

@Kantis Kantis commented Dec 17, 2023

1-to-1 copy of the snake-case implementation, but replaced all underscore with dashes.

@sandwwraith
Copy link
Member

If it is the same algorithm, as you said, I'd prefer moving an implementation to some internal function instead of duplicating the code.

Also, I'd like to ask whether you are going to use this strategy yourself and for what kind of application it is required. When we studied the matter, it looked like the majority (>90%) of use cases were SnakeCase alone. That's why we decided not to add others.

@Kantis
Copy link
Contributor Author

Kantis commented Dec 18, 2023

@sandwwraith I extracted the algorithm in last commit. And yes, I interact with a json REST API which uses kebab casing for object properties, so I have the duplicated algorithm in my code. Figured I could try to submit it instead. If you're hesitant we could let it dwell for a few months and see if there's support for including it..

@sandwwraith
Copy link
Member

If you're hesitant we could let it dwell for a few months and see if there's support for including it..

No, that's not needed, I'm OK with adding your PR.

You need to run ./gradlew apiDump to get new signatures added to API file. (see here: https://github.com/Kotlin/kotlinx.serialization/blob/master/CONTRIBUTING.md#updating-the-public-api-dump)

Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it seems I've missed the email with the last commit. Thank you for your efforts!

@sandwwraith sandwwraith merged commit 8a3ed23 into Kotlin:dev Jan 24, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants