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

[utype] extract repeatable annotations #95

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Jan 24, 2025

UType can now properly extract repeatable annotations.

This was prompted by repeatable annotations appearing with their container in TypeMirror.

That is,

    @Pattern(regexp = ".*[0-9].*", message = "{signup.password.digit}")
    @Pattern(regexp = ".*[!@#$^&*].*", message = "{signup.password.special}")
     SomeType type;

becomes the following in the TypeMirror

    @Pattern.List({
      @Pattern(regexp = ".*[0-9].*", message = "{signup.password.digit}"),
      @Pattern(regexp = ".*[!@#$^&*].*", message = "{signup.password.special}")
   })
    SomeType type;

Which causes trouble when trying to read annotations from the type mirror using Utype.

Checklist before merge

Have these changes been tested with the below to confirm no negative interactions?

  • avaje-inject
  • avaje-jsonb
  • avaje-validator
  • avaje-spi-service

@SentryMan SentryMan added the bug Something isn't working label Jan 24, 2025
@SentryMan SentryMan added this to the 1.38 milestone Jan 24, 2025
@SentryMan SentryMan self-assigned this Jan 24, 2025
@SentryMan SentryMan requested a review from rbygrave January 24, 2025 06:10
@rbygrave rbygrave merged commit 10ecec8 into avaje:main Jan 26, 2025
4 checks passed
@SentryMan SentryMan deleted the extract-repeatable branch January 26, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants