fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
6.32k stars 204 forks source link

Add option to hide warnings in `@valibot/to-json-schema`. #889

Closed devcaeg closed 3 weeks ago

devcaeg commented 1 month ago

In the @valibot/to-json-schema package there should be an option to disable warning messages such as:

The 'trim' action cannot be converted to JSON Schema.

Since it causes the console to be filled with hundreds of warning messages

fabian-hiller commented 4 weeks ago

What would be your preferred API to configure this? Maybe instead of force: boolean we should change it to something like invalid: 'throw' | 'warn' | 'ignore'.

Another option would be to just remove the log statements or somehow configure it to only show them in development mode.

devcaeg commented 3 weeks ago

Yes exactly, it is better the option you propose.

fabian-hiller commented 3 weeks ago

I will think about it. Thank you for your feedback!

fabian-hiller commented 3 weeks ago

v1.0.0-beta.2 of @valibot/to-json-schema is available