Skip to content

[Data Mapper] Render links for query expressions residing within member access expressions #539

Open
@YasithD

Description

@YasithD

Description:
This issue was previously resolved #366. But with the current implementation of the DM, it seems to have broken again.

Code:

type Person record {
    string id;
    string firstName;
    string lastName;
    int age;
    string country;
    Contact[] registry;
};

type Course record {
    string id;
    string name;
    int credits;
};

type Student record {
    string id;
    string fullName;
    string age;
    record {
        string title;
        int credits;
    }[] courses;
    int totalCredits;
    string visaType;
    string contactPhone;
};

type Contact record {
    string mediumType;
    string phoneNumber;
};

const D_TIER_4_VISA = "D-tier-4";

var totalCredits = function(int total, record {string id; string name; int credits;} course) returns int => total + (course.id.startsWith("CS") ? course.credits : 0);

function transform(Person person) returns Student => {
    contactPhone: (from var contact in person.registry
        where contact.mediumType == "TELEPHONE"
        select contact.phoneNumber)[0]
}

Bug:
image

Steps to reproduce:

Affected Versions:

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

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