mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 17:47:07 +00:00
[JavaScript] Update vulnerable dependencies (#784)
* Update vulnerable dependencies * Update samples: javascript-es6 * Update samples: javascript-promise * Update samples: javascript-promise-es6 * Update samples: javascript * Update samples: petstore-security-test/javascript * Rename operationId if it starts with a number * Update samples bin/javascript-petstore.sh bin/javascript-es6-petstore.sh bin/javascript-promise-petstore.sh bin/javascript-promise-es6-petstore.sh
This commit is contained in:
committed by
William Cheng
parent
afdef8f890
commit
21777f2759
@@ -37,16 +37,16 @@ export default class AnotherFakeApi {
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response
|
||||
*/
|
||||
testSpecialTagsWithHttpInfo(client) {
|
||||
call123testSpecialTagsWithHttpInfo(client) {
|
||||
let postBody = client;
|
||||
|
||||
// verify the required parameter 'client' is set
|
||||
if (client === undefined || client === null) {
|
||||
throw new Error("Missing the required parameter 'client' when calling testSpecialTags");
|
||||
throw new Error("Missing the required parameter 'client' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
|
||||
@@ -73,12 +73,12 @@ export default class AnotherFakeApi {
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client}
|
||||
*/
|
||||
testSpecialTags(client) {
|
||||
return this.testSpecialTagsWithHttpInfo(client)
|
||||
call123testSpecialTags(client) {
|
||||
return this.call123testSpecialTagsWithHttpInfo(client)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import ApiClient from "../ApiClient";
|
||||
import Client from '../model/Client';
|
||||
import FileSchemaTestClass from '../model/FileSchemaTestClass';
|
||||
import OuterComposite from '../model/OuterComposite';
|
||||
import User from '../model/User';
|
||||
|
||||
@@ -221,6 +222,54 @@ export default class FakeApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param {module:model/FileSchemaTestClass} fileSchemaTestClass
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) {
|
||||
let postBody = fileSchemaTestClass;
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass === undefined || fileSchemaTestClass === null) {
|
||||
throw new Error("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/fake/body-with-file-schema', 'PUT',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param {module:model/FileSchemaTestClass} fileSchemaTestClass
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
testBodyWithFileSchema(fileSchemaTestClass) {
|
||||
return this.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {String} query
|
||||
* @param {module:model/User} user
|
||||
|
||||
@@ -456,4 +456,67 @@ export default class PetApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
* @param {Number} petId ID of pet to update
|
||||
* @param {File} requiredFile file to upload
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} opts.additionalMetadata Additional data to pass to server
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response
|
||||
*/
|
||||
uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, opts) {
|
||||
opts = opts || {};
|
||||
let postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId === undefined || petId === null) {
|
||||
throw new Error("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile === undefined || requiredFile === null) {
|
||||
throw new Error("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
|
||||
|
||||
let pathParams = {
|
||||
'petId': petId
|
||||
};
|
||||
let queryParams = {
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
'additionalMetadata': opts['additionalMetadata'],
|
||||
'requiredFile': requiredFile
|
||||
};
|
||||
|
||||
let authNames = ['petstore_auth'];
|
||||
let contentTypes = ['multipart/form-data'];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = ApiResponse;
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/fake/{petId}/uploadImageWithRequiredFile', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
* @param {Number} petId ID of pet to update
|
||||
* @param {File} requiredFile file to upload
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} opts.additionalMetadata Additional data to pass to server
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse}
|
||||
*/
|
||||
uploadFileWithRequiredFile(petId, requiredFile, opts) {
|
||||
return this.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, opts)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user