Skip to content

Commit 12ec38c

Browse files
committed
1 parent dbf09d2 commit 12ec38c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/help.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)