Closed ThisaruGuruge closed 1 month ago
May be the same issue as https://github.com/ballerina-platform/ballerina-lang/issues/43122, for which there is already a PR https://github.com/ballerina-platform/ballerina-lang/pull/43121.
I'll also check, but FYI @HindujaB.
Seems like it is not the type reference issue. But could be https://github.com/ballerina-platform/ballerina-lang/issues/33594, https://github.com/ballerina-platform/ballerina-lang/issues/42906#issuecomment-2227344070 (as Hinduja is also checking), if access is in the attach
method.
Can we consider accessing at a method like start
if this is the case?
Moving to the start method solved the issue, but we need a proper fix. But considering the time constraints, we are going ahead with this fix.
As we have an issue [1] that follows up with original cause and the provided workaround is working, I am closing the issue. Please feels free to reopen if there's any concern.
[1] https://github.com/ballerina-platform/ballerina-lang/issues/33594
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.
Description
When the
getAnnotation()
orgetAnnotations()
method is called on theResourceMethodType
value, the annotations are not present even though the annotations are added in the Ballerina code.Steps to Reproduce
Consider the following Ballerina code:
We pass the
BObject
value of the GraphQL service object to the native code when the service is attached to the listener. In the native code, the annotations for thegreeting
resource are there.Then we iterate through the
ResourceMethodType
values of the service object, and when try to access the annotations of the resource methods of theProfile
type, thegetAnnotations
API returns null, even though theget name()
resource does have an annotation. This is a blocker for https://github.com/ballerina-platform/ballerina-library/issues/6722 where the annotation values cannot be accessed so the complexity values are incorrect.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