Split from my PR #23, this PR focuses on changing the default behavior of schema2typebox from generating TypeBox Enum types to defaulting to TypeBox Union types. This is inline with the typescript community which has shifted to using union types over enums.
I agree with the goal of keeping the number of configuration options to a minimum, but I have to say that I have found it incredibly useful to have control over things like this. While not rising to the level of debate seen on other topics, I think choosing one or the other alienates potential users unnecessarily. I have felt this pressure internally, and while I haven't migrated our entire codebase, I believe there are some scenarios where I will face resistance if I don't generate an Enum type.
Summary
Split from my PR #23, this PR focuses on changing the default behavior of
schema2typebox
from generating TypeBoxEnum
types to defaulting to TypeBoxUnion
types. This is inline with the typescript community which has shifted to using union types over enums.Example
Checklist
Discussion & Open Questions
Configurability
I agree with the goal of keeping the number of configuration options to a minimum, but I have to say that I have found it incredibly useful to have control over things like this. While not rising to the level of debate seen on other topics, I think choosing one or the other alienates potential users unnecessarily. I have felt this pressure internally, and while I haven't migrated our entire codebase, I believe there are some scenarios where I will face resistance if I don't generate an Enum type.