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

fix: Preserve class names when generating models from JSON Schema 202… #2185

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

koxudaxi
Copy link
Owner

Fix: #2032

This pull request includes changes to improve the handling of references in the datamodel_code_generator and adds new tests to ensure the functionality works as expected. The most important changes include modifying the add_ref method to handle trailing hash characters and adding new test cases for the ModelResolver class.

Improvements to reference handling:

New test cases:

  • tests/test_reference.py: Added import for ModelResolver and new test cases to verify the add_ref method handles references with and without trailing hash characters correctly. [1] [2]

Copy link

codspeed-hq bot commented Nov 23, 2024

CodSpeed Performance Report

Merging #2185 will not alter performance

Comparing fix-Preserve-class-names-when-generating-models (1d89e28) with main (9969bf2)

Summary

✅ 30 untouched benchmarks

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (9969bf2) to head (1d89e28).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2185   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         4276      4276           
  Branches       986       986           
=========================================
  Hits          4276      4276           
Flag Coverage Δ
unittests 99.67% <ø> (ø)

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.


🚨 Try these New Features:

@koxudaxi koxudaxi merged commit 368de18 into main Nov 23, 2024
76 checks passed
@koxudaxi koxudaxi deleted the fix-Preserve-class-names-when-generating-models branch November 23, 2024 09:46
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.

Model class names are missing the last letter in models generated from 2020-12 JSON schema specification
1 participant