Add: Job and params-vector schemas.

This commit is contained in:
wescoeur
2015-11-20 11:42:43 +01:00
parent 90f79b7708
commit 556bbe394d
2 changed files with 98 additions and 0 deletions

39
src/schemas/job.js Normal file
View File

@@ -0,0 +1,39 @@
import paramsVector from 'job/params-vector'
export default {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'object',
properties: {
type: {
enum: ['call']
},
id: {
type: 'string',
description: 'job identifier'
},
name: {
type: 'string',
description: 'human readable name'
},
userId: {
type: 'string',
description: 'identifier of the user who have created the job (the permissions of the user are used by the job)'
},
key: {
type: 'string'
// TODO description
},
method: {
type: 'string',
description: 'called method'
},
paramsVector
},
required: [
'type',
'id',
'userId',
'key',
'method'
]
}

View File

@@ -0,0 +1,59 @@
export default {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'object',
properties: {
type: {
enum: ['crossProduct']
},
items: {
type: 'array',
description: 'vector of values to multiply with others vectors',
items: {
type: 'object',
properties: {
type: {
enum: ['set']
},
values: {
type: 'array',
items: {
type: 'object'
},
minItems: 1
}
},
required: [
'type',
'values'
]
},
minItems: 1
}
},
required: [
'type',
'items'
]
}
/* Example:
{
"type": "cross product",
"items": [
{
"type": "set",
"values": [
{"id": 0, "name": "snapshost de 0"},
{"id": 1, "name": "snapshost de 1"}
],
},
{
"type": "set",
"values": [
{"force": true}
]
}
]
}
*/