This repository was archived by the owner on Mar 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): migrate to json schemas using ajv
- Loading branch information
philippspo
committed
Apr 18, 2016
1 parent
461cf61
commit 2755808
Showing
4 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
import Joi from 'joi' | ||
|
||
const schema = Joi.object().keys({ | ||
customerNumber: Joi.string(), | ||
companyName: Joi.string(), | ||
addresses: Joi.array().items(Joi.object().keys({ | ||
streetName: Joi.string(), | ||
postalCode: Joi.number(), | ||
city: Joi.string(), | ||
country: Joi.string().min(2).max(2) | ||
})), | ||
email: Joi.string().required(), | ||
phone: Joi.string(), | ||
customerGroup: Joi.string(), | ||
vatId: Joi.string() | ||
}) | ||
const schema = { | ||
This comment has been minimized.
Sorry, something went wrong.
butenkor
|
||
type: 'object', | ||
properties: { | ||
customerNumber: { type: 'string' }, | ||
companyName: { type: 'string' }, | ||
addresses: { | ||
type: 'array', | ||
items: { | ||
type: 'object', | ||
properties: { | ||
streetName: { type: 'string' }, | ||
postalCode: { type: 'string' }, | ||
city: { type: 'string' }, | ||
country: { type: 'string', minLength: 2, maxLength: 2 }, | ||
} | ||
}, | ||
}, | ||
email: { type: 'string' }, | ||
phone: { type: 'string' }, | ||
customerGroup: { type: 'string' }, | ||
vatId: { type: 'string' }, | ||
}, | ||
required: ['email'], | ||
additionalProperties: false, | ||
} | ||
|
||
export default schema |
Will it install both 4.3 and 0.12 on travis? Which version will be used for test execution?