@@ -51,6 +51,7 @@ describe('CONVERT FUNCTION TESTS ', function() {
51
51
deepObjectLengthProperty = path . join ( __dirname , VALID_OPENAPI_PATH , '/deepObjectLengthProperty.yaml' ) ,
52
52
valuePropInExample = path . join ( __dirname , VALID_OPENAPI_PATH , '/valuePropInExample.yaml' ) ,
53
53
petstoreParamExample = path . join ( __dirname , VALID_OPENAPI_PATH , '/petstoreParamExample.yaml' ) ,
54
+ formDataParamDescription = path . join ( __dirname , VALID_OPENAPI_PATH , '/form_data_param_description.yaml' ) ,
54
55
allHTTPMethodsSpec = path . join ( __dirname , VALID_OPENAPI_PATH , '/all-http-methods.yaml' ) ;
55
56
56
57
@@ -1143,6 +1144,21 @@ describe('CONVERT FUNCTION TESTS ', function() {
1143
1144
} ) ;
1144
1145
} ) ;
1145
1146
1147
+ it ( '[Github #559]Should convert description in form data parameters' +
1148
+ petstoreParamExample , function ( done ) {
1149
+ var openapi = fs . readFileSync ( formDataParamDescription , 'utf8' ) ;
1150
+ Converter . convert ( { type : 'string' , data : openapi } ,
1151
+ { } , ( err , conversionResult ) => {
1152
+ expect ( err ) . to . be . null ;
1153
+ expect ( conversionResult . result ) . to . equal ( true ) ;
1154
+ expect ( conversionResult . output [ 0 ] . data . item [ 0 ] . request . body . formdata [ 0 ] . description )
1155
+ . to . equal ( 'Request param description' ) ;
1156
+ expect ( conversionResult . output [ 0 ] . data . item [ 0 ] . request . body . formdata [ 0 ] . key ) . to . equal ( 'requestParam' ) ;
1157
+ expect ( conversionResult . output [ 0 ] . data . item [ 0 ] . request . body . formdata [ 0 ] . value ) . to . equal ( '<string>' ) ;
1158
+ done ( ) ;
1159
+ } ) ;
1160
+ } ) ;
1161
+
1146
1162
it ( 'Should have disableBodyPruning option for protocolProfileBehavior set to true for all types of request' +
1147
1163
allHTTPMethodsSpec , function ( done ) {
1148
1164
var openapi = fs . readFileSync ( allHTTPMethodsSpec , 'utf8' ) ;
@@ -1155,11 +1171,11 @@ describe('CONVERT FUNCTION TESTS ', function() {
1155
1171
_ . forEach ( conversionResult . output [ 0 ] . data . item [ 0 ] . item , ( request ) => {
1156
1172
expect ( request . protocolProfileBehavior . disableBodyPruning ) . to . eql ( true ) ;
1157
1173
} ) ;
1158
-
1159
1174
done ( ) ;
1160
1175
} ) ;
1161
1176
} ) ;
1162
1177
} ) ;
1178
+
1163
1179
describe ( 'Converting swagger 2.0 files' , function ( ) {
1164
1180
it ( 'should convert path paramters to postman-compatible paramters' , function ( done ) {
1165
1181
const fileData = path . join ( __dirname , SWAGGER_20_FOLDER_JSON , 'swagger2-with-params.json' ) ,
0 commit comments