jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.09k stars 5.39k forks source link

Generate schema from models #4221

Closed tom-sherman closed 5 years ago

tom-sherman commented 5 years ago

Is it possible to generate some form of schema in a structured format using backbone models?

jashkenas commented 5 years ago

Certainly. I'd perhaps recommend using AJV to validate your model attributes using JSON Schema in your model.validate() function.

tom-sherman commented 5 years ago

@jashkenas thanks, but I'm looking at generating some structured data from the models. I've got a fairly large code base I want to create types for.