Skip to content

Instantly share code, notes, and snippets.

@TEDmk
Created April 30, 2020 02:32
Show Gist options
  • Save TEDmk/55f9fba7afeb922e48b369fa55c2afc2 to your computer and use it in GitHub Desktop.
Save TEDmk/55f9fba7afeb922e48b369fa55c2afc2 to your computer and use it in GitHub Desktop.
openapi: "3.0.0"
info:
version: 0.1.0
title: SandCodex task
license:
name: MIT
servers:
- url: https://api.sandcodex.ted.mk/v0
paths:
/tasks:
post:
summary: Submit a task
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskRequest'
operationId: post_tasks
responses:
'202':
description: the task has been accepted
content:
application/json:
schema:
$ref: "#/components/schemas/Task"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/tasks/{taskId}:
get:
summary: Info for a specific task
operationId: get_task
parameters:
- name: taskId
in: path
required: true
description: The id of the task
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Task"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Task:
type: object
required:
- id
- status
- interpreter
- results
properties:
id:
type: string
status:
type: string
interpreter:
type: string
code:
type: string
parameters:
type: array
items:
type: string
results:
type: array
items:
type: string
TaskRequest:
type: object
required:
- interpreter
- code
- parameters
properties:
interpreter:
type: string
code:
type: string
parameters:
type: array
items:
type: string
Error:
type: object
properties:
error:
type: object
properties:
type:
type: string
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment