aboutsummaryrefslogtreecommitdiff
path: root/docs/api/schemas
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2020-11-29 12:50:22 +0000
committerStephen Finucane <stephen@that.guru>2020-12-13 18:22:12 +0000
commit646a2f2c80056a33c70efd760446832f90899247 (patch)
tree9222b370785e54104ca88f9ec90d24c4d716e046 /docs/api/schemas
parentfe07f30df6fe263938b1f898ffffc354c4ff470c (diff)
downloadpatchwork-646a2f2c80056a33c70efd760446832f90899247.tar
patchwork-646a2f2c80056a33c70efd760446832f90899247.tar.gz
REST: Null out previous, current relation info
These fields don't work like we expect them to. Because we're linking to a non-idempotent entity, an instance of 'relation', what we're storing in either of these fields is subject to change as patches are added and removed. This makes the information pretty much useless after the fact. It's best to just state the patch and request that people query the information themselves if necessary. We don't want to remove the field entirely from the API - that would be a truly breaking change - so instead we null it out like we do for patch tags. In a v2 API (i.e. a major version bump) we can remove this entirely. A small bug with the schema generation is corrected. Signed-off-by: Stephen Finucane <stephen@that.guru> Related: #379
Diffstat (limited to 'docs/api/schemas')
-rw-r--r--docs/api/schemas/patchwork.j24
-rw-r--r--docs/api/schemas/v1.1/patchwork.yaml18
-rw-r--r--docs/api/schemas/v1.2/patchwork.yaml2
3 files changed, 5 insertions, 19 deletions
diff --git a/docs/api/schemas/patchwork.j2 b/docs/api/schemas/patchwork.j2
index c55f6f4..af20743 100644
--- a/docs/api/schemas/patchwork.j2
+++ b/docs/api/schemas/patchwork.j2
@@ -1765,7 +1765,7 @@ components:
current_state:
title: Current state
type: string
-{% if version >= (1, 1) %}
+{% if version >= (1, 2) %}
EventPatchRelationChanged:
allOf:
- $ref: '#/components/schemas/EventBase'
@@ -1781,9 +1781,11 @@ components:
previous_relation:
title: Previous relation
type: string
+ nullable: true
current_relation:
title: Current relation
type: string
+ nullable: true
{% endif %}
EventPatchDelegated:
allOf:
diff --git a/docs/api/schemas/v1.1/patchwork.yaml b/docs/api/schemas/v1.1/patchwork.yaml
index 5acd33a..3b75c54 100644
--- a/docs/api/schemas/v1.1/patchwork.yaml
+++ b/docs/api/schemas/v1.1/patchwork.yaml
@@ -1510,24 +1510,6 @@ components:
current_state:
title: Current state
type: string
- EventPatchRelationChanged:
- allOf:
- - $ref: '#/components/schemas/EventBase'
- - type: object
- properties:
- category:
- enum:
- - patch-relation-changed
- payload:
- properties:
- patch:
- $ref: '#/components/schemas/PatchEmbedded'
- previous_relation:
- title: Previous relation
- type: string
- current_relation:
- title: Current relation
- type: string
EventPatchDelegated:
allOf:
- $ref: '#/components/schemas/EventBase'
diff --git a/docs/api/schemas/v1.2/patchwork.yaml b/docs/api/schemas/v1.2/patchwork.yaml
index 712d137..17d948a 100644
--- a/docs/api/schemas/v1.2/patchwork.yaml
+++ b/docs/api/schemas/v1.2/patchwork.yaml
@@ -1712,9 +1712,11 @@ components:
previous_relation:
title: Previous relation
type: string
+ nullable: true
current_relation:
title: Current relation
type: string
+ nullable: true
EventPatchDelegated:
allOf:
- $ref: '#/components/schemas/EventBase'