Skip to content

Added the TomlKey annotation solves the problem where Java variable names cannot contain - while the configuration file keys include -. - #92

Open
CoderFrish wants to merge 1 commit into
mwanji:masterfrom
FrishCodelab:master
Open

CoderFrish wants to merge 1 commit into
mwanji:masterfrom
FrishCodelab:master

Conversation

@CoderFrish

Copy link
Copy Markdown

This commit added the TomlKey annotation solves the problem where Java variable names cannot contain - while the configuration file keys include -.

Example:

public class User {
    @TomlKey("test-name")
    String testName;
}

@WasabiThumb

WasabiThumb commented Feb 24, 2026 •

Copy link
Copy Markdown

Noting that JToml supports this via @Key on both POJOs and records, for example:

public record User (
     @Key("test-name") String testName
) { }

Or alternatively via @Convention:

@Convention.Kebab
public record User (
     String testName
) { }

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