Open matthyk opened 3 years ago
Hello,
I think answer is yes, it's safe if you know that generated schema will be valid JSON schema
It's safe as long as you do no fetch it from a database.
Would a plugin that provides this functionality be useful?
I think plugin not really needed, however if you have good ideas you can implement general purpose library, for example can take a look on https://github.com/eddow/ts-json-schema-decorator
💬 Question here
In the Fastify docs it's mentioned that the schema definition for response serialization should be treated as application code and that it is not safe to use user-provided schemas. But in my application I want to generate the schemas from the metadata provided by the user via TypeScript decorators.
It is safe to generate schemas this way?
Your Environment