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 intomwanji:masterfrom
CoderFrish:master
Open

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
Copy link
Copy Markdown

WasabiThumb commented Feb 24, 2026

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