-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update column validation logic for insert operations when considering request-body-strict #2528
Update column validation logic for insert operations when considering request-body-strict #2528
Conversation
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
/azp run |
...ce.Tests/SqlTests/RestApiTests/RestBodyNonStrictModeTests/MsSqlRestBodyNonStrictModeTests.cs
Show resolved
Hide resolved
What do you mean by files here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving it assuming test will pass and LocationHeader is really not expected.
typo, meant to be fields, fixed. |
Why make this change?
Closes #2526
What is this change?
Update the logic within
RequestValidator.ValidateColumn
to correctly handle therequest-body-strict
setting for calculated and auto-generated fields.How was this tested?
Added an additional test to cover auto-generated fields in the request body when
request-body-strict
is set tofalse
. This code path is for all read only fields which also covers computed columns, and other columns that will return as read only during startup.Sample Request(s)
Can make a post request for any table that has auto-generated or computed columns. For example;
https://localhost:5001/restApi/Book/
with a request body:
{
"id": 9999,
"publisher_id": 1234,
"title": "Foo"
}