Skip to content

customAnnotationsMapping should be supported at the class-level #231

@kobylynskyi

Description

@kobylynskyi

Is your feature request related to a problem? Please describe.
Currently, it is not possible to specify custom annotation in the model class.

Describe the solution you'd like
If customAnnotationsMapping contains an annotation for a given type, then this annotation should be added at the class-level.
Example configuration:

    customAnnotationsMapping = [
        EventProperty: "com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.EventPropertyDeserializer.class)"
    ]

Generated class:

@com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.EventPropertyDeserializer.class)
public class EventProperty {
    ...
}

Additional context
Currently, customAnnotationsMapping is used to add annotations to all fields that have a given type in other classes. e.g.:

public class Event {
    @com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.EventPropertyDeserializer.class)
    private EventProperty property;
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions