Uh oh!
There was an error while loading. Please reload this page.
fix: Fail when duplicate names are generated - #336
Conversation
Codecov Report
@@ Coverage Diff @@## main #336 +/- ##
=========================================
Coverage 100.00% 100.00% =========================================
Files 47 47 Lines 1390 1393 +3 =========================================
+ Hits 1390 1393 +3
Continue to review full report at Codecov.
|
forest-benchling
commented
Feb 10, 2021
| additional_properties=additional_properties, | ||
| ) | ||
| if prop.reference.class_name in schemas.models: | ||
| raise NameClashException(f'Attempted to generate duplicate models with name "{prop.reference.class_name}"') |
There was a problem hiding this comment.
We should return a PropertyError here instead so our higher level error handling code can manage it rather than printing a stack trace.
There was a problem hiding this comment.
👍. Thanks for the review!
forest-benchling
commented
Feb 10, 2021
@dbanty I removed the enum check, since it turns out that IIUC we were already checking for enum name collisions (see |
dbanty
commented
Feb 10, 2021
Awesome, thanks! Will merge this one now. |
Previously, it would silently create buggy code if duplicate models were generated with the same name; see #335 and #323.