Skip to content

[Data Mapper] Enable Visualization for JSON Outputs #2044

@madushajg

Description

@madushajg

Current Limitation

Currently, when a user opens a transformation function that returns a json type, the Data Mapper diagram fails to visualize the output structure and the corresponding mapping links.

function transformToJson(Input payload) returns json =>
    {
        id: payload.id,
        name: payload.customerName,
        email: payload.customerEmail
    };
Image

Suggested Improvement

To enhance the usability and clarity of the Data Mapper for functions returning json, we can go for the following two improvements:

  1. Enhanced Visualization of Fields and Mapping Links

The Data Mapper should attempt to infer and display the structure of the resulting JSON object based on the transformation function's body.

  1. Provide Guidance for Improved Type Definition

Since the structure of the json type is dynamic and cannot always be fully inferred at design time, the Data Mapper should encourage users to define a concrete type for better tooling support.

Version

BI v1.5.3 | Ballerina v5.6.3

Metadata

Metadata

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions