File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -394,4 +394,38 @@ describe('help options', function () {
394394 }
395395 } ) ;
396396 } ) ;
397+
398+ it ( 'supports extended content-types' , function ( done ) {
399+ var spec = {
400+ paths : {
401+ '/foo' : {
402+ post : {
403+ tags : [ 'test' ] ,
404+ operationId : 'sample' ,
405+ consumes : [ 'application/json' ] ,
406+ produces : [ 'application/json; version=1' ] ,
407+ parameters : [
408+ {
409+ in : 'body' ,
410+ name : 'complexBody' ,
411+ schema : {
412+ type : 'object'
413+ }
414+ }
415+ ]
416+ }
417+ }
418+ }
419+ } ;
420+
421+ var client = new SwaggerClient ( {
422+ url : 'http://localhost:8080/petstore.yaml' ,
423+ spec : spec ,
424+ success : function ( ) {
425+ var msg = client . test . sample . asCurl ( { complexBody : '{"name":"tony"}' } , { requestContentType : 'application/json; version=1' } ) ;
426+ expect ( msg ) . toBe ( "curl -X POST --header 'Content-Type: application/json; version=1' --header 'Accept: application/json; version=1' -d '{\"name\":\"tony\"}' 'http://localhost:8080/foo'" ) ;
427+ done ( ) ;
428+ }
429+ } ) ;
430+ } ) ;
397431} ) ;
You can’t perform that action at this time.
0 commit comments