File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -428,4 +428,35 @@ describe('help options', function () {
428428 }
429429 } ) ;
430430 } ) ;
431+
432+ it ( 'has brackets in variables' , function ( done ) {
433+ var spec = {
434+ paths : {
435+ '/foo' : {
436+ post : {
437+ tags : [ 'test' ] ,
438+ operationId : 'sample' ,
439+ parameters : [
440+ {
441+ in : 'query' ,
442+ name : 'fields' ,
443+ type : 'string'
444+ }
445+ ]
446+ }
447+ }
448+ }
449+ } ;
450+
451+ var client = new SwaggerClient ( {
452+ url : 'http://localhost:8080/petstore.yaml' ,
453+ spec : spec ,
454+ success : function ( ) {
455+ var msg = client . test . sample . asCurl ( { fields : '[articles]=title' } ) ;
456+ expect ( msg ) . toBe ( "curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://localhost:8080/foo?fields=%5Barticles%5D%3Dtitle'" ) ;
457+
458+ done ( ) ;
459+ }
460+ } ) ;
461+ } ) ;
431462} ) ;
You can’t perform that action at this time.
0 commit comments