From dd28e171ac7d0146fc8886ac11f290d74513a3b6 Mon Sep 17 00:00:00 2001 From: Vladimir Avtsenov Date: Mon, 22 Apr 2024 13:38:29 +0300 Subject: [PATCH] Added tests for multiline for @description attribute for securityDefinition --- parser_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/parser_test.go b/parser_test.go index 7862796d1..0479a7595 100644 --- a/parser_test.go +++ b/parser_test.go @@ -3864,6 +3864,24 @@ func TestTryAddDescription(t *testing.T) { }, }, }, + { + name: "added description with multiline", + lines: []string{ + "\t@securitydefinitions.apikey test", + "\t@in header", + "\t@name x-api-key", + "\t@description line1", + "\t@description line2", + }, + want: &spec.SecurityScheme{ + SecuritySchemeProps: spec.SecuritySchemeProps{ + Name: "x-api-key", + Type: "apiKey", + In: "header", + Description: "line1\nline2", + }, + }, + }, { name: "no description", lines: []string{