Accessing the annotation field values via AnnotationSymbol #37194
Labels
Area/SemanticAPI
Semantic API Related Issues #Compiler
Points/2
Equivalent to two days effort
Team/CompilerFETools
Semantic API, Formatter, Shell
Type/NewFeature
Milestone
Description:
If there is a annotation in record field, In openAPI we reuired to access, given annotation values for generating the openAPI specification.
The current implementation is driven by accessing RecordFieldTypeSymbol in the given record field. It returns the details about recordfield and we pick annotation details via calling .getAnnotations() but it didn't content annotation current available field values.
In above example, we need to get the details in
name
record field's annotation field maxLength: 14Describe your problem(s)
.findNode()
. But this approach I met with limitation when we are going to access type that defined in the separate model. Because our util we use onlysematicModel
andSyntaxTree
that are not enough for getting separate module syntax node details.package
. It will cause to some kind of conflict to the current util since it may additional process to mapping. Complex can be delaying to generate openapi spec, resolving dependency issue, interminante issue etc. (This util has used in several modules http, choreo, vsCode. Therefore we required to safe method to solve this.)Describe your solution(s)
Considering the above issue and 1, 2 points , it would be great if we can have given
AnnotationSymbol
with extrafield that value with Optional regarding available record fields with their values.Related issue : ballerina-platform/ballerina-library#5109
The text was updated successfully, but these errors were encountered: