Skip to content

[Bug]: Escape characters in Config from CLI #1687

@JerryNixon

Description

@JerryNixon

What happened?

When you run this CLI command:

dab init --host-mode development --database-type mssql --connection-string "@env('my-connection-string')"

The connection-string line in the configuration file looks like this:

{
  "$schema": "https://github.com/Azure/data-api-builder/releases/download/v0.8.49/dab.draft.schema.json",
  "data-source": {
    "database-type": "mssql",
    "connection-string": "@env(\u0027my-connection-string\u0027)",
    "options": {
      "set-session-context": false
    }
  },

This value \u0027 is the unicode escape sequence for single quote. Does it work? Yes. However, this cryptic value is not obvious to developers (especially new or emerging developers) and using the actual single quote character ' instead of this lets the CLI create expected values that do not require mental parsing to read. I do not suggest we stop supporting escape sequences, but I do suggest we use the character supplied by the developer and don't translate it under them.

Version

Microsoft.DataApiBuilder 0.8.49+0aebfe2179ee27d1e1723776dd4662459674e987

What database are you using?

Azure SQL

What hosting model are you using?

Local (including CLI)

Which API approach are you accessing DAB through?

REST, GraphQL

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressiontriageissues to be triaged

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions