Closed luca-knaack-webcom closed 1 day ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
9ac0425
) to head (9e7eafb
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Comparing luca-knaack-webcom:feat/2001-missing-imports
(9e7eafb) with main
(9ac0425)
✅ 29
untouched benchmarks
@luca-knaack-webcom Thank you for creating the PR again. Could you please fix the test coverage?
https://github.com/koxudaxi/datamodel-code-generator/pull/2009/files
@koxudaxi
Just performed a final code-cleanup. Everything is now covered by tests. While there is one pragma: no cover
, this is still covered by those lines being covered 😅
The
processed_models
array storesProcessed
objects, which include models and their imports after being handled by theparser/base.py:parse
function. However, sincemodels
are objects (passed by reference), theProcessed
objects and their models can be modified after creation. This can sometimes result in model changes without corresponding updates to the model imports, leading to broken Pydantic models (example is given in #2001).This PR addresses this issue by introducing a post-processing step in the base parser's parsing method, ensuring that all necessary imports are correctly included.
Fixes #2001