Skip to content

ericgj/json-schema-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-schema-model

Please note this library is not ready for production use.

Build view models (and collections) from JSON Schema correlations.

Models emit change and other 'lifecycle' events, suitable for integration with reactive data-binding libraries (e.g., component-reactive or rivets.)

(For an example use in form validation, see test/integration.html.)

A draft REST interface using JSON Schema hypermedia specification is optionally available for fetching/refreshing/creating/updating/deleting models, see sync.js.

Features

  • object- and property- level validation for models
  • object- and items- level validation for collections
  • input coercion (data type + defaults)
  • REST interface using JSON Schema hypermedia
  • extendable with custom model classes
  • full support for any JSON Schema including combination conditions (anyOf, allOf, oneOf)
  • access to descriptive schema data (description, name, links, etc) (planned)

Installation

$ component install ericgj/json-schema-model

API

Coming soon, for now check test/integration.html and test/tests.js.

License

MIT

About

Builds models from JSON Schema correlations

Resources

Stars

Watchers

Forks

Packages

No packages published