[Feature] Support for Flat file transformation and reading
abeykoon opened this issue · comments
Problem
Sometimes, in integration scenarios there are requirements to generate Flat files [1] from input data types (i.e XML, Json). Currently, WSO2 MI does not have an out of the box way that support this transformation.
We can use Freemarker scripts [2] with payload factory to create a flat file. However, comparing with competitors, we can make the experience far more better by introducing a mediator/connector specific for that.
Suggestion
Flat files generation has two sections
- Flat file schema : A flat file schema is the blueprint that contains the instructions for parsing or creating a flat file
- Transformation : Contains mappings to each column in a flat file. Mapping can be from a json/xml/csv etc
In practical cases, there will be different transformations against a single schema. Thus, for an example, if we can have a connector with a connection that points to a schema and an operation called transform
that takes a mapping file that will work.
On the other side, there are use-cases where we need to read a flat file and create xml/json according to the schema as well.
[1]. https://www.techtarget.com/searchdatamanagement/definition/flat-file
[2]. https://apim.docs.wso2.com/en/latest/reference/mediators/payloadfactory-mediator/#freemarker-template
@Seralahthan @Thiyanwso2 Please share your findings.