diff options
| author | bozo.kopic <bozo.kopic@gmail.com> | 2017-08-22 16:40:31 +0200 |
|---|---|---|
| committer | bozo.kopic <bozo.kopic@gmail.com> | 2017-08-22 16:40:31 +0200 |
| commit | 8fc558c5508a0a052f58f2ca2c8131d86a134ca3 (patch) | |
| tree | 13e8680b3bda41f4646316f7566d4b7fe20bc8c8 /schemas_json | |
| parent | b82c0e53536dc100fbe93806dcd0062c197f4f83 (diff) | |
json schemas
Diffstat (limited to 'schemas_json')
| -rw-r--r-- | schemas_json/message.yaml | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/schemas_json/message.yaml b/schemas_json/message.yaml new file mode 100644 index 0000000..0c79507 --- /dev/null +++ b/schemas_json/message.yaml @@ -0,0 +1,114 @@ +--- +"$schema": "http://json-schema.org/schema#" +id: "hatter://message.yaml#" +title: Message +description: Backend-frontend communication messages +oneOf: + - "$ref": "hatter://message.yaml#/definitions/client_message" + - "$ref": "hatter://message.yaml#/definitions/server_message" +definitions: + client_message: + title: Client message + description: Message sent by frontend + oneOf: + - title: Set log + type: object + required: + - type + - offset + - limit + properties: + type: + enum: + - set_log + offset: + type: integer + limit: + type: integer + - title: Add job + type: object + required: + - type + - repository + - commit + properties: + type: + enum: + - add_job + repository: + type: string + commit: + type: string + server_message: + title: Server message + description: Message sent by backend + oneOf: + - title: Active job + type: object + required: + - type + - job + properties: + type: + enum: + - active_job + job: + "$ref": "hatter://message.yaml#/definitions/job" + - title: Job queue + type: object + required: + - type + - jobs + properties: + type: + enum: + - job_queue + jobs: + type: array + items: + "$ref": "hatter://message.yaml#/definitions/job" + - title: Log entries + type: object + required: + - type + properties: + type: + enum: + - log_entries + entries: + type: array + items: + "$ref": "hatter://message.yaml#/definitions/log_entry" + job: + type: object + required: + - id + - timestamp + - repository + - commit + properties: + id: + type: integer + timestamp: + type: integer + repository: + type: string + commit: + type: string + log_entry: + type: object + required: + - timestamp + - repository + - commit + - message + properties: + timestamp: + type: integer + repository: + type: string + commit: + type: string + message: + type: string +... |
