From 53d95ecf5293ac7de3226ebd0538ad232483000a Mon Sep 17 00:00:00 2001 From: Kelvin Wang Date: Fri, 19 Apr 2019 12:45:47 -0400 Subject: [PATCH] feat(influxdb): add doc description --- document.go | 7 ++++--- http/document_test.go | 8 +++++--- http/swagger.yml | 2 ++ testing/document.go | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/document.go b/document.go index db616f9f08..aa0a0ca710 100644 --- a/document.go +++ b/document.go @@ -24,9 +24,10 @@ type Document struct { // DocumentMeta is information that is universal across documents. Ideally // data in the meta should be indexed and queryable. type DocumentMeta struct { - Name string `json:"name"` - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` + Name string `json:"name"` + Type string `json:"type,omitempty"` + Description string `json:"description,omitempty"` + Version string `json:"version,omitempty"` } // DocumentStore is used to perform CRUD operations on documents. It follows an options diff --git a/http/document_test.go b/http/document_test.go index f8f3b2c532..b8ef0be2fb 100644 --- a/http/document_test.go +++ b/http/document_test.go @@ -46,8 +46,9 @@ var ( doc1 = influxdb.Document{ ID: doc1ID, Meta: influxdb.DocumentMeta{ - Name: "doc1", - Type: "typ1", + Name: "doc1", + Type: "typ1", + Description: "desc1", }, Content: "content1", Labels: []*influxdb.Label{ @@ -125,7 +126,8 @@ var ( ], "meta": { "name": "doc1", - "type": "typ1" + "type": "typ1", + "description": "desc1" } }, { diff --git a/http/swagger.yml b/http/swagger.yml index 5bfcd25863..34f8ac470d 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -6941,6 +6941,8 @@ components: type: string type: type: string + description: + type: string version: type: string required: diff --git a/testing/document.go b/testing/document.go index 0bb0a2088d..74e0501ffa 100644 --- a/testing/document.go +++ b/testing/document.go @@ -60,8 +60,9 @@ func NewDocumentIntegrationTest(store kv.Store) func(t *testing.T) { t.Run("u1 can create document for o1", func(t *testing.T) { d1 = &influxdb.Document{ Meta: influxdb.DocumentMeta{ - Name: "i1", - Type: "type1", + Name: "i1", + Type: "type1", + Description: "desc1", }, Content: map[string]interface{}{ "v1": "v1",