git ssb

0+

Piet / ssb-loomio



Tree: a12ac40b656901d5dcfd3cf302343421e77045b0

Files: a12ac40b656901d5dcfd3cf302343421e77045b0 / errors / schema / positionError.js

892 bytesRaw
1const { ERROR_POSITION_CHOICE, ERROR_POSITION_TYPE, ERROR_POSITION_LATE } = require('../../types')
2
3var 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
39module.exports = schema
40

Built with git-ssb-web