From 28db9408fa2a0b4ffc9814dd0509d8026d9de223 Mon Sep 17 00:00:00 2001 From: Joshua Pinkney Date: Tue, 26 Apr 2022 11:16:16 -0400 Subject: [PATCH] fix(schema): Fix JSON Schema generation commas for InclusivePrimitiveItemTypes --- generate/templates/schema-property.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generate/templates/schema-property.template b/generate/templates/schema-property.template index 8d8758943a..2d8efecfc4 100644 --- a/generate/templates/schema-property.template +++ b/generate/templates/schema-property.template @@ -19,8 +19,8 @@ "anyOf": [ {{$length := len .Property.InclusivePrimitiveItemTypes}}{{$rc := counter $length}}{{range $index, $primitiveType := .Property.InclusivePrimitiveItemTypes}} { - "type": "{{convertToJSONType $primitiveType}}"{{if call $rc}},{{end}} - }{{if $.Property.InclusiveItemTypes}},{{end}} + "type": "{{convertToJSONType $primitiveType}}" + }{{if (or $.Property.InclusiveItemTypes (call $rc))}},{{end}} {{end}} {{$length := len .Property.InclusiveItemTypes}}{{$rc := counter $length}}{{range $index, $itemType := .Property.InclusiveItemTypes}} { @@ -29,7 +29,7 @@ {{end}} ] } - }{{if (or $.Property.InclusivePrimitiveItemTypes $.Property.InclusiveItemTypes)}},{{end}} + }{{if (or $.Property.PrimitiveItemTypes (or $.Property.Types $.Property.ItemTypes))}},{{end}} {{end}} {{if .Property.PrimitiveItemTypes}}