From 18cbf9a5847bd78cd4556f9bc4ec4f7436ce20bb Mon Sep 17 00:00:00 2001 From: Rani Sharim Date: Tue, 17 Aug 2021 16:43:32 +0300 Subject: [PATCH] add MarshalJSON for default Closes #108 --- keywords_core.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keywords_core.go b/keywords_core.go index 1c61bdd..8908beb 100644 --- a/keywords_core.go +++ b/keywords_core.go @@ -139,6 +139,11 @@ func (d *Default) Resolve(pointer jptr.Pointer, uri string) *Schema { return nil } +// MarshalJSON implements the json.Marshaller interface for Default +func (d *Default) MarshalJSON() ([]byte, error) { + return json.Marshal(d.data) +} + // UnmarshalJSON implements the json.Unmarshaler interface for Default func (d *Default) UnmarshalJSON(data []byte) error { var defaultData interface{}