Files: ac1a79fec1e45652d23a6905c8540851a850a868 / position / schema / position.js
1259 bytesRaw
1 | const Validate = require('is-my-json-valid') |
2 | const chooseOneDetails = require('./details/chooseOne') |
3 | |
4 | const ssbSchemaDefintions = require('../../lib/ssbSchemaDefintions') |
5 | |
6 | const schema = { |
7 | $schema: 'http://json-schema.org/schema#', |
8 | type: 'object', |
9 | required: ['type', 'root', 'positionDetails'], |
10 | properties: { |
11 | version: { |
12 | type: 'string', |
13 | pattern: '^0.1.0$' |
14 | }, |
15 | type: { |
16 | type: 'string', |
17 | pattern: '^position$' |
18 | }, |
19 | root: { |
20 | $ref: '#/definitions/messageId' |
21 | }, |
22 | text: { type: 'string' }, |
23 | reason: { type: 'string' }, |
24 | positionDetails: { |
25 | oneOf: [ |
26 | // { $ref: '#/definitions/positionDetails/dot'}, |
27 | // { $ref: '#/definitions/positionDetails/proposal'}, |
28 | // { $ref: '#/definitions/positionDetails/score'}, |
29 | { $ref: '#/definitions/positionDetails/chooseOne' } |
30 | // { $ref: '#/definitions/positionDetails/rsvp'}, |
31 | // { $ref: '#/definitions/positionDetails/meeting'}, |
32 | ] |
33 | }, |
34 | mentions: { $ref: '#/definitions/mentions/any' }, |
35 | recps: { $ref: '#/definitions/recps' } |
36 | }, |
37 | definitions: Object.assign({}, ssbSchemaDefintions, { |
38 | positionDetails: { |
39 | type: 'object', |
40 | chooseOne: chooseOneDetails |
41 | } |
42 | }) |
43 | } |
44 | |
45 | module.exports = schema |
46 |
Built with git-ssb-web