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,