hapi-json-schema
v0.7.3
Published
json schema models for mongodb
Downloads
73
Readme
hapi-json-schema
Hapi plugin for json-schema-models
options object must contain the following properties
- indexes - boolean to confirm whether indexes should be built or not
- mongo
- name - mongodb name
- url - mongodb url string (host and port)
- options - mongodb connection options
- collections - array of objects with following properties
- name - string name of collection
- indexes - array of indexes to create
- options - valid options object for mongodb driver createCollection method
- schemata - directory containing schemas
- formats - path to formats file
Plugin exposes 2 methods
addSchemas via server.dataStore.schema.addSchemas
addFormats via server.dataStore.schema.addFormats
These methods can be used by other plugins to dynamically load more internal schema / models
Todo
- Improve interface to z-schema
- Manage plugin dependencies better