Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Cli.Tests/ConfigGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void TestSpecialCharactersInConnectionString()
""rest"": {
""enabled"": true,
""path"": ""/api"",
""request-body-strict"": true
""request-body-strict"": false
},
""graphql"": {
""enabled"": true,
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Tests/EndToEndTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ public void TestEnabledDisabledFlagsForApis(
[DataTestMethod]
[DataRow(true, false, DisplayName = "dab init command specifies --rest.request-body-strict as false - REST request body allows extraneous fields.")]
[DataRow(true, true, DisplayName = "dab init command specifies --rest.request-body-strict as true - REST request body doesn't allow extraneous fields.")]
[DataRow(false, true, DisplayName = "dab init command does not include --rest.request-body-strict flag. The default behavior is followed - REST request body doesn't allow extraneous fields.")]
[DataRow(false, false, DisplayName = "dab init command does not include --rest.request-body-strict flag. The default behavior is followed - REST request body allows extraneous fields.")]
public void TestRestRequestBodyStrictMode(bool includeRestRequestBodyStrictFlag, bool isRequestBodyStrict)
{
string[] initArgs = { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--host-mode", "development", "--database-type", "mssql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Rest: {
Enabled: false,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Rest: {
Enabled: false,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-endpoint,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /abc,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Rest: {
Enabled: false,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Rest: {
Enabled: false,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Rest: {
Enabled: false,
Path: /api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Rest: {
Enabled: true,
Path: /rest-api,
RequestBodyStrict: true
RequestBodyStrict: false
},
GraphQL: {
Enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Commands/InitOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public InitOptions(

// Since the rest.request-body-strict option does not have a default value, it is required to specify a value for this option if it is
// included in the init command.
[Option("rest.request-body-strict", Required = false, HelpText = "(Default: true) Allow extraneous fields in the request body for REST.")]
[Option("rest.request-body-strict", Required = false, HelpText = "(Default: false) Allow extraneous fields in the request body for REST.")]
public CliBool RestRequestBodyStrict { get; }
Comment on lines 136 to 139
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI help text for --rest.request-body-strict is misleading given the option name/behavior: when request-body-strict is true, DAB rejects unexpected/extraneous fields (strict mode), and when false it allows them. Consider updating the HelpText (and the preceding comment) to explicitly describe the true/false semantics so users don’t interpret it as "allow" when set to true.

Copilot uses AI. Check for mistakes.

[Option("graphql.multiple-create.enabled", Required = false, HelpText = "(Default: false) Enables multiple create operation for GraphQL. Supported values: true, false.")]
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/ConfigGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime
Schema: dabSchemaLink,
DataSource: dataSource,
Runtime: new(
Rest: new(restEnabled, restPath ?? RestRuntimeOptions.DEFAULT_PATH, options.RestRequestBodyStrict is CliBool.False ? false : true),
Rest: new(restEnabled, restPath ?? RestRuntimeOptions.DEFAULT_PATH, options.RestRequestBodyStrict is CliBool.True ? true : false),
GraphQL: new(Enabled: graphQLEnabled, Path: graphQLPath, MultipleMutationOptions: multipleMutationOptions),
Mcp: new(mcpEnabled, mcpPath ?? McpRuntimeOptions.DEFAULT_PATH),
Host: new(
Expand Down
4 changes: 2 additions & 2 deletions src/Config/ObjectModel/RestRuntimeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Azure.DataApiBuilder.Config.ObjectModel;
/// <param name="Path">The URL prefix path at which endpoints
/// for all entities will be exposed.</param>
/// <param name="RequestBodyStrict">Boolean property indicating whether extraneous fields are allowed in request body.
/// The default value is true - meaning we don't allow extraneous fields by default in the rest request body.
/// Changing the default value is a breaking change.</param>
/// The default value for existing configs (without this property set) is true - meaning we don't allow extraneous fields by default.
/// When dab init generates a new config, the default is false - allowing extraneous fields by default for a smoother development experience.</param>
Comment on lines 12 to +14
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RequestBodyStrict XML doc is internally inconsistent: it says the property indicates whether extraneous fields are allowed, but then describes true as "we don't allow extraneous fields". Please reword to reflect the actual behavior (e.g., strict=true rejects extraneous/unmapped fields; strict=false ignores them) to avoid confusing readers and downstream doc generation.

Copilot uses AI. Check for mistakes.
public record RestRuntimeOptions(bool Enabled = true, string Path = RestRuntimeOptions.DEFAULT_PATH, bool RequestBodyStrict = true)
{
public const string DEFAULT_PATH = "/api";
Expand Down