Skip to content

Commit

Permalink
cleanup readme more
Browse files Browse the repository at this point in the history
  • Loading branch information
tlivings committed Jan 10, 2018
1 parent c99bcf4 commit 8c451c5
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Expand Up @@ -32,15 +32,17 @@ const schema = Enjoi({
type: 'object',
properties: {
firstName: {
description: 'First name.',
type: 'string'
},
lastName: {
description: 'Last name.',
type: 'string'
},
age: {
description: 'Age in years',
type: 'integer',
minimum: 0
minimum: 1
}
},
'required': ['firstName', 'lastName']
Expand Down Expand Up @@ -69,14 +71,20 @@ Example:
const schema = Enjoi({
type: 'object',
properties: {
A: {
$ref: 'sub#/something'
a: {
$ref: '#/b' // # is root schema
},
b: {
type: 'string'
},
c: {
$ref: '#sub/d' // #sub is 'sub' under subSchemas.
}
}
}, {
subSchemas: {
sub: {
'something': {
d: {
'type': 'string'
}
}
Expand All @@ -96,10 +104,6 @@ const schema = Enjoi({
thing: Joi.any()
}
});

schema.validate(something, function (error, value) {
error && console.log(error);
});
```

### Refine Type
Expand Down

0 comments on commit 8c451c5

Please sign in to comment.