feat: dab init defaults runtime.rest.request-body-strict to false#3166
Open
feat: dab init defaults runtime.rest.request-body-strict to false#3166
Conversation
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update dab init to set runtime.rest.request-body-strict to false
feat: dab init defaults runtime.rest.request-body-strict to false
Feb 25, 2026
JerryNixon
approved these changes
Feb 26, 2026
|
Azure Pipelines successfully started running 6 pipeline(s). |
Aniruddh25
approved these changes
Mar 9, 2026
Collaborator
|
@copilot, fix the snapshot ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt by setting the RequestBodyStrict flag to false in the expected snapshot. |
Collaborator
|
@copilot, fix the snapshot ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt by setting the RequestBodyStrict flag to false in the expected snapshot. |
…mos snapshot Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
Contributor
Author
Aniruddh25
approved these changes
Mar 10, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
aaronburtle
approved these changes
Mar 10, 2026
…false semantics Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
Aniruddh25
approved these changes
Mar 11, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
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.
Why make this change?
dab initgenerated configs withrequest-body-strict: true, causing REST endpoints to reject requests with extra/unmapped fields by default. This added friction for new users and modern scenarios where flexible request bodies are preferred.What is this change?
ConfigGenerator.cs: Changed theRestRequestBodyStrictdefaulting logic fromCliBool.False ? false : truetoCliBool.True ? true : false— when--rest.request-body-strictis omitted, the generated config now writesfalseRestRuntimeOptions.cs: The record default (RequestBodyStrict = true) is preserved for backward compatibility — existing configs that omit this field continue to behave as before. Rewrote XML doc to be internally consistent:truerejects extraneous/unmapped fields;falseallows and ignores them. Includes a note distinguishing the record default (true, for backward compat) from thedab initgenerated default (false).InitOptions.cs: Updated--rest.request-body-stricthelp text to"(Default: false) When true, rejects extraneous/unmapped fields in the REST request body. When false, allows and ignores them."and replaced the stale preceding code comment with a clear description of both modes.ConfigGeneratorTestsupdated to reflect the new generated defaultconfig-generators/*.txt: Added--rest.request-body-strict trueexplicitly todab initcommands inmssql-commands.txt,mysql-commands.txt,postgresql-commands.txt, anddwsql-commands.txt— these scripts regenerate integration test config files during CI builds, and those configs must retain strict mode (true) for integration tests that validate extraneous-field rejection behaviorConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt: Updated snapshot to setRequestBodyStrict: falseto reflect the new defaultHow was this tested?
PutOneTestWithExtraneousFieldsInRequestBody)TestRestRequestBodyStrictMode— updatedDataRowfor the no-flag case to assertfalseConfigGeneratorTests.TestSpecialCharactersInConnectionString— updated expected JSONInitTestssnapshots and 7EndToEndTestssnapshots (those that invokedab initwithout the flag) updated toRequestBodyStrict: falseConfigurationTests.TestReadingRuntimeConfigForCosmossnapshot updated toRequestBodyStrict: falseAddEntityTestsandUpdateEntityTestssnapshots intentionally unchanged — those use pre-built config strings, notdab init, and correctly reflect the record default oftrueSample Request(s)
dab init --database-type mssql --connection-string "@env('conn')"Generated
dab-config.jsonruntime section:Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.