Project: mulestudio
Issue STUDIO-3167: Support hybrid metadata models
Right now DataSense supports two types of metadata: * Static: Which is completely obtained from Instrospection of pojos * Dynamic: Completely obtained from @MetadataRetriever method Connectors such as Netsuite or ServiceSource present a hybrid case, in which most of the metadata is static, but the pojos that the connector handle have an internal map to represent custom fields. Right now there's no support OOTB for this and the case needs to be handled manually at the metadata retriever, forcing the user to instrospect the object by hand. Also, if forces the connector to have two versions for each processor. For example, consider the following: public MyPojo create(@Optional @Default("#[payload]") MyPojo pojo) { ... } There's no way to make use of DataSense in that processor. Then, you're forced to add a second processor that looks like this: public Map dynamicCreate(@MetadataKeyParam String type, @Optional @Default("#[payload]) Map) { ... } PROPOSAL One solution that I can think of for this problem is to enable this hybrid cases by creating a new annotation called @MetadataDynamic or something like that. Then, the connector's pojos can annotate the map of dynamic fields with that annotation. Then, Studio/Devkit can scan for that annotation and automatically generate instrospection Medatata for that pojo, so that the metadata provider can only worry about custom types. This annotation should also be used to leverage DataSense in processors using such pojos so that we don't have to make dynamicXXX processors
Story points: 13