From 7a20ccda99e48dab643d1fbd7e170fe3e4c47185 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Tue, 30 Apr 2019 02:57:01 +1000 Subject: REST: A check must specify a state The Ozlabs crew noticed that a check without a state caused a KeyError in data['state']. Mark state as mandatory, check for it, and add a test. Reported-by: Russell Currey Reported-by: Jeremy Kerr Signed-off-by: Daniel Axtens --- docs/api/schemas/latest/patchwork.yaml | 2 ++ docs/api/schemas/patchwork.j2 | 2 ++ docs/api/schemas/v1.0/patchwork.yaml | 2 ++ docs/api/schemas/v1.1/patchwork.yaml | 2 ++ 4 files changed, 8 insertions(+) (limited to 'docs/api') diff --git a/docs/api/schemas/latest/patchwork.yaml b/docs/api/schemas/latest/patchwork.yaml index e3ba69c..724b05e 100644 --- a/docs/api/schemas/latest/patchwork.yaml +++ b/docs/api/schemas/latest/patchwork.yaml @@ -1316,6 +1316,8 @@ components: nullable: true CheckCreate: type: object + required: + - state properties: state: title: State diff --git a/docs/api/schemas/patchwork.j2 b/docs/api/schemas/patchwork.j2 index 7d34863..5e2f5e4 100644 --- a/docs/api/schemas/patchwork.j2 +++ b/docs/api/schemas/patchwork.j2 @@ -1319,6 +1319,8 @@ components: nullable: true CheckCreate: type: object + required: + - state properties: state: title: State diff --git a/docs/api/schemas/v1.0/patchwork.yaml b/docs/api/schemas/v1.0/patchwork.yaml index 11e3ae3..02f3a15 100644 --- a/docs/api/schemas/v1.0/patchwork.yaml +++ b/docs/api/schemas/v1.0/patchwork.yaml @@ -1311,6 +1311,8 @@ components: nullable: true CheckCreate: type: object + required: + - state properties: state: title: State diff --git a/docs/api/schemas/v1.1/patchwork.yaml b/docs/api/schemas/v1.1/patchwork.yaml index 4e81ac3..0c086ed 100644 --- a/docs/api/schemas/v1.1/patchwork.yaml +++ b/docs/api/schemas/v1.1/patchwork.yaml @@ -1316,6 +1316,8 @@ components: nullable: true CheckCreate: type: object + required: + - state properties: state: title: State -- cgit v1.2.3