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

refactor: set Pattern encoder in ENCODERS_BY_TYPE #2444

merged 2 commits into from Mar 2, 2021


Copy link

@PrettyWood PrettyWood commented Mar 1, 2021

Change Summary

Set Pattern encoder directly in ENCODERS_BY_TYPE to be used by fastapi

Related issue number


Well fastapi uses its own json encoder and reuses ENCODERS_BY_TYPE from pydantic here
We could maybe add Pattern directly in ENCODERS_BY_TYPE to make it work


  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/ for details)

@pydantic pydantic deleted a comment from codecov bot Mar 1, 2021
@samuelcolvin samuelcolvin added this to the v1.8.1 milestone Mar 2, 2021
Copy link

@PrettyWood I switched from a label to a milestone for v1.8.1, I think that makes more sense.

I'm not sure why this has been tagged as v1.8.1?

Copy link
Member Author

@samuelcolvin It's not required for 1.8.1 but without it, the issue is not completely solved as it doesn't work for fastapi. And I thought making it work for fastapi was probably the most common usecase. See #2045 (comment)

@samuelcolvin samuelcolvin merged commit b2d3f33 into pydantic:master Mar 2, 2021
1 check passed
Copy link

this is great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants