-
-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
The validation is great, and it would be nice to be able to use it outside the context of a request (e.g., JSON file validation). However, the public interface is somewhat awkward due to the included optimizations.
Would it be in the spirit of things to add a simplified interface for generic schema validation? Or does supporting such a feature go out of the scope of Huma?
A few details that could potentially be abstracted away:
- The
Registryparameter is used only if the schema is a reference (or is a parent to one, recursively) - The
PathBuffercould potentially be made optional ValidateModecould have a default (or be ignored?)ValidateResultcould implementError()and be returned as anerror
I feel like a lot of the extra details could be abstracted away without giving up the optimizations.
For example, a config/option struct could be used that provides reasonable defaults.
Another approach might be to create a wrapper function that simplifies use (or even just suggest that users create one themselves).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request