Include $id in the generated TypeBox code #31
Replies: 1 comment
-
@tet-lenovo Hey! That should be possible. Could probably add a "post-processing" step where an id ist simply added. Somehwat similar to what is done in ts2typebox here Are there any requirements for the id? I guess it has to be unique, but what else? It only has to be added to the top level object, correct? It would help me out if you created an issue and provide a minimal example. E.g. two typescript files and one schema. One typescript file contains the code generated based on the schema and in the other one your custom typebox code which tries refefencing that schema. Will probably implement in the next weeks. If you got time, you are also welcome to implement it. I check PRs/Issues regularly. Just mention this in the issue! |
Beta Was this translation helpful? Give feedback.
-
I am trying to reference schema that was converted using schema2typebox from some of my other TypeBox schema using Type.Ref(). TypeBox complains because the types generated by schema2typebox don't include a $id. Any chance that is something that could be added easily?
Beta Was this translation helpful? Give feedback.
All reactions