An open API service indexing awesome lists of open source software.

https://github.com/tradle/build-model


https://github.com/tradle/build-model

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# @tradle/build-model

## Usage

```js
// example.js
const builders = require('@tradle/build-model')
const model = builders.model({ models })
.id('tradle.BlahProduct')
.subClassOf('tradle.FinancialProduct')
.forms(['tradle.AboutYou'])
.properties({
blah: builders.property()
.type('string')
.readOnly(true)
.title('No, really, blah'),

blahblah: builders.property()
.type('date'),

blahblahblah: builders.property()
.type('object')
.ref('tradle.Photo')
})
.toJSON()

console.log(JSON.stringify(model, null, 2))
```