fix: align CLI HelpText defaults and descriptions with JSON schema (Group 2)#3417
fix: align CLI HelpText defaults and descriptions with JSON schema (Group 2)#3417souvikghosh04 wants to merge 6 commits intomainfrom
Conversation
Fixes 14 issues where CLI option help text showed incorrect default values or descriptions that didn't match the JSON schema: ConfigureOptions.cs: - DML tool defaults: true -> false (7 tools: #3347-#3353) - multiple-mutations.create.enabled default: true -> false (#3354) - host.mode default: Development -> production (#3355) - set-session-context: removed misleading '(default)' text (#3356) - depth-limit default: infinity -> null (no limit) (#3357) - database-type: use lowercase values, add cosmosdb_postgresql (#3358) InitOptions.cs: - rest.request-body-strict default: false -> true (#3360) - database-type: remove dwsql (not in schema) (#3358) AddTelemetryOptions.cs: - Remove duplicate '(Default: X)' from HelpText where Default= attribute already displays the value (#3356) - Fix otel-service-name description from 'Headers' to 'Service name' dab.draft.schema.json: - aggregate-records object form .enabled default: true -> false to match top-level default (#3347)
…m/Azure/data-api-builder into Usr/sogh/grp2-schema-cli-mismatch
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Aligns CLI --help output with the JSON schema and runtime defaults by correcting default values, descriptions, and enum/value lists.
Changes:
- Updated CLI option HelpText defaults/descriptions for
init,configure, andadd-telemetrycommands. - Corrected allowed/enum value lists (notably database type values/casing).
- Updated JSON schema defaults for MCP DML tools to reflect runtime behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Cli/Commands/InitOptions.cs | Adjusts --database-type supported values list and updates HelpText default for rest.request-body-strict. |
| src/Cli/Commands/ConfigureOptions.cs | Fixes HelpText for database type values/casing, removes misleading default text, and corrects GraphQL/host-mode defaults/description. |
| src/Cli/Commands/AddTelemetryOptions.cs | Removes duplicated default text (when Default= is present) and fixes OTEL service-name description. |
| schemas/dab.draft.schema.json | Changes MCP DML tool defaults to true to match runtime defaults. |
…ve hardcoded default, clarify otel-protocol - depth-limit: clarify allowed values as '-1 (no limit) or 1..2147483647' instead of contradictory range + -1 instruction - host.mode: use 'Default: Production' (title-case) to match the enum values shown in the same HelpText - rest.request-body-strict: remove hardcoded '(Default: true)' from HelpText since no Default= attribute is set on the option - otel-protocol: use 'grpc, httpprotobuf' instead of 'grpc/httpprotobuf' to avoid reading as a single token
RubenCerna2079
left a comment
There was a problem hiding this comment.
Still missing some bugs that need to be fixed from #3432, let me know if you plan to solve those on a different PR.
|
|
||
| // When true, DAB rejects extraneous/unmapped fields in the REST request body (strict mode). When false, extraneous fields are allowed and ignored. | ||
| [Option("rest.request-body-strict", Required = false, HelpText = "(Default: false) When true, rejects extraneous/unmapped fields in the REST request body. When false, allows and ignores them.")] | ||
| [Option("rest.request-body-strict", Required = false, HelpText = "When true, rejects extraneous/unmapped fields in the REST request body. When false, allows and ignores them.")] |
There was a problem hiding this comment.
Does this default to anything specifically?
| public string? DataSourceUserDelegatedAuthDatabaseAudience { get; } | ||
|
|
||
| [Option("runtime.graphql.depth-limit", Required = false, HelpText = "Max allowed depth of the nested query. Allowed values: (0,2147483647] inclusive. Default is infinity. Use -1 to remove limit.")] | ||
| [Option("runtime.graphql.depth-limit", Required = false, HelpText = "Max allowed depth of a nested query. Allowed values: -1 (no limit) or 1..2147483647. Default: null (no limit).")] |
There was a problem hiding this comment.
I am not following why we say default is null if the value for no limit is -1
| } | ||
|
|
||
| [Option("database-type", Required = true, HelpText = "Type of database to connect. Supported values: mssql, cosmosdb_nosql, cosmosdb_postgresql, mysql, postgresql, dwsql")] | ||
| [Option("database-type", Required = true, HelpText = "Type of database to connect. Supported values: mssql, cosmosdb_nosql, cosmosdb_postgresql, mysql, postgresql")] |
There was a problem hiding this comment.
I am confused as to why we need to remove this type if in the documentation it says that we support it. And I thought we already supported this. Maybe I am just not aware of how this type is used.
https://learn.microsoft.com/en-us/azure/data-api-builder/configuration/data-source#data-source-1:~:text=2016-,dwsql,-Azure%20Synapse%20Analytics
| public bool? RuntimeGraphQLAllowIntrospection { get; } | ||
|
|
||
| [Option("runtime.graphql.multiple-mutations.create.enabled", Required = false, HelpText = "Enable/Disable multiple-mutation create operations on DAB's generated GraphQL schema. Default: true (boolean).")] | ||
| [Option("runtime.graphql.multiple-mutations.create.enabled", Required = false, HelpText = "Enable/Disable multiple-mutation create operations on DAB's generated GraphQL schema. Default: false (boolean).")] |
There was a problem hiding this comment.
I see some places where we still write the default value in the HelpText but we change it in others so that it is in the Default parameter. I think all of them should be in one place for consistency.
| public CompressionLevel? RuntimeCompressionLevel { get; } | ||
|
|
||
| [Option("runtime.host.mode", Required = false, HelpText = "Set the host running mode of DAB in Development or Production. Default: Development.")] | ||
| [Option("runtime.host.mode", Required = false, HelpText = "Set the host running mode of DAB in Development or Production. Default: Production.")] |
There was a problem hiding this comment.
Same as previous comment
Summary
Fixes 14 issues where CLI option
--helptext showed incorrect default values, wrong descriptions, or enum mismatches compared to the JSON schema (dab.draft.schema.json) and C# runtime defaults.Issues Addressed
2a. Default Value Mismatches (8 issues)
runtime.mcp.dml-tools.read-recordsruntime.mcp.dml-tools.create-recordruntime.mcp.dml-tools.describe-entitiesruntime.graphql.multiple-mutations.create.enabledruntime.host.modedata-source.options.set-session-contextruntime.rest.request-body-strictruntime.mcp.dml-tools.aggregate-records2b. Description/Display Bugs (3 issues)
--otel-service-namedab add-telemetryoptions(Default: X)from HelpText whereDefault=attribute already displays the valueruntime.graphql.depth-limit2c. Enum Mismatches (3 issues)
--database-type(init)dwsqlnot in schema--database-type(configure)--database-type(configure)Cross-group overlaps resolved
rest.request-body-strict) ? same fix as [Bug]: Schema/Cli mismatch runtime.rest.request-body-strict #3353host.mode) ? same fix as [Bug]: Schema/Cli mismatch runtime.host.mode #3351set-session-context) ? same fix as [Bug]: Schema/Cli mismatch data-source.options.set-session-context #3352multiple-mutations.create.enabled) ? same fix as [Bug]: Schema/Cli mismatch runtime.graphql.multiple-mutations.create.enabled #3350trueto match C# runtimeFiles Changed
src/Cli/Commands/ConfigureOptions.cssrc/Cli/Commands/InitOptions.cssrc/Cli/Commands/AddTelemetryOptions.csschemas/dab.draft.schema.jsonDmlToolsConfig.DEFAULT_ENABLED = true)Testing