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

apply update_forward_refs to json_encoders #3595

Merged
merged 6 commits into from Dec 31, 2021

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Dec 29, 2021

Change Summary

Apply update_forward_refs to Config.json_encodes prevent name clashes in types defined via strings.

Related issue number

fix #3583

Checklist

  • 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/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@samuelcolvin
Copy link
Member Author

@zrothberg and @PrettyWood I'd love your feedback on this.

@zrothberg
Copy link

zrothberg commented Dec 29, 2021

Its essentially the same code I had. The only thing I was unsure of is if the model.Config class also needed to updated. Not sure if you are using that one for inheritance or the __config__ one.

@samuelcolvin samuelcolvin changed the title apply update_forward_refs to json_encoders apply update_forward_refs to json_encoders Dec 29, 2021
@samuelcolvin
Copy link
Member Author

I think this is satisfactory, I'll merge tomorrow.

@samuelcolvin samuelcolvin merged commit 87da9ac into master Dec 31, 2021
@samuelcolvin samuelcolvin deleted the forward-refs-json_encoders branch December 31, 2021 14:44
ntaylorwss pushed a commit to nicejobinc/pydantic that referenced this pull request Jun 24, 2022
* apply update_forward_refs to json_encoders, fix pydantic#3583

* linting

* mypy

* avoid use of ForwardRef with python3.6

* fix ForwardRef usage, take 2

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

Successfully merging this pull request may close these issues.

V1.9 Name Collisions JSON model_as_dict
2 participants