@@ -938,7 +938,7 @@ describe('SwaggerExplorer', () => {
938938 } )
939939 @ApiQuery ( { name : 'order' , enum : QueryEnum } )
940940 @ApiQuery ( { name : 'page' , enum : [ 'd' , 'e' , 'f' ] , isArray : true } )
941- find ( ) : Promise < Foo [ ] > {
941+ find ( @ Param ( 'objectId' ) objectId : ParamEnum ) : Promise < Foo [ ] > {
942942 return Promise . resolve ( [ ] ) ;
943943 }
944944 }
@@ -952,7 +952,7 @@ describe('SwaggerExplorer', () => {
952952 } )
953953 @ApiQuery ( { name : 'order' , enum : QueryEnum } )
954954 @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 [ ] > {
956956 return Promise . resolve ( [ ] ) ;
957957 }
958958 }
@@ -972,7 +972,7 @@ describe('SwaggerExplorer', () => {
972972 enumName : 'QueryEnum' ,
973973 isArray : true
974974 } )
975- findBar ( ) : Promise < Foo > {
975+ findBar ( @ Param ( 'objectId' ) objectId : ParamEnum , @ Query ( 'order' ) order : QueryEnum , @ Query ( 'page' ) page : QueryEnum [ ] ) : Promise < Foo > {
976976 return Promise . resolve ( null ) ;
977977 }
978978 }
@@ -985,7 +985,7 @@ describe('SwaggerExplorer', () => {
985985 enum : [ 1 , 2 , 3 ] ,
986986 enumName : 'NumberEnum'
987987 } )
988- findBar ( ) : Promise < Foo > {
988+ findBar ( @ Param ( 'objectId' ) objectId : number ) : Promise < Foo > {
989989 return Promise . resolve ( null ) ;
990990 }
991991 }
@@ -1010,6 +1010,15 @@ describe('SwaggerExplorer', () => {
10101010 '/globalPrefix/v3/modulePath/foos/{objectId}'
10111011 ) ;
10121012 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+ } ,
10131022 {
10141023 in : 'query' ,
10151024 name : 'page' ,
@@ -1030,15 +1039,6 @@ describe('SwaggerExplorer', () => {
10301039 type : 'number' ,
10311040 enum : [ 1 , 2 , 3 ]
10321041 }
1033- } ,
1034- {
1035- in : 'path' ,
1036- name : 'objectId' ,
1037- required : true ,
1038- schema : {
1039- type : 'string' ,
1040- enum : [ 'a' , 'b' , 'c' ]
1041- }
10421042 }
10431043 ] ) ;
10441044 } ) ;
@@ -1056,12 +1056,12 @@ describe('SwaggerExplorer', () => {
10561056
10571057 expect ( routes [ 0 ] . root ! . parameters ) . toEqual ( [
10581058 {
1059- in : 'query ' ,
1060- name : 'page ' ,
1059+ in : 'path ' ,
1060+ name : 'objectId ' ,
10611061 required : true ,
10621062 schema : {
10631063 type : 'string' ,
1064- enum : [ 'd ' , 'e ' , 'f ' ]
1064+ enum : [ 'a ' , 'b ' , 'c ' ]
10651065 }
10661066 } ,
10671067 {
@@ -1074,12 +1074,12 @@ describe('SwaggerExplorer', () => {
10741074 }
10751075 } ,
10761076 {
1077- in : 'path ' ,
1078- name : 'objectId ' ,
1077+ in : 'query ' ,
1078+ name : 'page ' ,
10791079 required : true ,
10801080 schema : {
10811081 type : 'string' ,
1082- enum : [ 'a ' , 'b ' , 'c ' ]
1082+ enum : [ 'd ' , 'e ' , 'f ' ]
10831083 }
10841084 }
10851085 ] ) ;
@@ -1099,14 +1099,11 @@ describe('SwaggerExplorer', () => {
10991099
11001100 expect ( routes [ 0 ] . root ! . parameters ) . toEqual ( [
11011101 {
1102- in : 'query ' ,
1103- name : 'page ' ,
1102+ in : 'path ' ,
1103+ name : 'objectId ' ,
11041104 required : true ,
11051105 schema : {
1106- type : 'array' ,
1107- items : {
1108- $ref : '#/components/schemas/QueryEnum'
1109- }
1106+ $ref : '#/components/schemas/ParamEnum'
11101107 }
11111108 } ,
11121109 {
@@ -1118,11 +1115,14 @@ describe('SwaggerExplorer', () => {
11181115 }
11191116 } ,
11201117 {
1121- in : 'path ' ,
1122- name : 'objectId ' ,
1118+ in : 'query ' ,
1119+ name : 'page ' ,
11231120 required : true ,
11241121 schema : {
1125- $ref : '#/components/schemas/ParamEnum'
1122+ type : 'array' ,
1123+ items : {
1124+ $ref : '#/components/schemas/QueryEnum'
1125+ }
11261126 }
11271127 }
11281128 ] ) ;
0 commit comments