Closes #2200, an issue with dab validate -c "path_to_config.json" where environment variable @env('ENV_VAR_NAME') references are unresolved during config schema validation and schema validation always fails. The issue specifically calls out an error when an environment variable is used for the property database-type can't resolve an environment variable and properly set an enum value (mssql, pgsql, mysql, etc) for the property.
What is this change?
This change corrects how RuntimeConfigValidator::ValidateConfigSchema(...) resolves environment variables in the runtime config. The usage of string jsonData = runtimeConfig.ToJson(); converts the runtime config object (which already has environment variables resolved) into valid json which can then be validated against dab.draft.schema.json.
How was this tested?
[x] Integration Tests: added a test which exercises the code path that validates the dab runtime config against the dab json schema. By ensuring that no schema validation errors occur due to unresolved environment variables.
Sample Request(s)
Add the file launchSettings.json to src/Cli/Properties with the following contents:
Why make this change?
dab validate -c "path_to_config.json"
where environment variable@env('ENV_VAR_NAME')
references are unresolved during config schema validation and schema validation always fails. The issue specifically calls out an error when an environment variable is used for the propertydatabase-type
can't resolve an environment variable and properly set an enum value (mssql, pgsql, mysql, etc) for the property.What is this change?
RuntimeConfigValidator::ValidateConfigSchema(...)
resolves environment variables in the runtime config. The usage ofstring jsonData = runtimeConfig.ToJson();
converts the runtime config object (which already has environment variables resolved) into valid json which can then be validated againstdab.draft.schema.json
.How was this tested?
Sample Request(s)
Add the file
launchSettings.json
tosrc/Cli/Properties
with the following contents:and modify your dab-config.json to have the following contents (assumes that you've deployed the DAB test project's .sql script: