You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
combined-enums - Error: Duplicate schema names detected:
1x Colors
at writeSchemas (orval/packages/core/dist/index.js:47446:13)
at async Promise.all (index 0)
at async writeSpecs (orval/packages/orval/dist/bin/orval.js:4626:5)
at async generateSpec (orval/packages/orval/dist/bin/orval.js:4763:3)
at async orval/packages/orval/dist/bin/orval.js:4786:18
at async asyncReduce (orval/packages/core/dist/index.js:44239:18)
at async generateConfig (/orval/packages/orval/dist/bin/orval.js:4830:5)
at async CAC.<anonymous> (orval/packages/orval/dist/bin/orval.js:4887:5)
Any other comments?
This seems to happen specifically if you reference a combined enum, if you declare them "inline" as a property it works fine.
Works (if you leave out the Colors definition):
fixes the problem. I'm guessing that it's creating a new enum definition every time the combined enum is being referenced, resulting in duplicates, but I could be wrong.
What are the steps to reproduce this issue?
oneOf
/anyOf
/allOf
with 2 or more referenced enums like so:What happens?
You'll get an error saying:
Error: Duplicate schema names detected: 1x Colors
What were you expecting to happen?
Orval would generate a model for the combined enum:
Any logs, error output, etc?
Any other comments?
This seems to happen specifically if you reference a combined enum, if you declare them "inline" as a property it works fine.
Works (if you leave out the
Colors
definition):Doesn't work:
This worked fine in any version < 6.29.0, but 6.29.0 introduced a change that broke this behaviour.
What versions are you using?
Operating System: MacOS Sonoma 14.5
Package Version: 6.29.1
Browser Version: Firefox 126.0.1
The text was updated successfully, but these errors were encountered: