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

feat(DTO): introduce forbid_unknown_fields config #3690

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

provinzkraut
Copy link
Member

Add a new config option to DTOConfig: forbid_unknown_fields.
When set to True, a validation error response will be returned if the source data contains fields not defined on the model.

@provinzkraut provinzkraut requested review from a team as code owners August 24, 2024 10:52
@github-actions github-actions bot added area/docs This PR involves changes to the documentation area/dto This PR involves changes to the DTOs area/private-api This PR involves changes to the privatized API size: small type/feat pr/internal labels Aug 24, 2024
Copy link

codecov bot commented Aug 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.27%. Comparing base (b3cf2fd) to head (0c6f60b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3690   +/-   ##
=======================================
  Coverage   98.27%   98.27%           
=======================================
  Files         329      329           
  Lines       14936    14938    +2     
  Branches     2375     2375           
=======================================
+ Hits        14679    14681    +2     
  Misses        116      116           
  Partials      141      141           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@provinzkraut provinzkraut force-pushed the dto/reject-unknown-fields branch from 45e3b12 to 84b26cf Compare August 24, 2024 18:24
@provinzkraut provinzkraut enabled auto-merge (squash) August 24, 2024 18:24
@provinzkraut provinzkraut force-pushed the dto/reject-unknown-fields branch from 84b26cf to 0c6f60b Compare August 24, 2024 18:28
Copy link

@provinzkraut provinzkraut merged commit 23ba256 into main Aug 24, 2024
25 checks passed
@provinzkraut provinzkraut deleted the dto/reject-unknown-fields branch August 24, 2024 18:34
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs This PR involves changes to the documentation area/dto This PR involves changes to the DTOs area/private-api This PR involves changes to the privatized API pr/internal size: small type/feat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants