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 config-generators/dwsql-commands.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
init --config "dab-config.DwSql.json" --database-type dwsql --set-session-context true --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000"
init --config "dab-config.DwSql.json" --database-type dwsql --set-session-context true --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" --rest.request-body-strict true
add Publisher --config "dab-config.DwSql.json" --source publishers --permissions "anonymous:read" --source.key-fields "id"
add Stock --config "dab-config.DwSql.json" --source stocks --permissions "anonymous:create,read,update,delete" --source.key-fields "categoryid,pieceid"
add stocks_price --config "dab-config.DwSql.json" --source stocks_price --permissions "authenticated:create,read,update,delete" --source.key-fields "categoryid,pieceid,instant"
Expand Down
2 changes: 1 addition & 1 deletion config-generators/mssql-commands.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
init --config "dab-config.MsSql.json" --database-type mssql --set-session-context true --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" --graphql.multiple-create.enabled true
init --config "dab-config.MsSql.json" --database-type mssql --set-session-context true --connection-string "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;" --host-mode Development --cors-origin "http://localhost:5000" --graphql.multiple-create.enabled true --rest.request-body-strict true
add Publisher --config "dab-config.MsSql.json" --source publishers --permissions "anonymous:read"
add Publisher_MM --config "dab-config.MsSql.json" --source publishers_mm --graphql "Publisher_MM:Publishers_MM" --permissions "anonymous:*"
add Stock --config "dab-config.MsSql.json" --source stocks --permissions "anonymous:create,read,update,delete"
Expand Down
2 changes: 1 addition & 1 deletion config-generators/mysql-commands.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
init --config "dab-config.MySql.json" --database-type mysql --connection-string "server=localhost;database=datagatewaytest;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000"
init --config "dab-config.MySql.json" --database-type mysql --connection-string "server=localhost;database=datagatewaytest;uid=root;pwd=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" --rest.request-body-strict true
add Publisher --config "dab-config.MySql.json" --source publishers --permissions "anonymous:read"
add Stock --config "dab-config.MySql.json" --source stocks --permissions "anonymous:create,read,update,delete"
add Book --config "dab-config.MySql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books"
Expand Down
2 changes: 1 addition & 1 deletion config-generators/postgresql-commands.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
init --config "dab-config.PostgreSql.json" --database-type postgresql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000"
init --config "dab-config.PostgreSql.json" --database-type postgresql --connection-string "Host=localhost;Database=datagatewaytest;username=REPLACEME;password=REPLACEME" --host-mode Development --cors-origin "http://localhost:5000" --rest.request-body-strict true
add Publisher --config "dab-config.PostgreSql.json" --source publishers --permissions "anonymous:read"
add Stock --config "dab-config.PostgreSql.json" --source stocks --permissions "anonymous:create,read,update,delete"
add Book --config "dab-config.PostgreSql.json" --source books --permissions "anonymous:create,read,update,delete" --graphql "book:books"
Expand Down
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
5 changes: 2 additions & 3 deletions src/Cli/Commands/InitOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ public InitOptions(
[Option("mcp.enabled", Required = false, HelpText = "(Default: true) Enables MCP endpoint for all entities. Supported values: true, false.")]
public CliBool McpEnabled { get; }

// 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.")]
// 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.")]
public CliBool RestRequestBodyStrict { get; }

[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 @@ -266,7 +266,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
Loading