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

allow field_serializer('*') (fix #8990) #9001

Merged
merged 6 commits into from Mar 14, 2024

Conversation

ornariece
Copy link
Contributor

@ornariece ornariece commented Mar 13, 2024

Change Summary

allow field_serializer('*') for defining a serializer for all fields in a model

Related issue number

fix #8990

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @davidhewitt

Copy link

codspeed-hq bot commented Mar 13, 2024

CodSpeed Performance Report

Merging #9001 will not alter performance

Comparing ornariece:field_serializer_all (707fd47) with main (18d39fe)

Summary

✅ 10 untouched benchmarks

@ornariece
Copy link
Contributor Author

please review @sydney-runkle

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Left a bit of feedback. Thanks for your work on this :). And thanks for the tests!

docs/concepts/serialization.md Outdated Show resolved Hide resolved
pydantic/_internal/_generate_schema.py Show resolved Hide resolved
Co-authored-by: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com>
Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

@ornariece,

Looks great, but please fix the linting errors before we merge!

@ornariece
Copy link
Contributor Author

turns out the initial doc change was correct 😄

@sydney-runkle
Copy link
Member

@ornariece,

Hmm, I don't think it was -- I think you just needed to fix the whitespace... could you try that instead?

@ornariece
Copy link
Contributor Author

here's to hoping i checked everything properly this time! sorry for the trouble

@sydney-runkle
Copy link
Member

No worries at all. Looks great, thanks so much :).

@sydney-runkle sydney-runkle enabled auto-merge (squash) March 14, 2024 00:04
@sydney-runkle sydney-runkle merged commit 534a446 into pydantic:main Mar 14, 2024
52 checks passed
@ornariece ornariece deleted the field_serializer_all branch March 14, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

field_serializer('*')
3 participants