json-rest-schema
JSON →A flexible schema validation library for JavaScript objects, designed for REST APIs and beyond. Version 1.0.16 supports Node >=18.0.0. Key features include type casting (e.g., string to number), data transformation (trimming whitespace), and a pluggable architecture for custom rules. Unlike many validators, it offers create/replace/patch semantics, nested object and array validation, recursive runtime validation, and adapters for React Hook Form, Vue+Vuetify, and VeeValidate. The library returns a flat error map with dotted paths for nested fields, making it easy to associate errors with UI components.
Resources
packagejson-rest-schema ↗