File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -774,7 +774,10 @@ loopline:
774774
775775 // Not mandatory field
776776 if securityAttr == descriptionAttr {
777- description = value
777+ if description != "" {
778+ description += "\n "
779+ }
780+ description += value
778781 }
779782
780783 // next securityDefinitions
Original file line number Diff line number Diff line change @@ -3864,6 +3864,24 @@ func TestTryAddDescription(t *testing.T) {
38643864 },
38653865 },
38663866 },
3867+ {
3868+ name : "added description with multiline" ,
3869+ lines : []string {
3870+ "\t @securitydefinitions.apikey test" ,
3871+ "\t @in header" ,
3872+ "\t @name x-api-key" ,
3873+ "\t @description line1" ,
3874+ "\t @description line2" ,
3875+ },
3876+ want : & spec.SecurityScheme {
3877+ SecuritySchemeProps : spec.SecuritySchemeProps {
3878+ Name : "x-api-key" ,
3879+ Type : "apiKey" ,
3880+ In : "header" ,
3881+ Description : "line1\n line2" ,
3882+ },
3883+ },
3884+ },
38673885 {
38683886 name : "no description" ,
38693887 lines : []string {
You can’t perform that action at this time.
0 commit comments