From 93d9fcdc0e13cd60b1881f72f3d681a3d342dc9f Mon Sep 17 00:00:00 2001 From: Davide Nabais Date: Tue, 12 Sep 2023 17:16:31 +0100 Subject: [PATCH] - fix unit test --- examples/nested/nested.go | 4 +++- fixtures/go_comments.json | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/nested/nested.go b/examples/nested/nested.go index 886c5cf..bfdceb3 100644 --- a/examples/nested/nested.go +++ b/examples/nested/nested.go @@ -16,6 +16,8 @@ type ( // Plant represents the plants the user might have and serves as a test // of structs inside a `type` set. Plant struct { - Variant string `json:"variant" jsonschema:"title=Variant"` // This comment will be ignored + Variant string `json:"variant" jsonschema:"title=Variant"` // This comment will be used + // Multicellular is true if the plant is multicellular + Multicellular bool `json:"multicellular,omitempty" jsonschema:"title=Multicellular"` // This comment will be ignored } ) diff --git a/fixtures/go_comments.json b/fixtures/go_comments.json index 2e675cc..bfe5e61 100644 --- a/fixtures/go_comments.json +++ b/fixtures/go_comments.json @@ -36,7 +36,13 @@ "properties": { "variant": { "type": "string", - "title": "Variant" + "title": "Variant", + "description": "This comment will be used" + }, + "multicellular": { + "type": "boolean", + "title": "Multicellular", + "description": "Multicellular is true if the plant is multicellular" } }, "additionalProperties": false,