@@ -30,6 +30,7 @@ const expect = require('chai').expect,
30
30
examplesOutsideSchema = path . join ( __dirname , VALID_OPENAPI_PATH + '/examples_outside_schema.json' ) ,
31
31
exampleOutsideSchema = path . join ( __dirname , VALID_OPENAPI_PATH + '/example_outside_schema.json' ) ,
32
32
descriptionInBodyParams = path . join ( __dirname , VALID_OPENAPI_PATH + '/description_in_body_params.json' ) ,
33
+ descriptionInPathParams = path . join ( __dirname , VALID_OPENAPI_PATH + '/path_params_with_description.json' ) ,
33
34
zeroDefaultValueSpec = path . join ( __dirname , VALID_OPENAPI_PATH + '/zero_in_default_value.json' ) ,
34
35
requiredInParams = path . join ( __dirname , VALID_OPENAPI_PATH , '/required_in_parameters.json' ) ,
35
36
multipleRefs = path . join ( __dirname , VALID_OPENAPI_PATH , '/multiple_refs.json' ) ,
@@ -552,6 +553,16 @@ describe('The convert v2 Function', function() {
552
553
} ) ;
553
554
} ) ;
554
555
556
+ it ( 'should add description in path params' , function ( done ) {
557
+ var openapi = fs . readFileSync ( descriptionInPathParams , 'utf-8' ) ;
558
+ Converter . convertV2 ( { type : 'string' , data : openapi } , { schemaFaker : true } , ( err , conversionResult ) => {
559
+ let description = conversionResult . output [ 0 ] . data . item [ 0 ] . item [ 0 ] . item [ 0 ] . request . url . variable [ 0 ] . description ;
560
+ expect ( err ) . to . be . null ;
561
+ expect ( description ) . to . equal ( '(Required) Id of pet' ) ;
562
+ done ( ) ;
563
+ } ) ;
564
+ } ) ;
565
+
555
566
it ( 'Should create collection from folder having one root file for browser' , function ( done ) {
556
567
let folderPath = path . join ( __dirname , '../data/petstore separate yaml' ) ,
557
568
files = [ ] ,
0 commit comments