{
backend => 'test://localhost/yancy.data.json',
plugins => [
[ 'Auth::Basic' => {
collection => 'users',
password_digest => {
type => 'SHA1'
},
} ],
],
collections => {
blog => {
required => [qw( title markdown slug )],
example => {
title => 'Title',
markdown => "# Title\n\nMarkdown content",
slug => 'title',
},
properties => {
id => {
type => 'integer',
readOnly => 1,
},
title => {
type => 'string',
},
markdown => {
type => 'string',
format => 'markdown',
'x-html-field' => 'html',
},
html => {
type => 'string',
format => 'html',
},
slug => {
type => 'string',
},
},
},
people => {
'x-list-columns' => [ 'name', 'email' ],
required => [ 'name', 'email' ],
example => {
name => 'John Doe',
email => 'john@example.com',
},
properties => {
id => {
type => 'integer',
readOnly => 1,
},
name => {
type => 'string',
},
email => {
type => 'string',
format => 'email',
},
age => {
type => 'integer',
minimum => 0,
maximum => 200,
},
phone => {
type => 'string',
format => 'tel',
},
gender => {
title => 'Preferred Gender',
type => 'string',
enum => [qw( male female )],
},
contact => {
title => 'Can Contact?',
type => 'boolean',
},
birthday => {
type => 'string',
format => 'date',
},
},
},
users => {
'x-id-field' => 'username',
'x-list-columns' => [ 'username', 'email' ],
required => [ 'username', 'email' ],
properties => {
username => {
type => 'string',
},
email => {
type => 'string',
format => 'email',
},
password => {
type => 'string',
format => 'password',
#writeOnly => 1,
},
created => {
type => 'string',
format => 'date-time',
readOnly => 1,
},
},
},
},
}