xddq / ts2typebox

Creating TypeBox code from Typescript types
MIT License
43 stars 3 forks source link

Question: Is it possible to add $id options ? #24

Closed vincent-vade closed 11 months ago

vincent-vade commented 1 year ago

Hi,

Thank for you're work. I would like to know if it's possible to add $id option in the schema output type ?

const type = Type.Object({
  name: Type.String()
}, { $id: "MyType"})

Thank,

Best regards

Vincent

xddq commented 1 year ago

Hi @vincent-vade

should be possible. However, since this lib is nowadays basically just a wrapper around sinclairs typebox-codegen I think the issue should be raised there. Perhaps it will become an option one can pass or it will become the default. I would tend to just have the $id per default and will update this lib here once this was added.

If it gets refused we can think about adding it here as well, but would rather first check typebox-codegen.

@sinclairzx81 Hey! Hope you are doing well! Is this something that is already in typebox-codegen? If not, could this be added?

xddq commented 11 months ago

@vincent-vade Closing for now, as mentioned, if you want this I think creating an issue in typebox-codegen should be the way to go. Can then easily update the used version here :]

Feel free to reopen if you disagree.