@@ -938,7 +938,7 @@ describe('SwaggerExplorer', () => {
938
938
} )
939
939
@ApiQuery ( { name : 'order' , enum : QueryEnum } )
940
940
@ApiQuery ( { name : 'page' , enum : [ 'd' , 'e' , 'f' ] , isArray : true } )
941
- find ( ) : Promise < Foo [ ] > {
941
+ find ( @ Param ( 'objectId' ) objectId : ParamEnum ) : Promise < Foo [ ] > {
942
942
return Promise . resolve ( [ ] ) ;
943
943
}
944
944
}
@@ -952,7 +952,7 @@ describe('SwaggerExplorer', () => {
952
952
} )
953
953
@ApiQuery ( { name : 'order' , enum : QueryEnum } )
954
954
@ApiQuery ( { name : 'page' , enum : [ 'd' , 'e' , 'f' ] } )
955
- find ( ) : Promise < Foo [ ] > {
955
+ find ( @ Param ( 'objectId' ) objectId : ParamEnum , @ Query ( 'order' ) order : QueryEnum , @ Query ( 'page' ) page : 'd' | 'e' | 'f' ) : Promise < Foo [ ] > {
956
956
return Promise . resolve ( [ ] ) ;
957
957
}
958
958
}
@@ -972,7 +972,7 @@ describe('SwaggerExplorer', () => {
972
972
enumName : 'QueryEnum' ,
973
973
isArray : true
974
974
} )
975
- findBar ( ) : Promise < Foo > {
975
+ findBar ( @ Param ( 'objectId' ) objectId : ParamEnum , @ Query ( 'order' ) order : QueryEnum , @ Query ( 'page' ) page : QueryEnum [ ] ) : Promise < Foo > {
976
976
return Promise . resolve ( null ) ;
977
977
}
978
978
}
@@ -985,7 +985,7 @@ describe('SwaggerExplorer', () => {
985
985
enum : [ 1 , 2 , 3 ] ,
986
986
enumName : 'NumberEnum'
987
987
} )
988
- findBar ( ) : Promise < Foo > {
988
+ findBar ( @ Param ( 'objectId' ) objectId : number ) : Promise < Foo > {
989
989
return Promise . resolve ( null ) ;
990
990
}
991
991
}
@@ -1010,6 +1010,15 @@ describe('SwaggerExplorer', () => {
1010
1010
'/globalPrefix/v3/modulePath/foos/{objectId}'
1011
1011
) ;
1012
1012
expect ( routes [ 0 ] . root ! . parameters ) . toEqual ( [
1013
+ {
1014
+ in : 'path' ,
1015
+ name : 'objectId' ,
1016
+ required : true ,
1017
+ schema : {
1018
+ type : 'string' ,
1019
+ enum : [ 'a' , 'b' , 'c' ]
1020
+ }
1021
+ } ,
1013
1022
{
1014
1023
in : 'query' ,
1015
1024
name : 'page' ,
@@ -1030,15 +1039,6 @@ describe('SwaggerExplorer', () => {
1030
1039
type : 'number' ,
1031
1040
enum : [ 1 , 2 , 3 ]
1032
1041
}
1033
- } ,
1034
- {
1035
- in : 'path' ,
1036
- name : 'objectId' ,
1037
- required : true ,
1038
- schema : {
1039
- type : 'string' ,
1040
- enum : [ 'a' , 'b' , 'c' ]
1041
- }
1042
1042
}
1043
1043
] ) ;
1044
1044
} ) ;
@@ -1056,12 +1056,12 @@ describe('SwaggerExplorer', () => {
1056
1056
1057
1057
expect ( routes [ 0 ] . root ! . parameters ) . toEqual ( [
1058
1058
{
1059
- in : 'query ' ,
1060
- name : 'page ' ,
1059
+ in : 'path ' ,
1060
+ name : 'objectId ' ,
1061
1061
required : true ,
1062
1062
schema : {
1063
1063
type : 'string' ,
1064
- enum : [ 'd ' , 'e ' , 'f ' ]
1064
+ enum : [ 'a ' , 'b ' , 'c ' ]
1065
1065
}
1066
1066
} ,
1067
1067
{
@@ -1074,12 +1074,12 @@ describe('SwaggerExplorer', () => {
1074
1074
}
1075
1075
} ,
1076
1076
{
1077
- in : 'path ' ,
1078
- name : 'objectId ' ,
1077
+ in : 'query ' ,
1078
+ name : 'page ' ,
1079
1079
required : true ,
1080
1080
schema : {
1081
1081
type : 'string' ,
1082
- enum : [ 'a ' , 'b ' , 'c ' ]
1082
+ enum : [ 'd ' , 'e ' , 'f ' ]
1083
1083
}
1084
1084
}
1085
1085
] ) ;
@@ -1099,14 +1099,11 @@ describe('SwaggerExplorer', () => {
1099
1099
1100
1100
expect ( routes [ 0 ] . root ! . parameters ) . toEqual ( [
1101
1101
{
1102
- in : 'query ' ,
1103
- name : 'page ' ,
1102
+ in : 'path ' ,
1103
+ name : 'objectId ' ,
1104
1104
required : true ,
1105
1105
schema : {
1106
- type : 'array' ,
1107
- items : {
1108
- $ref : '#/components/schemas/QueryEnum'
1109
- }
1106
+ $ref : '#/components/schemas/ParamEnum'
1110
1107
}
1111
1108
} ,
1112
1109
{
@@ -1118,11 +1115,14 @@ describe('SwaggerExplorer', () => {
1118
1115
}
1119
1116
} ,
1120
1117
{
1121
- in : 'path ' ,
1122
- name : 'objectId ' ,
1118
+ in : 'query ' ,
1119
+ name : 'page ' ,
1123
1120
required : true ,
1124
1121
schema : {
1125
- $ref : '#/components/schemas/ParamEnum'
1122
+ type : 'array' ,
1123
+ items : {
1124
+ $ref : '#/components/schemas/QueryEnum'
1125
+ }
1126
1126
}
1127
1127
}
1128
1128
] ) ;
0 commit comments