Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant