From 3b6e359876834a9be87a5bc10e91adc6060a08a1 Mon Sep 17 00:00:00 2001 From: Graham Jenson Date: Sun, 10 Mar 2019 14:00:56 +0000 Subject: [PATCH] fix(schema): maps within YAML templates should allow unknown fields/properties * [Fix] maps shoudl allow additional properties * [Fix] this fixes the schema additional properties AND schema validation code --- generate/templates/schema-property.template | 3 ++- generate/templates/schema.template | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generate/templates/schema-property.template b/generate/templates/schema-property.template index cd3477c92d..b11bd66d63 100644 --- a/generate/templates/schema-property.template +++ b/generate/templates/schema-property.template @@ -58,6 +58,7 @@ "type": "{{.Property.GetJSONPrimitiveType}}" } }, + "additionalProperties": true {{else}} "patternProperties": { "^[a-zA-Z0-9]+$": { @@ -68,8 +69,8 @@ {{end}} } }, - {{end}} "additionalProperties": false + {{end}} {{end}} {{if .Property.IsList}} diff --git a/generate/templates/schema.template b/generate/templates/schema.template index f7f363be49..2124143520 100644 --- a/generate/templates/schema.template +++ b/generate/templates/schema.template @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", + "$id": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {