Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

bug: entity resolver argument parser fails to unwrap list values #19

Open
dariuszkuc opened this issue Oct 17, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@dariuszkuc
Copy link
Member

dariuszkuc commented Oct 17, 2023

Reference resolver currently fails to map @keys that specify list fields. ArgumentParser is currently missing case for SyntaxKind.ListValue so whenever we have to process representation with list values it is unable to locate the target resolver.

[Key("ids")]
public class Foo
{

    public Foo(List<string> ids, string? name)
    {
        Ids = ids;
        Name = name;   
    }

    public List<string> Ids { get; }
    public string? Name { get; }

    [ReferenceResolver]
    public static Foo? GetFooByIds(
        List<string> ids,
        Data repository)
    {
        // TODO implement logic
       return null;
    }
}

Workaround is available, instead of doing the auto mapping of arguments we process representation manually

    [ReferenceResolver]
    public static Foo? GetFooByIds(
        [LocalState] ObjectValueNode data,
        Data repository)
    {
        // TODO implement logic by manually reading representation from data
       return null;
    }

Related #6

@dariuszkuc dariuszkuc added the bug Something isn't working label Oct 17, 2023
@dariuszkuc dariuszkuc changed the title bug: map @key resolver logic fails to unwrap list entity representation bug: entity resolver argument parser fails to unwrap list entity representation Oct 17, 2023
@dariuszkuc dariuszkuc changed the title bug: entity resolver argument parser fails to unwrap list entity representation bug: entity resolver argument parser fails to unwrap list values Oct 17, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant