diff --git a/parser_test.go b/parser_test.go index 296423999..8d5a8b762 100644 --- a/parser_test.go +++ b/parser_test.go @@ -3466,6 +3466,20 @@ func TestTryAddDescription(t *testing.T) { }, }, }, + { + name: "description has invalid format", + args: args{ + spec: &spec.SecurityScheme{}, + extensions: map[string]interface{}{ + "@description": 12345, + }, + }, + want: &spec.SecurityScheme{ + SecuritySchemeProps: spec.SecuritySchemeProps{ + Description: "", + }, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {