Replace update_forward_refs with model_rebuild in docs #1366
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "update_forward_refs" which is suggested a few times in the docs is deprecated.
Would it be a good idea to replace these with "model_rebuild"?
It is apparently deprecated since pydantic 2.0, and will be removed in 3.0.
Note that the methods update_forward_refs and model_rebuild are not quite equivalent: update_forward_refs currently delegates to model_rebuild but with force=True, whereas the default is False. It might be worth checking whether this substitution is completely safe, but it does seem probably safe.