jayalfredprufrock / nestjs-typebox

Various utilities for integrating Typebox and NestJs for both validation and OpenApi schema generation
MIT License
27 stars 4 forks source link

Support validation with AJV instead of `TypeBox.Compile` #55

Closed MatanYadaev closed 1 month ago

jayalfredprufrock commented 5 months ago

This is definitely something I have considered. I'm still actively looking to integrate with a more fully-featured typebox-based validation library instead, and finding one that has support for AJV would be appealing. I could also see providing official support directly as well. I've been watching the recent developments in Typebox very closely and have been waiting for things to stabilize a bit on that end before making another pass in this library. I'll leave this open for discussion and to gauge interest. Thanks!

MatanYadaev commented 5 months ago

@jayalfredprufrock Can you please explain which developments you have been watching and waiting to stabilize in TypeBox?

jayalfredprufrock commented 5 months ago

I’m mainly referring to the Transform API and changes to the Values API (“clean” function and “default” function specifically). There has also been movement around how errors are propagated and overridden when dealing with complex union types with discriminators. Check out the last few entires of the changelog - it’s pretty clear these APIs are still somewhat experimental and subject to change and the maintainer has said as much. With every release though, Typebox seems more poised to be a complete replacement for AJV, at least for the majority of use cases. On Jun 12, 2024 at 10:22 AM -0400, Matan Yadaev @.***>, wrote:

@jayalfredprufrock Can you please explain which developments you have been watching and waiting to stabilize in TypeBox? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

jayalfredprufrock commented 1 month ago

I'm going to close this out for now. With the v3 release, I've converged on an approach to defaults/transforms/sanitizing using standard typebox utilities. At this point I don't see introducing official AJV support anytime soon. With some of the recent typebox developments, I'm happy with the current state of things and don't really miss any features from AJV.