Cherry-pick: CLI HelpText and JSON schema alignment to release/2.0 (#3417, #3444, #3454, #3471)#3505
Open
souvikghosh04 wants to merge 4 commits intorelease/2.0from
Open
Conversation
…3444) ## Summary - Closes on #3445 Fixes 4 issues where CLI `--help` text and error messages showed PascalCase or UPPERCASE enum values instead of the lowercase values required by the JSON schema. The JSON serialization layer already produces lowercase (via `EnumMemberJsonEnumConverterFactory`), so these fixes align the CLI display layer to match. ## Issues Addressed | Issue | Option | CLI Showed | Schema Requires | Fix | |-------|--------|-----------|-----------------|-----| | #3361 | `--host-mode` (init) | `Development or Production` | `development or production` | HelpText lowercased | | #3362 | `--rest.methods` (add/update) | `[GET, POST, PUT, PATCH, DELETE]` | `[get, post, put, patch, delete]` | HelpText lowercased | | #3363 | `--graphql.operation` (add/update) | `[Query, Mutation]` | `[query, mutation]` | HelpText lowercased | | #3364 | `--graphql.operation` (add/update) | Same as #3363 | Same as #3363 | Same fix | ## Files Changed | File | Changes | |------|---------| | `src/Cli/Commands/InitOptions.cs` | `host-mode` HelpText: lowercase enum values | | `src/Cli/Commands/EntityOptions.cs` | `rest.methods` and `graphql.operation` HelpText: lowercase enum values | | `src/Cli/Utils.cs` | REST method and GraphQL operation error messages: lowercase enum names | ## Testing - [x] Unit tests Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
…roup 2) (#3417) - Closes on #3418 Fixes 14 issues where CLI option `--help` text showed incorrect default values, wrong descriptions, or enum mismatches compared to the JSON schema (`dab.draft.schema.json`) and C# runtime defaults. | # | Property | Before | After | Resolution | |---|----------|--------|-------|------------| | #3347 | `runtime.mcp.dml-tools.read-records` | CLI: true, Schema: false | Both: true | Schema changed false?true to match C# runtime | | #3348 | `runtime.mcp.dml-tools.create-record` | CLI: true, Schema: false | Both: true | Schema changed false?true to match C# runtime | | #3349 | `runtime.mcp.dml-tools.describe-entities` | CLI: true, Schema: false | Both: true | Schema changed false?true to match C# runtime | | #3350 | `runtime.graphql.multiple-mutations.create.enabled` | CLI: true, Schema: false | CLI: false | HelpText corrected to match schema | | #3351 | `runtime.host.mode` | CLI: Development, Schema: production | CLI: production | HelpText corrected to match schema | | #3352 | `data-source.options.set-session-context` | CLI: "(default)" text | No default | Removed misleading text | | #3353 | `runtime.rest.request-body-strict` | init: false, Schema: true | init: false | HelpText corrected to match schema | | #3354 | `runtime.mcp.dml-tools.aggregate-records` | Schema: .enabled=true, top-level=false | Both: true | Schema changed false?true to match C# runtime | | # | Property | Fix | |---|----------|-----| | #3355 | `--otel-service-name` | Changed description from "Headers for Open Telemetry" to "Service name for Open Telemetry" | | #3356 | `dab add-telemetry` options | Removed duplicate `(Default: X)` from HelpText where `Default=` attribute already displays the value | | #3357 | `runtime.graphql.depth-limit` | Changed description from "infinity"/"-1" to "Default: null (no limit)" | | # | Property | Fix | |---|----------|-----| | #3359 | `--database-type` (configure) | Already fixed in PR #3409 | | #3360 | `--database-type` (configure) | Changed to lowercase enum values | - #3378 (`rest.request-body-strict`) ? same fix as #3353 - #3379 (`host.mode`) ? same fix as #3351 - #3380 (`set-session-context`) ? same fix as #3352 - #3381 (`multiple-mutations.create.enabled`) ? same fix as #3350 - #3382 (DML tool defaults) ? same fix as #3347-#3349; schema aligned to `true` to match C# runtime | File | Changes | |------|---------| | `src/Cli/Commands/ConfigureOptions.cs` | 5 HelpText corrections (host.mode, multiple-mutations, set-session-context, depth-limit, database-type) | | `src/Cli/Commands/InitOptions.cs` | 2 HelpText corrections (request-body-strict, database-type) | | `src/Cli/Commands/AddTelemetryOptions.cs` | 4 HelpText/description corrections | | `schemas/dab.draft.schema.json` | DML tool defaults changed false?true (8 locations) to match C# runtime (`DmlToolsConfig.DEFAULT_ENABLED = true`) | - ConfigureOptionsTests: 78 passed, 0 failed - EndToEndTests: 138 passed, 0 failed, 3 skipped - Build: 0 warnings, 0 errors
## Why make this change? Parent issue #3466 Closes #3366 — `runtime.rest.enabled` has no `default` in the JSON schema Closes #3367 — `runtime.graphql.enabled` has no `default` in the JSON schema These schema properties were missing an explicit `default` value. 5 of 7 Group 4 issues (#3378–#3382) were already fixed in PR #3417 as Group 2 overlaps. ## What is this change? Adds `"default": true` to the `enabled` property under both `runtime.rest` and `runtime.graphql` in `schemas/dab.draft.schema.json`. This matches the C# runtime behavior where both REST and GraphQL are enabled by default. ## How was this tested? Schema-only metadata change — no runtime behavior affected. Validated that the schema still passes JSON Schema draft-07 validation. ## Sample Request(s) NA
## Why make this change? Closes #3470 Fixes #3365, #3368, #3369, #3370, #3371 Schema descriptions were missing, placeholder, or misleading — affecting VS Code IntelliSense and tooling that reads JSON Schema metadata. ## What is this change? Updates \schemas/dab.draft.schema.json\ descriptions: | Issue | Property | Fix | |-------|----------|-----| | #3365 | \data-source.health.enabled\ | Updated description | | #3368 | \permissions[].role\ | Added missing description (3 locations) | | #3369 | \permissions[].actions\ | Added missing description (3 locations) | | #3370 | \data-source.options\ | Clarified vague description (2 locations) | | #3371 | \ untime.graphql.depth-limit\ | Documented null (no limit) and -1 (CLI remove limit) semantics | ## How was this tested? Schema-only metadata change — no runtime behavior affected. JSON validated. --------- Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR cherry-picks a set of CLI --help text corrections and JSON schema metadata updates from main into release/2.0, with the goal of aligning CLI-displayed defaults/allowed values/descriptions with the runtime config JSON schema.
Changes:
- Normalize CLI help/error-message display of enum values to match schema-required lowercase values (e.g., REST methods, GraphQL operations, host-mode).
- Update
dab configureHelpText defaults/descriptions and add several new CLI options intended to match newer schema fields. - Improve
schemas/dab.draft.schema.jsondefaults and descriptions (including REST/GraphQL enabled defaults, depth-limit description, MCP DML tool defaults, and permissions descriptions).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/Cli/Utils.cs |
Lowercases supported REST method and GraphQL operation names in CLI error messages. |
src/Cli/Commands/InitOptions.cs |
Updates init HelpText to display lowercase host-mode values. |
src/Cli/Commands/EntityOptions.cs |
Updates stored-procedure-related HelpText to display lowercase REST/GraphQL enum values. |
src/Cli/Commands/ConfigureOptions.cs |
Updates/extends configure HelpText and introduces new configure options intended to align with schema/runtime. |
src/Cli/Commands/AddTelemetryOptions.cs |
Cleans up telemetry option HelpText to avoid duplicated default text and improve descriptions. |
schemas/dab.draft.schema.json |
Adjusts schema enums/defaults/descriptions to improve tooling IntelliSense and align with runtime behavior. |
| @@ -24,15 +24,15 @@ | |||
| "postgresql", | |||
| "mysql", | |||
| "cosmosdb_nosql", | |||
| "$ref": "#/$defs/boolean-or-string", | ||
| "description": "Does not allow extraneous fields in request body when set to true.", | ||
| "default": true | ||
| "default": false |
Comment on lines
+180
to
+189
| public string? DataSourceUserDelegatedAuthProvider { get; } | ||
|
|
||
| [Option("data-source.health.enabled", Required = false, HelpText = "Enable health check for this data source. Default: true (boolean).")] | ||
| public bool? DataSourceHealthEnabled { get; } | ||
|
|
||
| [Option("data-source.health.threshold-ms", Required = false, HelpText = "Health check response time threshold in milliseconds. Default: 1000. Range: 1-2147483647.")] | ||
| public int? DataSourceHealthThresholdMs { get; } | ||
|
|
||
| [Option("data-source-files", Required = false, Separator = ',', HelpText = "Comma-separated list of additional runtime config files for multi-database scenarios.")] | ||
| public IEnumerable<string>? DataSourceFiles { get; } |
Comment on lines
+261
to
+270
| public bool? RuntimeHealthEnabled { get; } | ||
|
|
||
| [Option("runtime.health.cache-ttl-seconds", Required = false, HelpText = "Time to live in seconds for cached health check results. Default: 5.")] | ||
| public int? RuntimeHealthCacheTtlSeconds { get; } | ||
|
|
||
| [Option("runtime.health.max-query-parallelism", Required = false, HelpText = "Maximum number of parallel health check queries. Default: 4. Range: 1-8.")] | ||
| public int? RuntimeHealthMaxQueryParallelism { get; } | ||
|
|
||
| [Option("runtime.health.roles", Required = false, Separator = ',', HelpText = "Comma-separated list of roles allowed to access health check details.")] | ||
| public IEnumerable<string>? RuntimeHealthRoles { get; } |
| [Option("data-source-files", Required = false, Separator = ',', HelpText = "Comma-separated list of additional runtime config files for multi-database scenarios.")] | ||
| public IEnumerable<string>? DataSourceFiles { get; } | ||
|
|
||
| [Option("runtime.graphql.depth-limit", Required = false, HelpText = "Max allowed depth of a nested query. Allowed values: 1-2147483647, or -1 to remove a previously set limit. Default: -1.")] |
| public string? RuntimeRestPath { get; } | ||
|
|
||
| [Option("runtime.rest.request-body-strict", Required = false, HelpText = "Prohibit extraneous REST request body fields. Default: true (boolean).")] | ||
| [Option("runtime.rest.request-body-strict", Required = false, HelpText = "Prohibit extraneous REST request body fields. Default: false (boolean).")] |
| } | ||
|
|
||
| [Option("data-source.database-type", Required = false, HelpText = "Database type. Allowed values: MSSQL, PostgreSQL, CosmosDB_NoSQL, MySQL.")] | ||
| [Option("data-source.database-type", Required = false, HelpText = "Database type. Allowed values: mssql, postgresql, cosmosdb_nosql, mysql, dwsql.")] |
Aniruddh25
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picks CLI HelpText and schema description improvements from main to release/2.0:
Note: This PR should be merged after #3504 (CLI structure fixes) as it depends on the new options introduced there.