Skip to content

[Data Mapper] Add support for computed name fields, spread fields and specific field shorthand #407

Open
@madushajg

Description

@madushajg

Description:
There are three types of allowed fields within a Ballerina mapping constructor[1] and the Data Mapper is currently only supports for specific-fields in following format.

specific-field :=
         [readonly] (field-name | string-literal) : value-expr

However since the computed-name-fields, spread-fields and specific field shorthand are also commonly used within the sources, the Data Mapper diagram should support those.

Sample source:

type Input record {|
    string firstName;
    string lastName;
    string title;
|};

type Transformed record {
    string fullName;
    string firstName;
    string lastName;
    string title;
};

function transform(Input input) returns Transformed => let var fullName = input.firstName + " " + input.lastName in {
    fullName,
    ...input
};

[1] https://ballerina.io/spec/lang/master/#section_6.7.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions