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:
774
774
775
775
// Not mandatory field
776
776
if securityAttr == descriptionAttr {
777
- description = value
777
+ if description != "" {
778
+ description += "\n "
779
+ }
780
+ description += value
778
781
}
779
782
780
783
// next securityDefinitions
Original file line number Diff line number Diff line change @@ -3864,6 +3864,24 @@ func TestTryAddDescription(t *testing.T) {
3864
3864
},
3865
3865
},
3866
3866
},
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
+ },
3867
3885
{
3868
3886
name : "no description" ,
3869
3887
lines : []string {
You can’t perform that action at this time.
0 commit comments