data-api-builder icon indicating copy to clipboard operation
data-api-builder copied to clipboard

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

Open JerryNixon opened this issue 2 years ago • 2 comments

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

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

JerryNixon avatar Oct 06 '23 00:10 JerryNixon

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

abhishekkumams avatar Oct 06 '23 06:10 abhishekkumams

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

JerryNixon avatar Oct 10 '23 21:10 JerryNixon

Also support @akv

JerryNixon avatar Aug 21 '25 02:08 JerryNixon