Skip to content

Commit

Permalink
Update API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Jul 19, 2024
1 parent 261b286 commit e2dcc61
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
31 changes: 24 additions & 7 deletions docs/reference/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ components:
description: State of internal environment.
properties:
error_message:
anyOf:
- type: string
- type: 'null'
description: If present - error loading context
title: Error Message
type: string
initialized:
description: blueapi context initialized
title: Initialized
Expand All @@ -63,17 +65,21 @@ components:
description: Representation of a plan
properties:
description:
anyOf:
- type: string
- type: 'null'
description: Docstring of the plan
title: Description
type: string
name:
description: Name of the plan
title: Name
type: string
schema:
anyOf:
- type: object
- type: 'null'
description: Schema of the plan's parameters
title: Schema
type: object
required:
- name
title: PlanModel
Expand All @@ -97,16 +103,20 @@ components:
description: Request to change the state of the worker.
properties:
defer:
anyOf:
- type: boolean
- type: 'null'
default: false
description: Should worker defer Pausing until the next checkpoint
title: Defer
type: boolean
new_state:
$ref: '#/components/schemas/WorkerState'
reason:
anyOf:
- type: string
- type: 'null'
description: The reason for the current run to be aborted
title: Reason
type: string
required:
- new_state
title: StateChangeRequest
Expand Down Expand Up @@ -177,6 +187,7 @@ components:
type: string
required:
- task_id
- task
title: TrackableTask
type: object
ValidationError:
Expand Down Expand Up @@ -220,9 +231,13 @@ components:
description: Worker's active task ID, can be None
properties:
task_id:
anyOf:
- type: string
- type: 'null'
description: The ID of the current task, None if the worker is idle
title: Task Id
type: string
required:
- task_id
title: WorkerTask
type: object
info:
Expand Down Expand Up @@ -339,8 +354,10 @@ paths:
name: task_status
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Task Status
type: string
responses:
'200':
content:
Expand Down
1 change: 0 additions & 1 deletion tests/service/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def test_generate_schema(mock_app: Mock) -> None:
}


@pytest.mark.xfail(reason="Causes too much log crap!")
@pytest.mark.skipif(
not DOCS_SCHEMA_LOCATION.exists(),
reason="If the schema file does not exist, the test is being run"
Expand Down

0 comments on commit e2dcc61

Please sign in to comment.