Skip to content

Instantly share code, notes, and snippets.

@hnykda
Last active March 30, 2021 13:30
Show Gist options
  • Save hnykda/79a04383497f0b77ae0fa0092bf9702e to your computer and use it in GitHub Desktop.
Save hnykda/79a04383497f0b77ae0fa0092bf9702e to your computer and use it in GitHub Desktop.
swagger: "3.0"
paths:
/groups:
get:
description: Returns all CheckGroups
parameters:
release:
name: release
in: query
description: CheckGroups tied to this release
required: false
schema:
type: integer
format: int32
minimum: 0
name__icontains:
name: name__icontains
in: query
description: Returns CheckGroups where the name is substring of param
required: false
schema:
type: string
responses:
"200":
description: CheckGroup response
schema:
type: array
items:
$ref: "#/definitions/check_group"
post:
description: Creates a new CheckGroup
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
release_id:
type: integer
name:
type: string
audience_1_dsl:
type: string
audience_2_dsl:
type: string
responses:
"200":
description: check group response
schema:
$ref: "#/definitions/check_group"
"/groups/{id}":
get:
description: Returns a single CheckGroup by id
parameters:
- name: id
in: path
description: Id of the CheckGroup to fetch
required: true
type: int
responses:
"200":
description: CheckGroup response
schema:
$ref: "#/definitions/check_group"
delete:
parameters:
- name: id
in: path
description: Id of the CheckGroup to delete
required: true
type: int
"/groups/{id}/copy":
post:
description: Creates a copy of a CheckGroup
parameters:
- name: id
in: path
description: Id of the CheckGroup to copy
required: true
type: int
requestBody:
content:
application/json:
schema:
type: object
release:
type: int32
description: A new release under which the CheckGroup is duplicated
required: true
responses:
"201":
description: Newly created CheckGroup response
schema:
$ref: "#/definitions/check_group"
/checks:
get:
description: Returns all checks
parameters:
check_group:
name: check_group
in: query
description: All checks belonging to the check_group
required: false
schema:
type: integer
format: int32
minimum: 0
result:
name: result
in: query
description: All checks with the given result
required: false
schema:
type: string
enum: [failed, ...]
responses:
"200":
description: check response
schema:
type: array
items:
$ref: "#/definitions/check"
post:
description: Creates a new check
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
check_group:
type: integer
name:
type: string
audience_1_params:
type: string # arrays of strings?
audience_2_params:
type: string
result:
type: string
enum: [failed, ...]
created_at:
type: string
format: date-time
run_at:
type: string
format: date-time
responses:
"200":
description: check group response
schema:
$ref: "#/definitions/check"
"/checks/{id}":
get:
description: Returns a single check by id
parameters:
- name: id
in: path
description: Id of the check to fetch
required: true
type: int
responses:
"200":
description: check response
schema:
$ref: "#/definitions/check"
delete:
parameters:
- name: id
in: path
description: Id of the check to delete
required: true
type: int
"/checks/{id}/responses":
get:
description: Returns actual response Ids that failed this check
parameters:
- name: id
in: path
description: Id of the check to fetch for full diff
required: true
type: int
responses:
"200":
description: check with diffs responses
schema:
properties:
in_a_not_b: # I am not sure about this schema, suit yourself
type: array
items:
type: str
in_b_not_a:
type: array
items:
type: str
definitions:
check_group:
properties:
id:
type: integer
release_id:
type: integer
name:
type: string
audience_1_dsl:
type: string
audience_2_dsl:
type: string
check:
properties:
id:
type: integer
check_group:
type: integer
name:
type: string
audience_1_params:
type: string # arrays of strings?
audience_2_params:
type: string
result:
type: string
enum: [failed, ...]
created_at:
type: string
format: date-time
run_at:
type: string
format: date-time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment