Files: a6d7447eb42778548eef44bee24f5aaed9598a45 / errors / schema / positionError.js
892 bytesRaw
1 | const { ERROR_POSITION_CHOICE, ERROR_POSITION_TYPE, ERROR_POSITION_LATE } = require('../../types') |
2 | |
3 | var schema = { |
4 | type: 'object', |
5 | required: ['type', 'position', 'message'], |
6 | properties: { |
7 | type: { |
8 | oneOf: [ |
9 | { $ref: '#/definitions/errorTypes/errorChoice' }, |
10 | { $ref: '#/definitions/errorTypes/errorTypes' }, |
11 | { $ref: '#/definitions/errorTypes/errorLate' } |
12 | ] |
13 | }, |
14 | position: { |
15 | type: 'object' |
16 | }, |
17 | message: { |
18 | type: 'string' |
19 | }, |
20 | definitions: { |
21 | errorTypes: { |
22 | errorChoice: { |
23 | type: 'string', |
24 | pattern: `^${ERROR_POSITION_CHOICE}$` |
25 | }, |
26 | errorType: { |
27 | type: 'string', |
28 | pattern: `^${ERROR_POSITION_TYPE}$` |
29 | }, |
30 | errorLate: { |
31 | type: 'string', |
32 | pattern: `^${ERROR_POSITION_LATE}$` |
33 | } |
34 | } |
35 | } |
36 | } |
37 | } |
38 | |
39 | module.exports = schema |
40 |
Built with git-ssb-web