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

Update pydantic to v2 and update datamodel-code-generator to 0.25.6 #408

Merged
merged 38 commits into from May 2, 2024

Conversation

kumaranvpl
Copy link
Contributor

@kumaranvpl kumaranvpl commented Apr 30, 2024

I saw your PR #379 and I needed this feature.
Also I needed pydantic v2 support.
I forked your branch, installed pydantic v2 and fixed the bugs.
@koxudaxi Please take a look and let me know this is fine or not.

@kumaranvpl kumaranvpl marked this pull request as draft May 1, 2024 05:02
@kumaranvpl kumaranvpl marked this pull request as ready for review May 1, 2024 17:28
@kumaranvpl kumaranvpl changed the title Update pydantic to v2 and update datamodel-code-generator to 0.21.4 Update pydantic to v2 and update datamodel-code-generator to 0.25.6 May 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2024

Codecov Report

Attention: Patch coverage is 97.22222% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.26%. Comparing base (0c5db9a) to head (f11f922).
Report is 18 commits behind head on master.

Files Patch % Lines
fastapi_code_generator/__main__.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #408      +/-   ##
==========================================
+ Coverage   92.16%   92.26%   +0.10%     
==========================================
  Files           6        5       -1     
  Lines         383      401      +18     
==========================================
+ Hits          353      370      +17     
- Misses         30       31       +1     
Flag Coverage Δ
unittests 92.26% <97.22%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@koxudaxi
Copy link
Owner

koxudaxi commented May 2, 2024

Thanks for the great PR.
To be honest, this project has been a lower priority than my other projects, so I have not been able to devote much resources to it.
I will review it as soon as possible.


steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1 # nosemgrep
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the feature I wanted, and I would like to adopt it in datamodel-code-generator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, please do. We use this also in our open source project FastStream - https://github.com/airtai/faststream/blob/main/.github/workflows/test.yaml#L476

data_type = self.parse_schema(name, schema, [*path, name])
data_type = self._collapse_root_model(data_type)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, if it were datamodel-code-generator, I would make it optional, but for this project, it should be standard for convenience reasons.

@koxudaxi koxudaxi merged commit e8e381f into koxudaxi:master May 2, 2024
19 checks passed
@koxudaxi koxudaxi mentioned this pull request May 2, 2024
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.

None yet

4 participants