The constraint compiler ignored the message an annotation declares and always wrote its own, so a failed @Pattern answered the caller with a regex.
It now uses the annotation's message whenever one is set, keeping the plain description for jakarta's default — which is a resource bundle key, not something to put in front of whoever sent the request.
@Pattern(regexp="[A-Za-z0-9_][A-Za-z0-9_.-]{0,254}",message="uses up to 255 letters, digits, _, . and -")
{"error":"key uses up to 255 letters, digits, _, . and -","status":422}
This is what makes moving a check out of a service and onto the type it belongs to cost nothing: the wording moves with it.
The constraint compiler ignored the `message` an annotation declares and always wrote its own, so a failed `@Pattern` answered the caller with a regex.
It now uses the annotation's message whenever one is set, keeping the plain description for jakarta's default — which is a resource bundle key, not something to put in front of whoever sent the request.
```java
@Pattern(regexp = "[A-Za-z0-9_][A-Za-z0-9_.-]{0,254}", message = "uses up to 255 letters, digits, _, . and -")
```
```json
{"error": "key uses up to 255 letters, digits, _, . and -", "status": 422}
```
This is what makes moving a check out of a service and onto the type it belongs to cost nothing: the wording moves with it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The compiler ignored the message a constraint declares and always wrote its
own, so a failed @Pattern answered the caller with a regex. It now uses the
annotation's message whenever one is set, and keeps the plain description for
jakarta's default, which is a resource bundle key and not something to put in
front of whoever sent the request.
This is what makes moving a check out of a service and onto the type it
belongs to cost nothing: the wording moves with it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Relism
merged commit 6a6431c528 into master2026-09-23 14:51:29 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The constraint compiler ignored the
messagean annotation declares and always wrote its own, so a failed@Patternanswered the caller with a regex.It now uses the annotation's message whenever one is set, keeping the plain description for jakarta's default — which is a resource bundle key, not something to put in front of whoever sent the request.
This is what makes moving a check out of a service and onto the type it belongs to cost nothing: the wording moves with it.
🤖 Generated with Claude Code