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

Closed
rdulmina opened this issue Jun 6, 2023 · 7 comments · Fixed by #43589
Closed

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

rdulmina opened this issue Jun 6, 2023 · 7 comments · Fixed by #43589
Assignees
Labels
Priority/Blocker Reason/EngineeringMistake The issue occurred due to a mistake made in the past. 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.

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

1 similar comment
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@gimantha gimantha added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/Blocker Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants