forked from loafle/openapi-generator-original
[TypeScript-Refactor] Use OAIv3 spec and fix bugs in JQuery Blob download (#6416)
* Change to OAIv3 spec for TS-Refactor * Moved samples to oaiv3 folder * Updated package-lock * Update pom to use OAIv3 paths for Typescript-refactor * Renamed ts-refactor samples & tests in pom.xmls * Fixed compile issues in ts-refactor jquery http test * Fixed bugs in blob handling of jquery
This commit is contained in:
parent
dee6ed420e
commit
33c8d19564
@ -28,10 +28,10 @@ fi
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
echo "Creating default (fetch) client!"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/default --additional-properties=platform=node,npmName=ts-petstore-client $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript -o samples/openapi3/client/petstore/typescript/builds/default --additional-properties=platform=node,npmName=ts-petstore-client $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
echo "Creating jquery client!"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/jquery --additional-properties=framework=jquery,npmName=ts-petstore-client $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript -o samples/openapi3/client/petstore/typescript/builds/jquery --additional-properties=framework=jquery,npmName=ts-petstore-client $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -21,14 +21,12 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
data: body
|
||||
};
|
||||
|
||||
/**
|
||||
* Allow receiving binary data with jquery ajax
|
||||
*
|
||||
* Source: https://keyangxiang.com/2017/09/01/HTML5-XHR-download-binary-content-as-Blob/
|
||||
*/
|
||||
requestOptions.beforeSend = (jqXHR: any, settings: any) => {
|
||||
settings.xhr().responseType = "blob";
|
||||
};
|
||||
// If we want a blob, we have to set the xhrFields' responseType AND add a
|
||||
// custom converter to overwrite the default deserialization of JQuery...
|
||||
requestOptions["xhrFields"] = { responseType: 'blob' };
|
||||
requestOptions["converters"] = {}
|
||||
requestOptions["converters"]["* blob"] = (result:any) => result;
|
||||
requestOptions["dataType"] = "blob";
|
||||
|
||||
|
||||
if (request.getHeaders()['Content-Type']) {
|
||||
@ -51,6 +49,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
if (body && body.constructor.name == "FormData") {
|
||||
requestOptions.contentType = false;
|
||||
}
|
||||
|
||||
const sentRequest = $.ajax(requestOptions);
|
||||
|
||||
const resultPromise = new Promise<ResponseContext>((resolve, reject) => {
|
||||
|
20
pom.xml
20
pom.xml
@ -1000,7 +1000,19 @@
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/client/petstore/typescript/tests/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/default</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>typescript-client-tests-jquery</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/jquery</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
@ -1271,8 +1283,10 @@
|
||||
<module>samples/client/petstore/python-tornado</module>
|
||||
<module>samples/openapi3/client/petstore/python</module>
|
||||
<module>samples/openapi3/client/petstore/python-experimental</module>
|
||||
<module>samples/client/petstore/typescript/builds/default</module>
|
||||
<module>samples/client/petstore/typescript/tests/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/default</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/builds/jquery</module>
|
||||
<module>samples/openapi3/client/petstore/typescript/tests/jquery</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/default</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
|
||||
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>
|
||||
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
@ -17,14 +17,14 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, options?: Configuration): RequestContext {
|
||||
public addPet(pet: Pet, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling addPet.');
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Pet", ""),
|
||||
ObjectSerializer.serialize(pet, "Pet", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
@ -237,14 +237,14 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, options?: Configuration): RequestContext {
|
||||
public updatePet(pet: Pet, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling updatePet.');
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
@ -270,7 +270,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Pet", ""),
|
||||
ObjectSerializer.serialize(pet, "Pet", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
@ -406,15 +406,26 @@ export class PetApiResponseProcessor {
|
||||
* @params response Response returned by the server for a request to addPet
|
||||
* @throws ApiException if the response code was not in [200, 299]
|
||||
*/
|
||||
public async addPet(response: ResponseContext): Promise< void> {
|
||||
public async addPet(response: ResponseContext): Promise<Pet > {
|
||||
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
||||
if (isCodeInRange("200", response.httpStatusCode)) {
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
if (isCodeInRange("405", response.httpStatusCode)) {
|
||||
throw new ApiException<string>(response.httpStatusCode, "Invalid input");
|
||||
}
|
||||
|
||||
// Work around for missing responses in specification, e.g. for petstore.yaml
|
||||
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
||||
return;
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
@ -552,8 +563,15 @@ export class PetApiResponseProcessor {
|
||||
* @params response Response returned by the server for a request to updatePet
|
||||
* @throws ApiException if the response code was not in [200, 299]
|
||||
*/
|
||||
public async updatePet(response: ResponseContext): Promise< void> {
|
||||
public async updatePet(response: ResponseContext): Promise<Pet > {
|
||||
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
||||
if (isCodeInRange("200", response.httpStatusCode)) {
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
if (isCodeInRange("400", response.httpStatusCode)) {
|
||||
throw new ApiException<string>(response.httpStatusCode, "Invalid ID supplied");
|
||||
}
|
||||
@ -566,7 +584,11 @@ export class PetApiResponseProcessor {
|
||||
|
||||
// Work around for missing responses in specification, e.g. for petstore.yaml
|
||||
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
||||
return;
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
@ -121,14 +121,14 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, options?: Configuration): RequestContext {
|
||||
public placeOrder(order: Order, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling placeOrder.');
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
@ -147,10 +147,12 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Order", ""),
|
||||
ObjectSerializer.serialize(order, "Order", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
@ -17,14 +17,14 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, options?: Configuration): RequestContext {
|
||||
public createUser(user: User, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling createUser.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
@ -43,29 +43,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "User", ""),
|
||||
ObjectSerializer.serialize(user, "User", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, options?: Configuration): RequestContext {
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
@ -84,29 +91,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Array<User>", ""),
|
||||
ObjectSerializer.serialize(user, "Array<User>", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, options?: Configuration): RequestContext {
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling createUsersWithListInput.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
@ -125,15 +139,22 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Array<User>", ""),
|
||||
ObjectSerializer.serialize(user, "Array<User>", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
@ -169,7 +190,12 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
@ -278,7 +304,12 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
@ -287,9 +318,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, options?: Configuration): RequestContext {
|
||||
public updateUser(username: string, user: User, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
@ -298,9 +329,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling updateUser.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
@ -320,15 +351,22 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "User", ""),
|
||||
ObjectSerializer.serialize(user, "User", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { HttpFile } from '../http/http';
|
||||
|
||||
export class InlineObject {
|
||||
/**
|
||||
* Updated name of the pet
|
||||
*/
|
||||
'name'?: string;
|
||||
/**
|
||||
* Updated status of the pet
|
||||
*/
|
||||
'status'?: string;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
|
||||
{
|
||||
"name": "name",
|
||||
"baseName": "name",
|
||||
"type": "string",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"baseName": "status",
|
||||
"type": "string",
|
||||
"format": ""
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return InlineObject.attributeTypeMap;
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { HttpFile } from '../http/http';
|
||||
|
||||
export class InlineObject1 {
|
||||
/**
|
||||
* Additional data to pass to server
|
||||
*/
|
||||
'additionalMetadata'?: string;
|
||||
/**
|
||||
* file to upload
|
||||
*/
|
||||
'file'?: HttpFile;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
|
||||
{
|
||||
"name": "additionalMetadata",
|
||||
"baseName": "additionalMetadata",
|
||||
"type": "string",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
"name": "file",
|
||||
"baseName": "file",
|
||||
"type": "HttpFile",
|
||||
"format": "binary"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return InlineObject1.attributeTypeMap;
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
export * from './ApiResponse';
|
||||
export * from './Category';
|
||||
export * from './InlineObject';
|
||||
export * from './InlineObject1';
|
||||
export * from './Order';
|
||||
export * from './Pet';
|
||||
export * from './Tag';
|
||||
@ -7,6 +9,8 @@ export * from './User';
|
||||
|
||||
import { ApiResponse } from './ApiResponse';
|
||||
import { Category } from './Category';
|
||||
import { InlineObject } from './InlineObject';
|
||||
import { InlineObject1 } from './InlineObject1';
|
||||
import { Order , OrderStatusEnum } from './Order';
|
||||
import { Pet , PetStatusEnum } from './Pet';
|
||||
import { Tag } from './Tag';
|
||||
@ -38,6 +42,8 @@ let enumsMap: Set<string> = new Set<string>([
|
||||
let typeMap: {[index: string]: any} = {
|
||||
"ApiResponse": ApiResponse,
|
||||
"Category": Category,
|
||||
"InlineObject": InlineObject,
|
||||
"InlineObject1": InlineObject1,
|
||||
"Order": Order,
|
||||
"Pet": Pet,
|
||||
"Tag": Tag,
|
@ -1,5 +1,7 @@
|
||||
export * from './ApiResponse'
|
||||
export * from './Category'
|
||||
export * from './InlineObject'
|
||||
export * from './InlineObject1'
|
||||
export * from './Order'
|
||||
export * from './Pet'
|
||||
export * from './Tag'
|
@ -1,7 +1,7 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptBuildPetstoreClientSample</artifactId>
|
||||
<artifactId>TypeScriptBuildDefaultPetstoreClientSample</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Default Petstore Client</name>
|
@ -6,6 +6,8 @@ import {mergeMap, map} from '../rxjsStub';
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { InlineObject } from '../models/InlineObject';
|
||||
import { InlineObject1 } from '../models/InlineObject1';
|
||||
import { Order } from '../models/Order';
|
||||
import { Pet } from '../models/Pet';
|
||||
import { Tag } from '../models/Tag';
|
||||
@ -25,10 +27,10 @@ export class ObservablePetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.addPet(body, options);
|
||||
public addPet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContext = this.requestFactory.addPet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -144,10 +146,10 @@ export class ObservablePetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.updatePet(body, options);
|
||||
public updatePet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContext = this.requestFactory.updatePet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -306,10 +308,10 @@ export class ObservableStoreApi {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContext = this.requestFactory.placeOrder(body, options);
|
||||
public placeOrder(order: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContext = this.requestFactory.placeOrder(order, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -348,10 +350,10 @@ export class ObservableUserApi {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUser(body, options);
|
||||
public createUser(user: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUser(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -371,10 +373,10 @@ export class ObservableUserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithArrayInput(body, options);
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -394,10 +396,10 @@ export class ObservableUserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithListInput(body, options);
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithListInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -512,10 +514,10 @@ export class ObservableUserApi {
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.updateUser(username, body, options);
|
||||
public updateUser(username: string, user: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.updateUser(username, user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
@ -4,6 +4,8 @@ import { Configuration} from '../configuration'
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { InlineObject } from '../models/InlineObject';
|
||||
import { InlineObject1 } from '../models/InlineObject1';
|
||||
import { Order } from '../models/Order';
|
||||
import { Pet } from '../models/Pet';
|
||||
import { Tag } from '../models/Tag';
|
||||
@ -21,10 +23,10 @@ export class PromisePetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, options?: Configuration): Promise<void> {
|
||||
const result = this.api.addPet(body, options);
|
||||
public addPet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.addPet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -70,10 +72,10 @@ export class PromisePetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updatePet(body, options);
|
||||
public updatePet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.updatePet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -146,10 +148,10 @@ export class PromiseStoreApi {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(body, options);
|
||||
public placeOrder(order: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(order, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -172,28 +174,28 @@ export class PromiseUserApi {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(body, options);
|
||||
public createUser(user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(body, options);
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(body, options);
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -238,10 +240,10 @@ export class PromiseUserApi {
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, body, options);
|
||||
public updateUser(username: string, user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
@ -16,14 +16,14 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, options?: Configuration): RequestContext {
|
||||
public addPet(pet: Pet, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling addPet.');
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Pet", ""),
|
||||
ObjectSerializer.serialize(pet, "Pet", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
@ -236,14 +236,14 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, options?: Configuration): RequestContext {
|
||||
public updatePet(pet: Pet, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling updatePet.');
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
@ -269,7 +269,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Pet", ""),
|
||||
ObjectSerializer.serialize(pet, "Pet", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
@ -405,15 +405,26 @@ export class PetApiResponseProcessor {
|
||||
* @params response Response returned by the server for a request to addPet
|
||||
* @throws ApiException if the response code was not in [200, 299]
|
||||
*/
|
||||
public async addPet(response: ResponseContext): Promise< void> {
|
||||
public async addPet(response: ResponseContext): Promise<Pet > {
|
||||
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
||||
if (isCodeInRange("200", response.httpStatusCode)) {
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
if (isCodeInRange("405", response.httpStatusCode)) {
|
||||
throw new ApiException<string>(response.httpStatusCode, "Invalid input");
|
||||
}
|
||||
|
||||
// Work around for missing responses in specification, e.g. for petstore.yaml
|
||||
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
||||
return;
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
@ -551,8 +562,15 @@ export class PetApiResponseProcessor {
|
||||
* @params response Response returned by the server for a request to updatePet
|
||||
* @throws ApiException if the response code was not in [200, 299]
|
||||
*/
|
||||
public async updatePet(response: ResponseContext): Promise< void> {
|
||||
public async updatePet(response: ResponseContext): Promise<Pet > {
|
||||
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
||||
if (isCodeInRange("200", response.httpStatusCode)) {
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
if (isCodeInRange("400", response.httpStatusCode)) {
|
||||
throw new ApiException<string>(response.httpStatusCode, "Invalid ID supplied");
|
||||
}
|
||||
@ -565,7 +583,11 @@ export class PetApiResponseProcessor {
|
||||
|
||||
// Work around for missing responses in specification, e.g. for petstore.yaml
|
||||
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
||||
return;
|
||||
const body: Pet = ObjectSerializer.deserialize(
|
||||
ObjectSerializer.parse(await response.body.text(), contentType),
|
||||
"Pet", ""
|
||||
) as Pet;
|
||||
return body;
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
@ -120,14 +120,14 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, options?: Configuration): RequestContext {
|
||||
public placeOrder(order: Order, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling placeOrder.');
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
@ -146,10 +146,12 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Order", ""),
|
||||
ObjectSerializer.serialize(order, "Order", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
@ -16,14 +16,14 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, options?: Configuration): RequestContext {
|
||||
public createUser(user: User, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling createUser.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
@ -42,29 +42,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "User", ""),
|
||||
ObjectSerializer.serialize(user, "User", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, options?: Configuration): RequestContext {
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
@ -83,29 +90,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Array<User>", ""),
|
||||
ObjectSerializer.serialize(user, "Array<User>", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, options?: Configuration): RequestContext {
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling createUsersWithListInput.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
@ -124,15 +138,22 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "Array<User>", ""),
|
||||
ObjectSerializer.serialize(user, "Array<User>", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
@ -168,7 +189,12 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
@ -277,7 +303,12 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
@ -286,9 +317,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, options?: Configuration): RequestContext {
|
||||
public updateUser(username: string, user: User, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
@ -297,9 +328,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
|
||||
|
||||
// verify required parameter 'body' is not null or undefined
|
||||
if (body === null || body === undefined) {
|
||||
throw new RequiredError('Required parameter body was null or undefined when calling updateUser.');
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
@ -319,15 +350,22 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([]);
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
requestContext.setHeaderParam("Content-Type", contentType);
|
||||
const serializedBody = ObjectSerializer.stringify(
|
||||
ObjectSerializer.serialize(body, "User", ""),
|
||||
ObjectSerializer.serialize(user, "User", ""),
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
||||
return requestContext;
|
||||
}
|
@ -21,14 +21,12 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
data: body
|
||||
};
|
||||
|
||||
/**
|
||||
* Allow receiving binary data with jquery ajax
|
||||
*
|
||||
* Source: https://keyangxiang.com/2017/09/01/HTML5-XHR-download-binary-content-as-Blob/
|
||||
*/
|
||||
requestOptions.beforeSend = (jqXHR: any, settings: any) => {
|
||||
settings.xhr().responseType = "blob";
|
||||
};
|
||||
// If we want a blob, we have to set the xhrFields' responseType AND add a
|
||||
// custom converter to overwrite the default deserialization of JQuery...
|
||||
requestOptions["xhrFields"] = { responseType: 'blob' };
|
||||
requestOptions["converters"] = {}
|
||||
requestOptions["converters"]["* blob"] = (result:any) => result;
|
||||
requestOptions["dataType"] = "blob";
|
||||
|
||||
|
||||
if (request.getHeaders()['Content-Type']) {
|
||||
@ -51,6 +49,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
if (body && body.constructor.name == "FormData") {
|
||||
requestOptions.contentType = false;
|
||||
}
|
||||
|
||||
const sentRequest = $.ajax(requestOptions);
|
||||
|
||||
const resultPromise = new Promise<ResponseContext>((resolve, reject) => {
|
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { HttpFile } from '../http/http';
|
||||
|
||||
export class InlineObject {
|
||||
/**
|
||||
* Updated name of the pet
|
||||
*/
|
||||
'name'?: string;
|
||||
/**
|
||||
* Updated status of the pet
|
||||
*/
|
||||
'status'?: string;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
|
||||
{
|
||||
"name": "name",
|
||||
"baseName": "name",
|
||||
"type": "string",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"baseName": "status",
|
||||
"type": "string",
|
||||
"format": ""
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return InlineObject.attributeTypeMap;
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { HttpFile } from '../http/http';
|
||||
|
||||
export class InlineObject1 {
|
||||
/**
|
||||
* Additional data to pass to server
|
||||
*/
|
||||
'additionalMetadata'?: string;
|
||||
/**
|
||||
* file to upload
|
||||
*/
|
||||
'file'?: HttpFile;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
|
||||
{
|
||||
"name": "additionalMetadata",
|
||||
"baseName": "additionalMetadata",
|
||||
"type": "string",
|
||||
"format": ""
|
||||
},
|
||||
{
|
||||
"name": "file",
|
||||
"baseName": "file",
|
||||
"type": "HttpFile",
|
||||
"format": "binary"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return InlineObject1.attributeTypeMap;
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
export * from './ApiResponse';
|
||||
export * from './Category';
|
||||
export * from './InlineObject';
|
||||
export * from './InlineObject1';
|
||||
export * from './Order';
|
||||
export * from './Pet';
|
||||
export * from './Tag';
|
||||
@ -7,6 +9,8 @@ export * from './User';
|
||||
|
||||
import { ApiResponse } from './ApiResponse';
|
||||
import { Category } from './Category';
|
||||
import { InlineObject } from './InlineObject';
|
||||
import { InlineObject1 } from './InlineObject1';
|
||||
import { Order , OrderStatusEnum } from './Order';
|
||||
import { Pet , PetStatusEnum } from './Pet';
|
||||
import { Tag } from './Tag';
|
||||
@ -38,6 +42,8 @@ let enumsMap: Set<string> = new Set<string>([
|
||||
let typeMap: {[index: string]: any} = {
|
||||
"ApiResponse": ApiResponse,
|
||||
"Category": Category,
|
||||
"InlineObject": InlineObject,
|
||||
"InlineObject1": InlineObject1,
|
||||
"Order": Order,
|
||||
"Pet": Pet,
|
||||
"Tag": Tag,
|
@ -1,5 +1,7 @@
|
||||
export * from './ApiResponse'
|
||||
export * from './Category'
|
||||
export * from './InlineObject'
|
||||
export * from './InlineObject1'
|
||||
export * from './Order'
|
||||
export * from './Pet'
|
||||
export * from './Tag'
|
@ -1,7 +1,7 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptBuildPetstoreClientSample</artifactId>
|
||||
<artifactId>TypeScriptBuildJQueryPetstoreClientSample</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Default Petstore Client</name>
|
@ -6,6 +6,8 @@ import {mergeMap, map} from '../rxjsStub';
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { InlineObject } from '../models/InlineObject';
|
||||
import { InlineObject1 } from '../models/InlineObject1';
|
||||
import { Order } from '../models/Order';
|
||||
import { Pet } from '../models/Pet';
|
||||
import { Tag } from '../models/Tag';
|
||||
@ -25,10 +27,10 @@ export class ObservablePetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.addPet(body, options);
|
||||
public addPet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContext = this.requestFactory.addPet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -144,10 +146,10 @@ export class ObservablePetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.updatePet(body, options);
|
||||
public updatePet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContext = this.requestFactory.updatePet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -306,10 +308,10 @@ export class ObservableStoreApi {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContext = this.requestFactory.placeOrder(body, options);
|
||||
public placeOrder(order: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContext = this.requestFactory.placeOrder(order, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -348,10 +350,10 @@ export class ObservableUserApi {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUser(body, options);
|
||||
public createUser(user: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUser(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -371,10 +373,10 @@ export class ObservableUserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithArrayInput(body, options);
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -394,10 +396,10 @@ export class ObservableUserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithListInput(body, options);
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.createUsersWithListInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
||||
@ -512,10 +514,10 @@ export class ObservableUserApi {
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.updateUser(username, body, options);
|
||||
public updateUser(username: string, user: User, options?: Configuration): Observable<void> {
|
||||
const requestContext = this.requestFactory.updateUser(username, user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = of(requestContext);
|
@ -4,6 +4,8 @@ import { Configuration} from '../configuration'
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { InlineObject } from '../models/InlineObject';
|
||||
import { InlineObject1 } from '../models/InlineObject1';
|
||||
import { Order } from '../models/Order';
|
||||
import { Pet } from '../models/Pet';
|
||||
import { Tag } from '../models/Tag';
|
||||
@ -21,10 +23,10 @@ export class PromisePetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, options?: Configuration): Promise<void> {
|
||||
const result = this.api.addPet(body, options);
|
||||
public addPet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.addPet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -70,10 +72,10 @@ export class PromisePetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updatePet(body, options);
|
||||
public updatePet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.updatePet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -146,10 +148,10 @@ export class PromiseStoreApi {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(body, options);
|
||||
public placeOrder(order: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(order, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -172,28 +174,28 @@ export class PromiseUserApi {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(body, options);
|
||||
public createUser(user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(body, options);
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(body, options);
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
@ -238,10 +240,10 @@ export class PromiseUserApi {
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, body, options);
|
||||
public updateUser(username: string, user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
@ -1224,6 +1224,7 @@
|
||||
"version": "file:../../builds/default",
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"btoa": "^1.2.1",
|
||||
"es6-promise": "^4.2.4",
|
||||
"form-data": "^2.5.0",
|
||||
@ -1233,46 +1234,57 @@
|
||||
"dependencies": {
|
||||
"@types/isomorphic-fetch": {
|
||||
"version": "0.0.34",
|
||||
"resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz",
|
||||
"integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY="
|
||||
"bundled": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.12.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz",
|
||||
"integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w=="
|
||||
"bundled": true
|
||||
},
|
||||
"@types/node-fetch": {
|
||||
"version": "2.5.7",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"form-data": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"form-data": {
|
||||
"version": "3.0.0",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
"bundled": true
|
||||
},
|
||||
"btoa": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz",
|
||||
"integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
|
||||
"bundled": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
"bundled": true
|
||||
},
|
||||
"es6-promise": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz",
|
||||
"integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg=="
|
||||
"bundled": true
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
|
||||
"integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.6",
|
||||
@ -1281,49 +1293,41 @@
|
||||
},
|
||||
"isomorphic-fetch": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
|
||||
"integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"whatwg-fetch": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.40.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
|
||||
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
|
||||
"bundled": true
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.24",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
|
||||
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"mime-db": "1.40.0"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
"bundled": true
|
||||
},
|
||||
"querystringify": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz",
|
||||
"integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg=="
|
||||
"bundled": true
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
|
||||
"bundled": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "2.9.2",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w=="
|
||||
"bundled": true
|
||||
},
|
||||
"url-parse": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz",
|
||||
"integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"querystringify": "^2.0.0",
|
||||
"requires-port": "^1.0.0"
|
||||
@ -1331,8 +1335,7 @@
|
||||
},
|
||||
"whatwg-fetch": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz",
|
||||
"integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q=="
|
||||
"bundled": true
|
||||
}
|
||||
}
|
||||
},
|
@ -1,7 +1,7 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptPetstoreClientTests</artifactId>
|
||||
<artifactId>TypeScriptDefaultPetstoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Petstore Test Client</name>
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -2886,8 +2886,7 @@
|
||||
"normalize-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
||||
"optional": true
|
||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
@ -3145,8 +3144,7 @@
|
||||
"picomatch": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
|
||||
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
|
||||
"optional": true
|
||||
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
|
||||
},
|
||||
"pify": {
|
||||
"version": "4.0.1",
|
||||
@ -4294,35 +4292,31 @@
|
||||
"@types/jquery": "^3.3.29",
|
||||
"btoa": "^1.2.1",
|
||||
"es6-promise": "^4.2.4",
|
||||
"jquery": "^3.5.1",
|
||||
"jquery": "^3.4.1",
|
||||
"url-parse": "^1.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/form-data": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz",
|
||||
"integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/jquery": {
|
||||
"version": "3.3.29",
|
||||
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.29.tgz",
|
||||
"integrity": "sha512-FhJvBninYD36v3k6c+bVk1DSZwh7B5Dpb/Pyk3HKVsiohn0nhbefZZ+3JXbWQhFyt0MxSl2jRDdGQPHeOHFXrQ==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/sizzle": "*"
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.0.tgz",
|
||||
"integrity": "sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg=="
|
||||
"bundled": true
|
||||
},
|
||||
"@types/rx": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx/-/rx-4.1.1.tgz",
|
||||
"integrity": "sha1-WY/JSla67ZdfGUV04PVy/Y5iekg=",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-core": "*",
|
||||
"@types/rx-core-binding": "*",
|
||||
@ -4340,21 +4334,18 @@
|
||||
},
|
||||
"@types/rx-core": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-core/-/rx-core-4.0.3.tgz",
|
||||
"integrity": "sha1-CzNUsSOM7b4rdPYybxOdvHpZHWA="
|
||||
"bundled": true
|
||||
},
|
||||
"@types/rx-core-binding": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-core-binding/-/rx-core-binding-4.0.4.tgz",
|
||||
"integrity": "sha512-5pkfxnC4w810LqBPUwP5bg7SFR/USwhMSaAeZQQbEHeBp57pjKXRlXmqpMrLJB4y1oglR/c2502853uN0I+DAQ==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-core": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite/-/rx-lite-4.0.6.tgz",
|
||||
"integrity": "sha512-oYiDrFIcor9zDm0VDUca1UbROiMYBxMLMaM6qzz4ADAfOmA9r1dYEcAFH+2fsPI5BCCjPvV9pWC3X3flbrvs7w==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-core": "*",
|
||||
"@types/rx-core-binding": "*"
|
||||
@ -4362,113 +4353,97 @@
|
||||
},
|
||||
"@types/rx-lite-aggregates": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-aggregates/-/rx-lite-aggregates-4.0.3.tgz",
|
||||
"integrity": "sha512-MAGDAHy8cRatm94FDduhJF+iNS5//jrZ/PIfm+QYw9OCeDgbymFHChM8YVIvN2zArwsRftKgE33QfRWvQk4DPg==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-async": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-async/-/rx-lite-async-4.0.2.tgz",
|
||||
"integrity": "sha512-vTEv5o8l6702ZwfAM5aOeVDfUwBSDOs+ARoGmWAKQ6LOInQ8J4/zjM7ov12fuTpktUKdMQjkeCp07Vd73mPkxw==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-backpressure": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-backpressure/-/rx-lite-backpressure-4.0.3.tgz",
|
||||
"integrity": "sha512-Y6aIeQCtNban5XSAF4B8dffhIKu6aAy/TXFlScHzSxh6ivfQBQw6UjxyEJxIOt3IT49YkS+siuayM2H/Q0cmgA==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-coincidence": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-coincidence/-/rx-lite-coincidence-4.0.3.tgz",
|
||||
"integrity": "sha512-1VNJqzE9gALUyMGypDXZZXzR0Tt7LC9DdAZQ3Ou/Q0MubNU35agVUNXKGHKpNTba+fr8GdIdkC26bRDqtCQBeQ==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-experimental": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-experimental/-/rx-lite-experimental-4.0.1.tgz",
|
||||
"integrity": "sha1-xTL1y98/LBXaFt7Ykw0bKYQCPL0=",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-joinpatterns": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-joinpatterns/-/rx-lite-joinpatterns-4.0.1.tgz",
|
||||
"integrity": "sha1-9w/jcFGKhDLykVjMkv+1a05K/D4=",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-testing": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-testing/-/rx-lite-testing-4.0.1.tgz",
|
||||
"integrity": "sha1-IbGdEfTf1v/vWp0WSOnIh5v+Iek=",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite-virtualtime": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-time": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-time/-/rx-lite-time-4.0.3.tgz",
|
||||
"integrity": "sha512-ukO5sPKDRwCGWRZRqPlaAU0SKVxmWwSjiOrLhoQDoWxZWg6vyB9XLEZViKOzIO6LnTIQBlk4UylYV0rnhJLxQw==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/rx-lite-virtualtime": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/rx-lite-virtualtime/-/rx-lite-virtualtime-4.0.3.tgz",
|
||||
"integrity": "sha512-3uC6sGmjpOKatZSVHI2xB1+dedgml669ZRvqxy+WqmGJDVusOdyxcKfyzjW0P3/GrCiN4nmRkLVMhPwHCc5QLg==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"@types/rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"@types/sizzle": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
|
||||
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg=="
|
||||
"bundled": true
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
"bundled": true
|
||||
},
|
||||
"btoa": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz",
|
||||
"integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
|
||||
"bundled": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
"bundled": true
|
||||
},
|
||||
"es6-promise": {
|
||||
"version": "4.2.6",
|
||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
|
||||
"integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q=="
|
||||
"bundled": true
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
|
||||
"integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.6",
|
||||
@ -4477,54 +4452,45 @@
|
||||
},
|
||||
"jquery": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
|
||||
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
|
||||
"bundled": true
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.40.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
|
||||
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
|
||||
"bundled": true
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.24",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
|
||||
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"mime-db": "1.40.0"
|
||||
}
|
||||
},
|
||||
"querystringify": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
|
||||
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA=="
|
||||
"bundled": true
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
|
||||
"bundled": true
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
|
||||
"integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"bundled": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "2.9.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
|
||||
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w=="
|
||||
"bundled": true
|
||||
},
|
||||
"url-parse": {
|
||||
"version": "1.4.7",
|
||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz",
|
||||
"integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"querystringify": "^2.1.1",
|
||||
"requires-port": "^1.0.0"
|
@ -1,7 +1,7 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptPetstoreClientTests</artifactId>
|
||||
<artifactId>TypeScriptJQueryPetstoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Petstore Test Client</name>
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -17,10 +17,12 @@ for (let libName in libs) {
|
||||
return new Promise((resolve, reject) => {
|
||||
lib.send(requestContext).toPromise().then((resp: petstore.ResponseContext) => {
|
||||
assert.ok(resp.httpStatusCode, 200, "Expected status code to be 200");
|
||||
let body = JSON.parse(resp.body);
|
||||
return resp.body.text();
|
||||
}).then((txtBody: string) => {
|
||||
let body = JSON.parse(txtBody);
|
||||
assert.ok(body["headers"]);
|
||||
assert.equal(body["headers"]["X-Test-Token"],"Test-Token");
|
||||
resolve()
|
||||
resolve()
|
||||
},
|
||||
(e: any) => {
|
||||
console.error(e)
|
||||
@ -44,12 +46,14 @@ for (let libName in libs) {
|
||||
lib.send(requestContext).toPromise().then(
|
||||
(resp: petstore.ResponseContext) => {
|
||||
assert.ok(resp.httpStatusCode, 200, "Expected status code to be 200");
|
||||
let body = JSON.parse(resp.body);
|
||||
return resp.body.text();
|
||||
}).then((txtBody: any) => {
|
||||
let body = JSON.parse(txtBody);
|
||||
assert.ok(body["headers"]);
|
||||
assert.equal(body["headers"]["X-Test-Token"], "Test-Token");
|
||||
assert.equal(body["files"]["testFile"], "abc");
|
||||
assert.equal(body["form"]["test"], "test2");
|
||||
resolve();
|
||||
resolve();
|
||||
},
|
||||
(e: any) => {
|
||||
console.error(e)
|
Loading…
x
Reference in New Issue
Block a user