mansenfranzen / autodoc_pydantic

Seamlessly integrate pydantic models in your Sphinx documentation.
MIT License
159 stars 27 forks source link

fix get_given_constraint_keys for pydantic 2.1 #170

Closed jerryjiahaha closed 1 year ago

jerryjiahaha commented 1 year ago

workaround for https://github.com/mansenfranzen/autodoc_pydantic/issues/169

jerryjiahaha commented 1 year ago

@mansenfranzen Sorry, I don't know more about __pydantic_core_schema__ design... So I think this PR is temporary modification

__pydantic_core_schema__ may be an internal data structure of pydantic and may not be stable? (Ref: __get_pydantic_core_schema__ doc )

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.29% :tada:

Comparison is base (6d40446) 94.39% compared to head (94e979f) 94.68%.

:exclamation: Current head 94e979f differs from pull request most recent head afe28cb. Consider uploading reports for the commit afe28cb to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #170 +/- ## ========================================== + Coverage 94.39% 94.68% +0.29% ========================================== Files 12 12 Lines 1052 1035 -17 ========================================== - Hits 993 980 -13 + Misses 59 55 -4 ``` | [Files Changed](https://app.codecov.io/gh/mansenfranzen/autodoc_pydantic/pull/170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Franz+W%C3%B6llert) | Coverage Δ | | |---|---|---| | [...hinxcontrib/autodoc\_pydantic/directives/utility.py](https://app.codecov.io/gh/mansenfranzen/autodoc_pydantic/pull/170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Franz+W%C3%B6llert#diff-c3BoaW54Y29udHJpYi9hdXRvZG9jX3B5ZGFudGljL2RpcmVjdGl2ZXMvdXRpbGl0eS5weQ==) | `96.55% <100.00%> (ø)` | | | [sphinxcontrib/autodoc\_pydantic/inspection.py](https://app.codecov.io/gh/mansenfranzen/autodoc_pydantic/pull/170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Franz+W%C3%B6llert#diff-c3BoaW54Y29udHJpYi9hdXRvZG9jX3B5ZGFudGljL2luc3BlY3Rpb24ucHk=) | `95.34% <100.00%> (+1.38%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.