Skip to content

Commit

Permalink
Merge pull request #12 from gotchazipc/master
Browse files Browse the repository at this point in the history
fix apiClient to use callback.responseType
  • Loading branch information
gotchazipc authored Jul 26, 2016
2 parents 4ee38a7 + 91fce6a commit 0a96bb9
Show file tree
Hide file tree
Showing 52 changed files with 91 additions and 83 deletions.
6 changes: 3 additions & 3 deletions README-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This SDK Contains automatically generated sources & documents with the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 0.7.0
- Package version: 0.7.0
- Build date: 2016-07-21T13:37:20.306+09:00
- API version: 0.7.1
- Package version: 0.7.1
- Build date: 2016-07-26T15:37:20.836+09:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion api-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger" : "2.0",
"info" : {
"description" : "Restful API for Webida clients to use server's data & features",
"version" : "0.7.0",
"version" : "0.7.1",
"title" : "Webida Restful API",
"license" : {
"name" : "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion api-spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
swagger: "2.0"

info:
version: "0.7.0"
version: "0.7.1"
title: Webida Restful API
description: Restful API for Webida clients to use server's data & features
license:
Expand Down
8 changes: 6 additions & 2 deletions builder/templates/ApiClient.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,13 @@
request.accept(accept);
}

// if api returns file, then it should be handled as blob
// if api returns file, caller should be able to set
// response type (blob, arraybuffer..) of XHR request
// client should not set blob/arraybuffer type if return file is json, due to superagent bugs.
if (returnType === File) {
request.responseType('blob');
if (callback.responseType) {
request.responseType(callback.responseType);
}
}

{{#usePromises}} return new Promise(function(resolve, reject) {
Expand Down
4 changes: 2 additions & 2 deletions builder/templates/package.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webida-restful-api",
"version": "0.7.0",
"version": "0.7.1",
"description": "Webida Restful API Spec & generated clients",
"license": "Apache-2.0",
"main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js",
Expand All @@ -12,7 +12,7 @@
"url" : "https://github.com/webida/webida-restful-api.git"
},
"dependencies": {
"superagent": "2.0.0"
"superagent": "2.1.0"
},
"devDependencies": {
"mocha": "~2.3.4",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webida-restful-api",
"version": "0.7.0",
"version": "0.7.1",
"description": "Webida Restful API Spec & generated clients",
"license": "Apache-2.0",
"main": "src/index.js",
Expand All @@ -12,7 +12,7 @@
"url" : "https://github.com/webida/webida-restful-api.git"
},
"dependencies": {
"superagent": "2.0.0"
"superagent": "2.1.0"
},
"devDependencies": {
"mocha": "~2.3.4",
Expand Down
12 changes: 8 additions & 4 deletions src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -41,7 +41,7 @@

/**
* @module ApiClient
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down Expand Up @@ -405,9 +405,13 @@
request.accept(accept);
}

// if api returns file, then it should be handled as blob
// if api returns file, caller should be able to set
// response type (blob, arraybuffer..) of XHR request
// client should not set blob/arraybuffer type if return file is json, due to superagent bugs.
if (returnType === File) {
request.responseType('blob');
if (callback.responseType) {
request.responseType(callback.responseType);
}
}


Expand Down
4 changes: 2 additions & 2 deletions src/api/AliasApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Alias service.
* @module api/AliasApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/AuthApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Auth service.
* @module api/AuthApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/OpsApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Ops service.
* @module api/OpsApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/RemotesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Remotes service.
* @module api/RemotesApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/SessionApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Session service.
* @module api/SessionApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/WfsApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Wfs service.
* @module api/WfsApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/api/WorkspaceApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -42,7 +42,7 @@
/**
* Workspace service.
* @module api/WorkspaceApi
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -62,7 +62,7 @@
* </pre>
* </p>
* @module index
* @version 0.7.0
* @version 0.7.1
*/
var exports = {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/Alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The Alias model module.
* @module model/Alias
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/ChildProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The ChildProcess model module.
* @module model/ChildProcess
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/Credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The Credential model module.
* @module model/Credential
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/DirEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The DirEntry model module.
* @module model/DirEntry
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/Execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The Execution model module.
* @module model/Execution
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/ExecutionResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The ExecutionResult model module.
* @module model/ExecutionResult
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/model/Match.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Webida Restful API
* Restful API for Webida clients to use server's data & features
*
* OpenAPI spec version: 0.7.0
* OpenAPI spec version: 0.7.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
Expand Down Expand Up @@ -45,7 +45,7 @@
/**
* The Match model module.
* @module model/Match
* @version 0.7.0
* @version 0.7.1
*/

/**
Expand Down
Loading

0 comments on commit 0a96bb9

Please sign in to comment.