Azure / Azure/data-api-builder

🥕[Bug]: CLI cannot update MAP when columns have special chars.

Open
#1,599 0 comments 0 reactions 1 assignee Claimed by @seantleonard View on GitHub
bug
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

### 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:

````SQL
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.