Fix data mapping function detection to exclude regular and natural expression functions in data_mappings.bal#380
Fix data mapping function detection to exclude regular and natural expression functions in data_mappings.bal#380
Conversation
|
|
Co-authored-by: dulajdilshan <25485997+dulajdilshan@users.noreply.github.com>
Co-authored-by: dulajdilshan <25485997+dulajdilshan@users.noreply.github.com>
|
@copilot Have we covered all the cases in the issue? |
Yes, all cases are now covered. The fix handles:
Added an additional check (commit f7ec891) to skip NP functions from data_mappings.bal, ensuring consistent behavior with NP functions in functions.bal. The test case now includes a natural expression function to validate this scenario. |
Co-authored-by: dulajdilshan <25485997+dulajdilshan@users.noreply.github.com>
model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/CommonUtils.java
Outdated
Show resolved
Hide resolved
Co-authored-by: dulajdilshan <25485997+dulajdilshan@users.noreply.github.com>
|
Created #382, since it is not allowed to merge changes from authors without signed contributors license agreement. |
Fix: Functions in data_mappings.bal incorrectly marked as data mapping functions
Summary
Fixed the issue where all functions in
data_mappings.balwere incorrectly marked as data mapping functions. The fix ensures that only expression-bodied functions (excluding natural expression functions) are marked as data mapping functions.All Cases Covered:
transform,mapPersonToEmployee) →isDataMappedFunction: truecustomHelper) →isDataMappedFunction: falsevalidateAge) →isDataMappedFunction: falsegenerateGreeting) → Skipped entirely (not shown in results)Changes Made:
isDataMappingFunction()helper method (fixed checkstyle line length)from()method for backward compatibilitydata_mappings.baldocument to search commandcustom_func_projwith all function types including NP functionOriginal prompt
Fixes wso2/product-ballerina-integrator#26
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.