Skip to content

chore: add @Pattern key annotations to dialog builder methods#13825

Open
DerSimeon wants to merge 2 commits intoPaperMC:mainfrom
DerSimeon:chore/dialog-key-pattern-annotations
Open

chore: add @Pattern key annotations to dialog builder methods#13825
DerSimeon wants to merge 2 commits intoPaperMC:mainfrom
DerSimeon:chore/dialog-key-pattern-annotations

Conversation

@DerSimeon
Copy link
Copy Markdown

Adds @Pattern("^[a-zA-Z0-9_]+$") to all dialog input builder key parameters in both API and implementation.

This enforces consistent validation at the annotation level, ensuring keys only contain alphanumeric characters and underscores, matching the existing runtime checks. Improves static analysis, IDE feedback, and API clarity.

@DerSimeon DerSimeon requested a review from a team as a code owner April 26, 2026 00:46
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Apr 26, 2026
@TonytheMacaroni
Copy link
Copy Markdown
Contributor

The pattern annotation should be added to the respective methods in DialogInput (i.e. DialogInput#singleOption), otherwise this change doesn't actually do anything for API consumers.

@DerSimeon
Copy link
Copy Markdown
Author

The pattern annotation should be added to the respective methods in DialogInput (i.e. DialogInput#singleOption), otherwise this change doesn't actually do anything for API consumers.

Will do that today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

2 participants