diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2021-11-07 15:52:44 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2021-12-18 02:38:50 +0100 |
| commit | 0702d13263bf501c1db074ce1544e60b95161210 (patch) | |
| tree | ebca76946cead0ffcc742a64c15dd6f5e79958fa /schemas | |
| parent | 56a75fcb8f5a9e4c05ccec8eb4a3345a115da441 (diff) | |
major rewritev0.3.0
Diffstat (limited to 'schemas')
| -rw-r--r-- | schemas/opcut.yaml | 102 | ||||
| -rw-r--r-- | schemas/openapi.yaml | 55 |
2 files changed, 157 insertions, 0 deletions
diff --git a/schemas/opcut.yaml b/schemas/opcut.yaml new file mode 100644 index 0000000..a6d5d0b --- /dev/null +++ b/schemas/opcut.yaml @@ -0,0 +1,102 @@ +--- +"$schema": "http://json-schema.org/schema#" +id: "opcut://opcut.yaml#" +definitions: + params: + type: object + required: + - cut_width + - panels + - items + properties: + cut_width: + type: number + panels: + type: object + patternProperties: + ".+": + "$ref": "opcut://opcut.yaml#/definitions/panel" + items: + type: object + patternProperties: + ".+": + "$ref": "opcut://opcut.yaml#/definitions/item" + result: + type: object + required: + - params + - used + - unused + properties: + params: + "$ref": "opcut://opcut.yaml#" + used: + type: array + items: + "$ref": "opcut://opcut.yaml#/definitions/used" + unused: + type: array + items: + "$ref": "opcut://opcut.yaml#/definitions/unused" + panel: + type: object + required: + - width + - height + properties: + width: + type: number + height: + type: number + item: + type: object + required: + - width + - height + - can_rotate + properties: + width: + type: number + height: + type: number + can_rotate: + type: boolean + used: + type: object + required: + - panel + - item + - x + - y + - rotate + properties: + panel: + type: string + item: + type: string + x: + type: number + y: + type: number + rotate: + type: boolean + unused: + type: object + required: + - panel + - width + - height + - x + - y + properties: + panel: + type: string + width: + type: number + height: + type: number + x: + type: number + y: + type: number +... diff --git a/schemas/openapi.yaml b/schemas/openapi.yaml new file mode 100644 index 0000000..ecc9390 --- /dev/null +++ b/schemas/openapi.yaml @@ -0,0 +1,55 @@ +--- +openapi: 3.1.0 +info: + title: opcut + version: 0.0.1 +paths: + '/calculate': + post: + parameters: + - name: method + in: query + required: true + schema: + enum: + - greedy + - forward_greedy + requestBody: + content: + application/json: + schema: + "$ref": "opcut.yaml#/definitions/params" + responses: + "200": + content: + application/json: + schema: + "$ref": "opcut.yaml#/definitions/result" + default: + description: error + '/generate_output': + post: + parameters: + - name: output_type + in: query + required: true + schema: + enum: + - pdf + - svg + - name: panel + in: query + required: false + requestBody: + content: + application/json: + schema: + "$ref": "opcut.yaml#/definitions/result" + responses: + "200": + content: + application/pdf: {} + image/svg+xml: {} + default: + description: error +... |
