-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Describe the bug
I've gone through the documentation (link below) about how to connect and execute a SQL stored procedure, but when executing I get the following error.
Error loading premiums: Execute operation failure: Cannot read properties of undefined (reading 'path').
I've tracked the issue back to the fact that the service created when creating the connection with PAC CLI is setting the "operationname" to the name of the stored procedure BUT it is capitalising the first latter, so a sproc called "sp_get_data", the associated files are all called Sp_get_data which is fine...... but the "operationname" is used in the buildOperationUrl method with the following line (line 25818 in the debugger)
const path = dataSourceInfo.apis[operationName].path;
this line fails due to the key not matching based on the case!
I'm hoping I missed something somewhere and I've got something set wrong in config, but when I change this to the correct case everything works fine.
Steps to Reproduce
- Set Up new code app following documentation
- Create stored procedure in SQL
- Connect to SQL database using as per docs
e.g. pac code add-data-source -a "shared_sql" -c "aaaa0000bb11222233cc444444dddddd" -d "sql-codeapps-dev.database.windows.net,sqldb-codeapps-dev" -sp "dbo.getallprojects"
- Checked operationame on connectorOperation in generated class of GetallprojectsService.ts
Expected behavior
Should maintain correct casing when creating service class and associated config
Actual behavior
Sets first letter of the operationame to upper case resulting in error
Error loading premiums: Execute operation failure: Cannot read properties of undefined (reading 'path')
Environment information
vite v7.3.1
PAC CLI 2.4.1 (Latest).