Skip to content

Commit 8545f78

Browse files
committed
Merge pull request #471 from swagger-api/develop_2.0
Merged from develop_2.0
2 parents 1bd0bbc + 1df2999 commit 8545f78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+43721
-1674
lines changed

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ language: node_js
33
node_js:
44
- '0.10'
55
script:
6+
- export DISPLAY=:99.0
7+
- sh -e /etc/init.d/xvfb start
68
- npm install
7-
- mocha
9+
- npm test
10+
- npm run browsertest

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2015 Reverb Technologies, Inc.
1+
Copyright 2015 SmartBear Software
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@ npm install swagger-client
1717

1818
Then let swagger do the work!
1919
```js
20-
var client = require("swagger-client")
20+
var client = require('swagger-client');
2121

2222
var swagger = new client({
2323
url: 'http://petstore.swagger.io/v2/swagger.json',
2424
success: function() {
25-
swagger.apis.pet.getPetById({petId:1});
25+
swagger.pet.getPetById({petId:7},{responseContentType: 'application/json'},function(pet){
26+
console.log('pet', pet);
27+
});
2628
}
2729
});
28-
2930
```
3031

32+
NOTE: we're explicitly setting the responseContentType, because we don't want you getting stuck when there is more than one content type available.
33+
3134
That's it! You'll get a JSON response with the default callback handler:
3235

3336
```json
@@ -80,7 +83,7 @@ Download `browser/swagger-client.js` into your webapp:
8083
url: "http://petstore.swagger.io/api/api-docs",
8184
success: function() {
8285
// upon connect, fetch a pet and set contents to element "mydata"
83-
swagger.apis.pet.getPetById({petId:1}, function(data) {
86+
swagger.apis.pet.getPetById({petId:1},{responseContentType: 'application/json'}, function(data) {
8487
document.getElementById("mydata").innerHTML = JSON.stringify(data.obj);
8588
});
8689
}
@@ -187,7 +190,7 @@ gulp coverage
187190
License
188191
-------
189192

190-
Copyright 2011-2015 Reverb Technologies, Inc.
193+
Copyright 2011-2015 SmartBear Software
191194

192195
Licensed under the Apache License, Version 2.0 (the "License");
193196
you may not use this file except in compliance with the License.

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-js",
3-
"version": "2.1.6-M2",
3+
"version": "2.1.7-M2",
44
"main": "browser/swagger-client.js",
55
"ignore": [
66
"gulpfile.js",
@@ -16,7 +16,7 @@
1616
"license": "apache 2.0",
1717
"repository": {
1818
"type": "git",
19-
"url": "git://github.com/swagger-api/swagger-client.git"
19+
"url": "git://github.com/swagger-api/swagger-js.git"
2020
},
2121
"homepage": "http://swagger.io",
2222
"moduleType": [ "globals" ],

0 commit comments

Comments
 (0)