Skip to content
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

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

aaronburtle
Copy link
Contributor

@aaronburtle aaronburtle commented Jan 15, 2025

Why make this change?

Closes #2526

What is this change?

Update the logic within RequestValidator.ValidateColumn to correctly handle the request-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 to false. 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"
}

@aaronburtle aaronburtle self-assigned this Jan 21, 2025
@aaronburtle aaronburtle added the bug Something isn't working label Jan 21, 2025
@aaronburtle aaronburtle added this to the 1.4 milestone Jan 21, 2025
@aaronburtle
Copy link
Contributor Author

/azp run

Copy link
Contributor

@sezal98 sezal98 left a comment

Choose a reason for hiding this comment

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

looks good

@aaronburtle
Copy link
Contributor Author

/azp run

@Aniruddh25
Copy link
Contributor

This code path is for all read only files

What do you mean by files here?

Copy link
Contributor

@Aniruddh25 Aniruddh25 left a 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.

@aaronburtle
Copy link
Contributor Author

This code path is for all read only files

What do you mean by files here?

typo, meant to be fields, fixed.

@aaronburtle aaronburtle merged commit 7ff62e7 into main Jan 23, 2025
7 checks passed
@aaronburtle aaronburtle deleted the dev/aaronburtle/RequestBodyStrictValidateFix branch January 23, 2025 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Request-Body-Strict not working for calculated and auto-generated fields
4 participants