Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
930 stars 193 forks source link

[Improvement]: Enhance CLI to support @env() for enum options #1781

Open JerryNixon opened 1 year ago

JerryNixon commented 1 year ago

What happened?

When doing this in the CLI:

dab init --config "dab-config.json" --host-mode "@env('mode')"

I got this:

Option 'host-mode' is defined with a bad format.

It seems to me that validation is being done prematurely. av --v

Version

Microsoft.DataApiBuilder 0.9.5-rc

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

abhishekkumams commented 1 year ago

It would be little harsh to say cli doesn't support @env().

For the case highlighted above, --host-mode is of Enum type, that can be supplied with only two values either Development or Production.

where as any options with string type can be easily supplied with @env(), for example --connection-string

JerryNixon commented 1 year ago

Agreed. If we are going to support some and not all, we need to either "fix" it or document it.