Mongoose Schema JSON Schema Generator
JSON →This package extends Mongoose's core classes (`Schema`, `Model`, and `Query`) to automatically generate JSON Schema representations from existing Mongoose definitions. It provides a `jsonSchema()` method accessible directly on Mongoose schemas, models, and queries, streamlining the creation of JSON Schemas for API documentation (e.g., OpenAPI), data validation, or UI generation. The current stable version is 4.0.1, indicating active maintenance and compatibility with Mongoose versions 6.x through 9.x. Key differentiators include its direct integration into Mongoose prototypes, a caching mechanism for built schemas with an explicit `forceRebuild` option, and configurable mapping for custom Mongoose field options to JSON Schema extensions (`fieldOptionsMapping`). The package typically releases new versions as needed to support newer Mongoose versions or JSON Schema specification updates.
Traffic · last 30 days ↑0% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany