mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 23:57:10 +00:00
Add fixes for es6 generator (#180)
Various fixes for JS (ES6) generator
This commit is contained in:
@@ -68,7 +68,7 @@ export default class FakeApi {
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = Boolean;
|
||||
let returnType = 'Boolean';
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/fake/outer/boolean', 'POST',
|
||||
@@ -150,7 +150,7 @@ export default class FakeApi {
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = Number;
|
||||
let returnType = 'Number';
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/fake/outer/number', 'POST',
|
||||
@@ -191,7 +191,7 @@ export default class FakeApi {
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = String;
|
||||
let returnType = 'String';
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/fake/outer/string', 'POST',
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/**
|
||||
* Swagger Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
import ApiClient from "../ApiClient";
|
||||
import Client from '../model/Client';
|
||||
|
||||
/**
|
||||
* Fake_classname_tags123 service.
|
||||
* @module api/Fake_classname_tags123Api
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default class Fake_classname_tags123Api {
|
||||
|
||||
/**
|
||||
* Constructs a new Fake_classname_tags123Api.
|
||||
* @alias module:api/Fake_classname_tags123Api
|
||||
* @class
|
||||
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
constructor(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callback function to receive the result of the testClassname operation.
|
||||
* @callback module:api/Fake_classname_tags123Api~testClassnameCallback
|
||||
* @param {String} error Error message, if any.
|
||||
* @param {module:model/Client} data The data returned by the service call.
|
||||
* @param {String} response The complete HTTP response.
|
||||
*/
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:api/Fake_classname_tags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response
|
||||
* data is of type: {@link module:model/Client}
|
||||
*/
|
||||
testClassname(body, callback) {
|
||||
let postBody = body;
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body === undefined || body === null) {
|
||||
throw new Error("Missing the required parameter 'body' when calling testClassname");
|
||||
}
|
||||
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = ['api_key_query'];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = Client;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/fake_classname_test', 'PATCH',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, callback
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export default class StoreApi {
|
||||
let authNames = ['api_key'];
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = {String: Number};
|
||||
let returnType = {'String': 'Number'};
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/store/inventory', 'GET',
|
||||
|
||||
@@ -297,7 +297,7 @@ export default class UserApi {
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/xml', 'application/json'];
|
||||
let returnType = String;
|
||||
let returnType = 'String';
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/user/login', 'GET',
|
||||
|
||||
Reference in New Issue
Block a user