Skip to content

add extra single arg deser tests#4647

Merged
cowtowncoder merged 4 commits intoFasterXML:2.18from
pjfanning:single-arg-tests
Jul 26, 2024
Merged

add extra single arg deser tests#4647
cowtowncoder merged 4 commits intoFasterXML:2.18from
pjfanning:single-arg-tests

Conversation

@pjfanning
Copy link
Copy Markdown
Member

@pjfanning pjfanning commented Jul 25, 2024

These tests only pass because the mapper used has this:

    @Target(ElementType.PARAMETER)
    @Retention(RetentionPolicy.RUNTIME)
    public @interface ImplicitName {
        String value();
    }

    public class ImplicitNameIntrospector extends JacksonAnnotationIntrospector
    {
        @Override
        public String findImplicitPropertyName(AnnotatedMember member) {
            final ImplicitName ann = member.getAnnotation(ImplicitName.class);
            return (ann == null) ? null : ann.value();
        }
    }

ObjectMapper mapper = JsonMapper.builder()
                .annotationIntrospector(new ImplicitNameIntrospector())
                .constructorDetector(ConstructorDetector.USE_PROPERTIES_BASED)
                .build();

Copy link
Copy Markdown
Member

@cowtowncoder cowtowncoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@cowtowncoder cowtowncoder merged commit 92181df into FasterXML:2.18 Jul 26, 2024
@pjfanning pjfanning deleted the single-arg-tests branch July 26, 2024 08:02
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