-
-
Notifications
You must be signed in to change notification settings - Fork 334
Closed
Milestone
Description
While adding values to JsonSubTypes we have to add each element manually even if multiple keys map to same object.
example:
@JsonSubTypes({
@JsonSubTypes.Type(name = "not_equals", value = NotEqualsExpression.class),
@JsonSubTypes.Type(name = "ne", value = NotEqualsExpression.class),
@JsonSubTypes.Type(name = "equals", value = EqualsExpression.class)
})
public abstract class Expression { ... }
Current implementation maps one class with one key whereas there are multiple keys in json which can map to same data-structure.
public @interface JsonSubTypes {
JsonSubTypes.Type[] value();
public @interface Type {
Class<?> value();
String name() default "";
}
}
So as per the new feature multiple keys can be mapped to single data-structure without adding multiple entries.
public @interface JsonSubTypes {
JsonSubTypes.Type[] value();
public @interface Type {
Class<?> value();
String[] name() default "";
}
}
Thoughts?
If this is approved, I am also willing to contribute to this feature.
Metadata
Metadata
Assignees
Labels
No labels