From d58a8518b0f51573a0552b783d12c2f7dd7801d1 Mon Sep 17 00:00:00 2001 From: Ruben Rizzi Date: Wed, 7 Feb 2024 10:52:30 +0000 Subject: [PATCH] Add json.RawMessage to model DifferentialProperties (#38) --- entities/differential.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/entities/differential.go b/entities/differential.go index 97d0d5b..05f0699 100644 --- a/entities/differential.go +++ b/entities/differential.go @@ -1,6 +1,10 @@ package entities -import "github.com/thought-machine/gonduit/util" +import ( + "encoding/json" + + "github.com/thought-machine/gonduit/util" +) // DifferentialRevision represents a revision in Differential. type DifferentialRevision struct { @@ -43,7 +47,7 @@ type DifferentialDiff struct { UnitStatus string `json:"unitStatus"` LintStatus string `json:"lintStatus"` Changes []DifferentialChange `json:"changes"` - Properties interface{} `json:"properties"` + Properties json.RawMessage `json:"properties"` AuthorName string `json:"authorName"` AuthorEmail string `json:"authorEmail"` } @@ -70,6 +74,18 @@ type DifferentialHunk struct { Corpus string `json:"corpus"` } +// A DifferentialProperties contains dynamic metadata about the Diff. +type DifferentialProperties struct { + ArcOnto []DifferentialArcOnto `json:"arc:onto"` +} + +// A DifferentialArcOnto contains a branch destination set with arc. +type DifferentialArcOnto struct { + Type string `json:"type"` + Name string `json:"name"` + Kind string `json:"kind"` +} + // A DifferentialRawDiff is a raw diff. type DifferentialRawDiff struct { Diff string `json:"diff"`