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]: Resource access that are not ambiguous are reported as ambiguous access #40606

Open
rdulmina opened this issue Jun 6, 2023 · 5 comments · May be fixed by #43589
Open

[Bug]: Resource access that are not ambiguous are reported as ambiguous access #40606

rdulmina opened this issue Jun 6, 2023 · 5 comments · May be fixed by #43589
Assignees
Labels
Priority/Blocker Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug

Comments

@rdulmina
Copy link
Contributor

rdulmina commented Jun 6, 2023

Description

public client class SimpleClient {
    resource function get metadata() returns string {
        return "";
    }

    resource function get [string id]() returns string {
        return "";
    }
}

If we have above client declaration we can allow sampleClient->/metadata; which is not ambiguous at compile time.

Currently this gives error - client resource access action is not yet supported when the corresponding resource method is ambiguous

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@rdulmina rdulmina added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Jun 6, 2023
@sameerajayasoma sameerajayasoma changed the title [Bug]: Resource access that are not ambiguous are reported as abiguous access [Bug]: Resource access that are not ambiguous are reported as ambiguous access Jun 6, 2023
@rukmal
Copy link

rukmal commented Sep 29, 2023

+1

@sahanHe
Copy link
Contributor

sahanHe commented Jan 8, 2024

@rdulmina for the salesforce connector we are having the same issue where we cannot use the following two resource methods due to the mentioned issue.

    @display {label: "Get Record by ID"}
    isolated resource function get services/data/["v59.0"]/sobjects/[string sobject]/[string id](typedesc<record {}> returnType = <>)
                                    returns returnType|error = @java:Method {
        'class: "io.ballerinax.salesforce.ReadOperationExecutor",
        name: "getRecordById"
    } external;

    @display {label: "Get sObject Description"}
    isolated resource function get services/data/["v59.0"]/sobjects/[string sobjectName]/describe()
                                            returns SObjectMetaData|error {
        return check self.salesforceClient->/services/data/["v59.0"]/sobjects/[sobjectName]/describe.get();
    }

Can we get this fixed with a 2201.8.x patch release?

@rdulmina
Copy link
Contributor Author

rdulmina commented Jan 8, 2024

@hasithaa shall we prioritize this

@hasithaa
Copy link
Contributor

hasithaa commented Jan 8, 2024

There are some limitations with resource path syntax, hence not all possible syntax variations are supported. We had a chat with @shafreenAnfar, @NipunaRanasinghe and decided to go ahead with remote method syntax when we have such limitations for Ballerina libraries.

@NipunaRanasinghe
Copy link
Contributor

@gimantha any update on this? We are waiting on this fix to release the OpenAI Assistants connector.

@gimantha gimantha moved this from Planned for Sprint to In Progress in Ballerina Team Main Board Nov 12, 2024
gimantha added a commit to gimantha/ballerina-lang that referenced this issue Nov 17, 2024
gimantha added a commit to gimantha/ballerina-lang that referenced this issue Dec 4, 2024
@gimantha gimantha moved this from In Progress to PR Sent in Ballerina Team Main Board Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/Blocker Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
Status: PR Sent
Development

Successfully merging a pull request may close this issue.

6 participants