diff --git a/schemas/dab.draft.schema.json b/schemas/dab.draft.schema.json index 3f6c5ce714..1c2cf2ec74 100644 --- a/schemas/dab.draft.schema.json +++ b/schemas/dab.draft.schema.json @@ -24,7 +24,7 @@ "postgresql", "mysql", "cosmosdb_nosql", - "cosmosdb_postgresql" + "dwsql" ] }, "connection-string": { @@ -32,7 +32,7 @@ "type": "string" }, "options": { - "description": "Database specific properties for the backend database", + "description": "Database-specific connection and configuration properties. Available options depend on the database-type.", "type": "object" }, "health": { @@ -42,7 +42,7 @@ "properties": { "enabled": { "$ref": "#/$defs/boolean-or-string", - "description": "Enable health check endpoint for something", + "description": "Enable health check for this data source.", "default": true, "additionalProperties": false }, @@ -97,7 +97,7 @@ "then": { "properties": { "options": { - "description": "Database specific properties for the backend database", + "description": "Database-specific connection and configuration properties. Available options depend on the database-type.", "type": "object", "additionalProperties": false, "properties": { @@ -124,7 +124,7 @@ "if": { "properties": { "database-type": { - "const": "mssql" + "enum": ["mssql", "dwsql"] } } }, @@ -212,12 +212,13 @@ }, "enabled": { "$ref": "#/$defs/boolean-or-string", - "description": "Allow enabling/disabling REST requests for all entities." + "description": "Allow enabling/disabling REST requests for all entities.", + "default": true }, "request-body-strict": { "$ref": "#/$defs/boolean-or-string", "description": "Does not allow extraneous fields in request body when set to true.", - "default": true + "default": false } } }, @@ -237,11 +238,12 @@ }, "enabled": { "$ref": "#/$defs/boolean-or-string", - "description": "Allow enabling/disabling GraphQL requests for all entities." + "description": "Allow enabling/disabling GraphQL requests for all entities.", + "default": true }, "depth-limit": { "type": [ "integer", "null" ], - "description": "Maximum allowed depth of a GraphQL query.", + "description": "Maximum allowed depth of a GraphQL query. Only positive integers are enforced. Default: null (no limit). Use -1 to explicitly remove a previously set limit.", "default": null }, "multiple-mutations": { @@ -299,32 +301,32 @@ "describe-entities": { "$ref": "#/$defs/boolean-or-string", "description": "Enable/disable the describe-entities tool.", - "default": false + "default": true }, "create-record": { "$ref": "#/$defs/boolean-or-string", "description": "Enable/disable the create-record tool.", - "default": false + "default": true }, "read-records": { "$ref": "#/$defs/boolean-or-string", "description": "Enable/disable the read-records tool.", - "default": false + "default": true }, "update-record": { "$ref": "#/$defs/boolean-or-string", "description": "Enable/disable the update-record tool.", - "default": false + "default": true }, "delete-record": { "$ref": "#/$defs/boolean-or-string", "description": "Enable/disable the delete-record tool.", - "default": false + "default": true }, "execute-entity": { "$ref": "#/$defs/boolean-or-string", "description": "Enable/disable the execute-entity tool.", - "default": false + "default": true }, "aggregate-records": { "description": "Enable/disable or configure the aggregate-records MCP tool.", @@ -353,7 +355,7 @@ } } ], - "default": false + "default": true } } } @@ -911,9 +913,11 @@ "additionalProperties": false, "properties": { "role": { - "type": "string" + "type": "string", + "description": "The role to which this permission applies (e.g. anonymous, authenticated, or a custom role)." }, "actions": { + "description": "The operations permitted for this role. Use '*' to allow all, or specify an array of actions.", "oneOf": [ { "type": "string", @@ -1304,9 +1308,11 @@ "additionalProperties": false, "properties": { "role": { - "type": "string" + "type": "string", + "description": "The role to which this permission applies (e.g. anonymous, authenticated, or a custom role)." }, "actions": { + "description": "The operations permitted for this role. Use '*' to allow all, or specify an array of actions.", "oneOf": [ { "type": "string", @@ -1378,9 +1384,11 @@ "additionalProperties": false, "properties": { "role": { - "type": "string" + "type": "string", + "description": "The role to which this permission applies (e.g. anonymous, authenticated, or a custom role)." }, "actions": { + "description": "The operations permitted for this role. Use '*' to allow all, or specify an array of actions.", "oneOf": [ { "type": "string", diff --git a/src/Cli/Commands/AddTelemetryOptions.cs b/src/Cli/Commands/AddTelemetryOptions.cs index 8ec9313d14..f30552b19b 100644 --- a/src/Cli/Commands/AddTelemetryOptions.cs +++ b/src/Cli/Commands/AddTelemetryOptions.cs @@ -44,7 +44,7 @@ public AddTelemetryOptions( public string? AppInsightsConnString { get; } // To specify whether Application Insights telemetry should be enabled. This flag is optional and default value is false. - [Option("app-insights-enabled", Default = CliBool.False, Required = false, HelpText = "(Default: false) Enable/Disable Application Insights")] + [Option("app-insights-enabled", Default = CliBool.False, Required = false, HelpText = "Enable/Disable Application Insights.")] public CliBool? AppInsightsEnabled { get; } // Connection string for the Open Telemetry resource to which telemetry data should be sent. @@ -53,7 +53,7 @@ public AddTelemetryOptions( public string? OpenTelemetryEndpoint { get; } // To specify whether Open Telemetry telemetry should be enabled. This flag is optional and default value is false. - [Option("otel-enabled", Default = CliBool.False, Required = false, HelpText = "(Default: false) Enable/Disable OTEL")] + [Option("otel-enabled", Default = CliBool.False, Required = false, HelpText = "Enable/Disable OTEL.")] public CliBool? OpenTelemetryEnabled { get; } // Headers for the Open Telemetry resource to which telemetry data should be sent. @@ -61,11 +61,11 @@ public AddTelemetryOptions( public string? OpenTelemetryHeaders { get; } // Specify the Open Telemetry protocol. This flag is optional and default value is grpc. - [Option("otel-protocol", Default = OtlpExportProtocol.Grpc, Required = false, HelpText = "(Default: grpc) Accepted: grpc/httpprotobuf")] + [Option("otel-protocol", Default = OtlpExportProtocol.Grpc, Required = false, HelpText = "Accepted: grpc, httpprotobuf.")] public OtlpExportProtocol? OpenTelemetryExportProtocol { get; } // Service Name for the Open Telemetry resource to which telemetry data should be sent. This flag is optional and default value is dab. - [Option("otel-service-name", Default = "dab", Required = false, HelpText = "(Default: dab) Headers for Open Telemetry for telemetry data")] + [Option("otel-service-name", Default = "dab", Required = false, HelpText = "Service name for Open Telemetry.")] public string? OpenTelemetryServiceName { get; } public int Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) diff --git a/src/Cli/Commands/ConfigureOptions.cs b/src/Cli/Commands/ConfigureOptions.cs index 66c560405b..0c109edbe0 100644 --- a/src/Cli/Commands/ConfigureOptions.cs +++ b/src/Cli/Commands/ConfigureOptions.cs @@ -178,7 +178,7 @@ public ConfigureOptions( ShowEffectivePermissions = showEffectivePermissions; } - [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.")] public string? DataSourceDatabaseType { get; } [Option("data-source.connection-string", Required = false, HelpText = "Connection string for the data source.")] @@ -193,7 +193,7 @@ public ConfigureOptions( [Option("data-source.options.schema", Required = false, HelpText = "Schema path for Cosmos DB for NoSql.")] public string? DataSourceOptionsSchema { get; } - [Option("data-source.options.set-session-context", Required = false, HelpText = "Enable session context. Allowed values: true (default), false.")] + [Option("data-source.options.set-session-context", Required = false, HelpText = "Enable session context. Allowed values: true, false.")] public bool? DataSourceOptionsSetSessionContext { get; } [Option("data-source.health.name", Required = false, HelpText = "Identifier for data source in health check report.")] @@ -217,7 +217,7 @@ public ConfigureOptions( [Option("data-source-files", Required = false, Separator = ',', HelpText = "Comma-separated list of additional runtime config files for multi-database scenarios.")] public IEnumerable? DataSourceFiles { 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-2147483647, or -1 to remove a previously set limit. Default: -1.")] public int? DepthLimit { get; } [Option("runtime.graphql.enabled", Required = false, HelpText = "Enable DAB's GraphQL endpoint. Default: true (boolean).")] @@ -229,7 +229,7 @@ public ConfigureOptions( [Option("runtime.graphql.allow-introspection", Required = false, HelpText = "Allow/Deny GraphQL introspection requests in GraphQL Schema. Default: true (boolean).")] 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).")] public bool? RuntimeGraphQLMultipleMutationsCreateEnabled { get; } [Option("runtime.rest.enabled", Required = false, HelpText = "Enable DAB's Rest endpoint. Default: true (boolean).")] @@ -238,7 +238,7 @@ public ConfigureOptions( [Option("runtime.rest.path", Required = false, HelpText = "Customize DAB's REST endpoint path. Default: '/api' Conditions: Prefix path with '/'.")] 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).")] public bool? RuntimeRestRequestBodyStrict { get; } [Option("runtime.mcp.enabled", Required = false, HelpText = "Enable DAB's MCP endpoint. Default: true (boolean).")] @@ -307,7 +307,7 @@ public ConfigureOptions( [Option("runtime.health.roles", Required = false, Separator = ',', HelpText = "Comma-separated list of roles allowed to access health check details.")] public IEnumerable? RuntimeHealthRoles { 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.")] public HostMode? RuntimeHostMode { get; } [Option("runtime.host.cors.origins", Required = false, HelpText = "Overwrite Allowed Origins in CORS. Default: [] (Space separated array of strings).")] diff --git a/src/Cli/Commands/EntityOptions.cs b/src/Cli/Commands/EntityOptions.cs index d22a5d46fc..76988d4c75 100644 --- a/src/Cli/Commands/EntityOptions.cs +++ b/src/Cli/Commands/EntityOptions.cs @@ -87,13 +87,13 @@ public EntityOptions( [Option("rest", Required = false, HelpText = "Route for rest api.")] public string? RestRoute { get; } - [Option("rest.methods", Required = false, Separator = ',', HelpText = "HTTP actions to be supported for stored procedure. Specify the actions as a comma separated list. Valid HTTP actions are : [GET, POST, PUT, PATCH, DELETE]")] + [Option("rest.methods", Required = false, Separator = ',', HelpText = "HTTP actions to be supported for stored procedure. Specify the actions as a comma separated list. Valid HTTP actions are: [get, post, put, patch, delete]")] public IEnumerable? RestMethodsForStoredProcedure { get; } [Option("graphql", Required = false, HelpText = "Type of graphQL.")] public string? GraphQLType { get; } - [Option("graphql.operation", Required = false, HelpText = $"GraphQL operation to be supported for stored procedure. Valid operations are : [Query, Mutation] ")] + [Option("graphql.operation", Required = false, HelpText = "GraphQL operation to be supported for stored procedure. Valid operations are: [query, mutation]")] public string? GraphQLOperationForStoredProcedure { get; } [Option("fields.include", Required = false, Separator = ',', HelpText = "Fields that are allowed access to permission.")] diff --git a/src/Cli/Commands/InitOptions.cs b/src/Cli/Commands/InitOptions.cs index b44fd8d15e..0d3f8f7824 100644 --- a/src/Cli/Commands/InitOptions.cs +++ b/src/Cli/Commands/InitOptions.cs @@ -90,7 +90,7 @@ public InitOptions( [Option("set-session-context", Default = false, Required = false, HelpText = "Enable sending data to MsSql using session context.")] public bool SetSessionContext { get; } - [Option("host-mode", Default = HostMode.Production, Required = false, HelpText = "Specify the Host mode - Development or Production")] + [Option("host-mode", Default = HostMode.Production, Required = false, HelpText = "Specify the Host mode - development or production")] public HostMode HostMode { get; } [Option("cors-origin", Separator = ',', Required = false, HelpText = "Specify the list of allowed origins.")] diff --git a/src/Cli/Utils.cs b/src/Cli/Utils.cs index 14096eb969..e7bc30b758 100644 --- a/src/Cli/Utils.cs +++ b/src/Cli/Utils.cs @@ -619,7 +619,7 @@ public static bool TryConvertRestMethodNameToRestMethod(string? method, out Supp { if (!Enum.TryParse(method, ignoreCase: true, out restMethod)) { - _logger.LogError("Invalid REST Method. Supported methods are {restMethods}.", string.Join(", ", Enum.GetNames())); + _logger.LogError("Invalid REST Method. Supported methods are {restMethods}.", string.Join(", ", Enum.GetNames().Select(n => n.ToLowerInvariant()))); return false; } @@ -669,8 +669,8 @@ public static bool TryConvertGraphQLOperationNameToGraphQLOperation(string? oper { _logger.LogError( "Invalid GraphQL Operation. Supported operations are {queryName} and {mutationName}.", - GraphQLOperation.Query, - GraphQLOperation.Mutation); + nameof(GraphQLOperation.Query).ToLowerInvariant(), + nameof(GraphQLOperation.Mutation).ToLowerInvariant()); return false; }