feat: dab init defaults runtime.rest.request-body-strict to false#3166
feat: dab init defaults runtime.rest.request-body-strict to false#3166
Conversation
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
@copilot, investigate these failures: https://dev.azure.com/sqldab/fcb212b3-b288-4c9e-b55a-5842a268b16d/_apis/build/builds/18366/logs/26 and fix them |
…mands to fix CI failures Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
The CI failures were caused by the config-generator scripts ( Fixed in commit b24e691 by explicitly adding |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
@copilot, fix the snapshot ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt by setting the RequestBodyStrict flag to false in the expected snapshot. |
|
@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>
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
…false semantics Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
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.