Skip to content

add field_serializer to computed_field#6965

Merged
adriangb merged 5 commits intopydantic:mainfrom
andresliszt:add/computed-field-serializers
Aug 1, 2023
Merged

add field_serializer to computed_field#6965
adriangb merged 5 commits intopydantic:mainfrom
andresliszt:add/computed-field-serializers

Conversation

@andresliszt
Copy link
Copy Markdown
Contributor

@andresliszt andresliszt commented Jul 31, 2023

This PR tries to add field_seralizer into computed fields described in #6964

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: @hramezani

@andresliszt
Copy link
Copy Markdown
Contributor Author

Updating unit tests

@andresliszt
Copy link
Copy Markdown
Contributor Author

please review

@adriangb
Copy link
Copy Markdown
Member

This looks good @andresliszt ! Can you add a test using Annotated[..., PlainSerializer()] as the return type from a computed field function?

@andresliszt
Copy link
Copy Markdown
Contributor Author

This looks good @andresliszt ! Can you add a test using Annotated[..., PlainSerializer()] as the return type from a computed field function?

done!, is that what you wanted? Thanks for the observation

@andresliszt andresliszt force-pushed the add/computed-field-serializers branch from 0501342 to d7adcec Compare August 1, 2023 03:26
@adriangb adriangb enabled auto-merge (squash) August 1, 2023 06:09
@adriangb adriangb merged commit de6fc67 into pydantic:main Aug 1, 2023
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.

3 participants