data-api-builder
data-api-builder copied to clipboard
🥕[Bug]: CLI cannot update MAP when columns have special chars.
What happened?
Start with this (works fine):
dab add "Sample" --config "dab-config.json" --source "[dbo].[Sample]" --source.type "Table" --source.key-fields "Id1,Id2,Id3" --rest "sample" --permissions "anonymous:create,read,update,delete"
Then, running this:
dab update "Sample" --config "dab-config.json" --map "Id1:Id1,Id2:Id2,Id3:Id3,Name:Name,UpperName:UpperName,Weird Name:WeirdName,Super weird Name-here:SuperweirdNamehere,Very % strange-like # name @ :Verystrangelikename,lowercase:lowercase"
Results in this:
Information: Microsoft.DataApiBuilder 0.6.13+32fc03f4fe439d02aef454f10cc58e50d0d29f79
Information: User provided config file: dab-config.json
Error: Invalid format for --map. Acceptable format --map "backendName1:exposedName1,backendName2:exposedName2,...".
Error: Failed to update the Entity: Sample.
Error: Could not update the entity: Sample.
SQL Schema:
CREATE TABLE [dbo].[Sample]
(
[Id1] INT NOT NULL ,
[Id2] INT NOT NULL ,
[Id3] INT NOT NULL ,
Name VARCHAR(50),
UpperName AS UPPER(Name),
[Weird Name] NCHAR(10) NULL,
[Super weird Name-here] NCHAR(10) NULL,
[Very % strange-like # name @ ] NCHAR(10) NULL,
lowercase INT,
PRIMARY KEY(Id1, Id2, Id3)
)
Version
Microsoft.DataApiBuilder 0.6.13+32fc03f4fe439d02aef454f10cc58e50d0d29f79
What database are you using?
Azure SQL
What hosting model are you using?
No response
Which API approach are you accessing DAB through?
REST
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct