Patch 2 #1490
Annotations
10 errors
tests/extended.test.ts > extended > 'additional-properties':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'additional-properties' 1` mismatched
- Expected
+ Received
@@ -8,224 +8,234 @@
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
export interface Message {
- code?: number;
+ code?: number;
- text?: string;
+ text?: string;
}
export type Messages = Record<string, Message>;
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
+ private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
- private abortControllers = new Map<CancelToken, AbortController>();
+ private abortControllers = new Map<CancelToken, AbortController>();
- private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
+ private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
- private baseApiParams: RequestParams = {
+ private baseApiParams: RequestParams = {
- credentials: "same-origin",
+ credentials: "same-origin",
- headers: {},
+ headers: {},
- redirect: "follow",
+ redirect: "follow",
- referrerPolicy: "no-referrer",
+ referrerPolicy: "no-referrer",
- };
+ };
- constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
+ constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
- Object.assign(this, apiConfig);
+ Object.assign(this, apiConfig);
- }
+ }
- public setSecurityData = (data: SecurityDataType |
|
tests/extended.test.ts > extended > 'additional-properties2':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'additional-properties2' 1` mismatched
- Expected
+ Received
@@ -15,214 +15,224 @@
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
+ private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
- private abortControllers = new Map<CancelToken, AbortController>();
+ private abortControllers = new Map<CancelToken, AbortController>();
- private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
+ private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
- private baseApiParams: RequestParams = {
+ private baseApiParams: RequestParams = {
- credentials: "same-origin",
+ credentials: "same-origin",
- headers: {},
+ headers: {},
- redirect: "follow",
+ redirect: "follow",
- referrerPolicy: "no-referrer",
+ referrerPolicy: "no-referrer",
- };
+ };
- constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
+ constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
- Object.assign(this, apiConfig);
+ Object.assign(this, apiConfig);
- }
+ }
- public setSecurityData = (data: SecurityDataType | null) => {
+ public setSecurityData = (data: SecurityDataType | null) => {
- this.securityData = data;
+ this.securityData = data;
- };
+ };
- protected encodeQueryParam(key: string, value: any) {
+ protected encodeQueryParam(key: string, value: any) {
- const encodedKey = encodeURI
|
tests/extended.test.ts > extended > 'allof-example':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'allof-example' 1` mismatched
- Expected
+ Received
@@ -8,277 +8,287 @@
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
export type Cat = Pet & {
- age?: number;
+ age?: number;
- hunts?: boolean;
+ hunts?: boolean;
};
export type Dog = Pet & {
- bark?: boolean;
+ bark?: boolean;
- breed: DogBreedEnum;
+ breed: DogBreedEnum;
};
export enum DogBreedEnum {
- Dingo = "Dingo",
+ Dingo = "Dingo",
- Husky = "Husky",
+ Husky = "Husky",
- Retriever = "Retriever",
+ Retriever = "Retriever",
- Shepherd = "Shepherd",
+ Shepherd = "Shepherd",
}
export interface Pet {
- pet_type: string;
+ pet_type: string;
}
export type PetsPartialUpdateData = any;
export type PetsPartialUpdatePayload = Cat | Dog;
export namespace Pets {
- /**
+ /**
- * No description
+ * No description
- * @name PetsPartialUpdate
+ * @name PetsPartialUpdate
- * @request PATCH:/pets
+ * @request PATCH:/pets
- */
+ */
- export namespace PetsPartialUpdate {
+ export namespace PetsPartialUpdate {
- export type RequestParams = {};
+ export type RequestParams = {};
- export type RequestQuery = {};
+ export type RequestQuery = {};
- export type RequestBody = PetsPartialUpdatePayload;
+ export type RequestBody = PetsPartialUpdatePayload;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = PetsPartialUpdateData;
+ export type ResponseBody = PetsPartialUpdateData;
- }
+ }
}
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public
|
tests/extended.test.ts > extended > 'anyof-example':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'anyof-example' 1` mismatched
- Expected
+ Received
@@ -8,271 +8,281 @@
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
export interface PetByAge {
- age: number;
+ age: number;
- nickname?: string;
+ nickname?: string;
}
export interface PetByType {
- hunts?: boolean;
+ hunts?: boolean;
- pet_type: PetByTypePetTypeEnum;
+ pet_type: PetByTypePetTypeEnum;
}
export enum PetByTypePetTypeEnum {
- Cat = "Cat",
+ Cat = "Cat",
- Dog = "Dog",
+ Dog = "Dog",
}
export type PetsPartialUpdateData = any;
export type PetsPartialUpdatePayload = PetByAge | PetByType;
export namespace Pets {
- /**
+ /**
- * No description
+ * No description
- * @name PetsPartialUpdate
+ * @name PetsPartialUpdate
- * @request PATCH:/pets
+ * @request PATCH:/pets
- */
+ */
- export namespace PetsPartialUpdate {
+ export namespace PetsPartialUpdate {
- export type RequestParams = {};
+ export type RequestParams = {};
- export type RequestQuery = {};
+ export type RequestQuery = {};
- export type RequestBody = PetsPartialUpdatePayload;
+ export type RequestBody = PetsPartialUpdatePayload;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = PetsPartialUpdateData;
+ export type ResponseBody = PetsPartialUpdateData;
- }
+ }
}
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private s
|
tests/extended.test.ts > extended > 'api-with-examples':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'api-with-examples' 1` mismatched
- Expected
+ Received
@@ -12,268 +12,278 @@
export type GetVersionDetailsv2Data = any;
export type ListVersionsv2Data = any;
export namespace V2 {
- /**
+ /**
- * No description
+ * No description
- * @name GetVersionDetailsv2
+ * @name GetVersionDetailsv2
- * @summary Show API version details
+ * @summary Show API version details
- * @request GET:/v2
+ * @request GET:/v2
- */
+ */
- export namespace GetVersionDetailsv2 {
+ export namespace GetVersionDetailsv2 {
- export type RequestParams = {};
+ export type RequestParams = {};
- export type RequestQuery = {};
+ export type RequestQuery = {};
- export type RequestBody = never;
+ export type RequestBody = never;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = GetVersionDetailsv2Data;
+ export type ResponseBody = GetVersionDetailsv2Data;
- }
+ }
}
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
+ private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
- private abortControllers = new Map<CancelToken, AbortController>();
+ private abortControllers = new Map<CancelToken, AbortController>();
- private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
+ private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
- private
|
tests/extended.test.ts > extended > 'callback-example':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'callback-example' 1` mismatched
- Expected
+ Received
@@ -9,278 +9,288 @@
* ---------------------------------------------------------------
*/
/** subscription information */
export interface StreamsCreateData {
- /**
+ /**
- * this unique identifier allows management of the subscription
+ * this unique identifier allows management of the subscription
- * @example "2531329f-fb09-4ef7-887e-84e648214436"
+ * @example "2531329f-fb09-4ef7-887e-84e648214436"
- */
+ */
- subscriptionId: string;
+ subscriptionId: string;
}
export interface StreamsCreateParams {
- /**
+ /**
- * the location where data will be sent. Must be network accessible
+ * the location where data will be sent. Must be network accessible
- * by the source server
+ * by the source server
- * @Format uri
+ * @Format uri
- * @example "https://tonys-server.com"
+ * @example "https://tonys-server.com"
- */
+ */
- callbackUrl: string;
+ callbackUrl: string;
}
export namespace Streams {
- /**
+ /**
- * @description subscribes a client to receive out-of-band data
+ * @description subscribes a client to receive out-of-band data
- * @name StreamsCreate
+ * @name StreamsCreate
- * @request POST:/streams
+ * @request POST:/streams
- */
+ */
- export namespace StreamsCreate {
+ export namespace StreamsCreate {
- export type RequestParams = {};
+ export type RequestParams = {};
- export type RequestQuery = {
+ export type RequestQuery = {
- /**
+ /**
- * the location where data will be sent. Must be network accessible
+ * the location where data will be sent. Must be network accessible
- * by the source server
+ * by the source server
- * @Format uri
+ * @Format uri
- * @example "https://tonys-server.com"
+ * @example "https://tonys-server.com"
- */
+ */
- callbackUrl: string;
+ callbackUrl: string;
- };
+ };
- export type RequestBody = never;
+ export type RequestBody = never;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = StreamsCreateData;
+ export type ResponseBody = StreamsCreateData;
- }
+ }
}
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+
|
tests/extended.test.ts > extended > 'components-responses':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'components-responses' 1` mismatched
- Expected
+ Received
@@ -9,263 +9,273 @@
* ---------------------------------------------------------------
*/
/** OK */
export interface Default {
- data?: string;
+ data?: string;
}
export namespace Api {
- /**
+ /**
- * No description
+ * No description
- * @name GetData
+ * @name GetData
- * @request GET:/api
+ * @request GET:/api
- */
+ */
- export namespace GetData {
+ export namespace GetData {
- export type RequestParams = {};
+ export type RequestParams = {};
- export type RequestQuery = {};
+ export type RequestQuery = {};
- export type RequestBody = never;
+ export type RequestBody = never;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = {
+ export type ResponseBody = {
- data?: string;
+ data?: string;
- };
+ };
- }
+ }
}
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
+ private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
- private abortControllers = new Map<CancelToken, AbortController>();
+ private abortControllers = new Map<CancelToken, AbortController>();
- private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
+ private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
- private baseApiParams: RequestParams = {
+ p
|
tests/extended.test.ts > extended > 'explode-param-3':
tests/extended.test.ts#L45
Error: Snapshot `extended > 'explode-param-3' 1` mismatched
- Expected
+ Received
@@ -10,320 +10,330 @@
*/
export type CreateFileData = Floop;
export interface CreateFilePayload {
- /** @default "" */
+ /** @default "" */
- meme: string;
+ meme: string;
- memeType?: string;
+ memeType?: string;
}
export interface Floop {
- info?: string;
+ info?: string;
}
export interface GetsParams {
- params?: QueryParams;
+ params?: QueryParams;
}
export interface QueryParams {
- /**
+ /**
- * Page size
+ * Page size
- * @Format int32
+ * @Format int32
- * @min 0
+ * @min 0
- */
+ */
- "page-size"?: number | null;
+ "page-size"?: number | null;
- /**
+ /**
- * Page number
+ * Page number
- * @Format int32
+ * @Format int32
- * @min 0
+ * @min 0
- */
+ */
- page?: number | null;
+ page?: number | null;
}
export namespace User {
- /**
+ /**
- * No description
+ * No description
- * @name CreateFile
+ * @name CreateFile
- * @summary Some summary
+ * @summary Some summary
- * @request POST:/{user}/foos
+ * @request POST:/{user}/foos
- */
+ */
- export namespace CreateFile {
+ export namespace CreateFile {
- export type RequestParams = {
+ export type RequestParams = {
- user: string;
+ user: string;
- };
+ };
- export type RequestQuery = {};
+ export type RequestQuery = {};
- export type RequestBody = CreateFilePayload;
+ export type RequestBody = CreateFilePayload;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = CreateFileData;
+ export type ResponseBody = CreateFileData;
- }
+ }
}
export namespace Something {
- /**
+ /**
- * No description
+ * No description
- * @name Gets
+ * @name Gets
- * @request GET:/something/
+ * @request GET:/something/
- */
+ */
- export namespace Gets {
+ export namespace Gets {
- export type RequestParams = {};
+ export type RequestParams = {};
- export type RequestQuery = {
+ export type RequestQuery = {
- params?: QueryParams;
+ params?: QueryParams;
- };
+ };
- export type RequestBody = never;
+ export type RequestBody = never;
- export type RequestHeaders = {};
+ export type RequestHeaders = {};
- export type ResponseBody = any;
+ export type ResponseBody = any;
- }
+ }
}
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWork
|
tests/simple.test.ts > simple > 'additional-properties':
tests/simple.test.ts#L38
Error: Snapshot `simple > 'additional-properties' 1` mismatched
- Expected
+ Received
@@ -8,224 +8,234 @@
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
export interface Message {
- code?: number;
+ code?: number;
- text?: string;
+ text?: string;
}
export type Messages = Record<string, Message>;
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
+ private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
- private abortControllers = new Map<CancelToken, AbortController>();
+ private abortControllers = new Map<CancelToken, AbortController>();
- private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
+ private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
- private baseApiParams: RequestParams = {
+ private baseApiParams: RequestParams = {
- credentials: "same-origin",
+ credentials: "same-origin",
- headers: {},
+ headers: {},
- redirect: "follow",
+ redirect: "follow",
- referrerPolicy: "no-referrer",
+ referrerPolicy: "no-referrer",
- };
+ };
- constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
+ constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
- Object.assign(this, apiConfig);
+ Object.assign(this, apiConfig);
- }
+ }
- public setSecurityData = (data: SecurityDataType | nu
|
tests/simple.test.ts > simple > 'additional-properties2':
tests/simple.test.ts#L38
Error: Snapshot `simple > 'additional-properties2' 1` mismatched
- Expected
+ Received
@@ -15,214 +15,224 @@
export type QueryParamsType = Record<string | number, any>;
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
export interface FullRequestParams extends Omit<RequestInit, "body"> {
- /** set parameter to `true` for call `securityWorker` for this request */
+ /** set parameter to `true` for call `securityWorker` for this request */
- secure?: boolean;
+ secure?: boolean;
- /** request path */
+ /** request path */
- path: string;
+ path: string;
- /** content type of request body */
+ /** content type of request body */
- type?: ContentType;
+ type?: ContentType;
- /** query params */
+ /** query params */
- query?: QueryParamsType;
+ query?: QueryParamsType;
- /** format of response (i.e. response.json() -> format: "json") */
+ /** format of response (i.e. response.json() -> format: "json") */
- format?: ResponseFormat;
+ format?: ResponseFormat;
- /** request body */
+ /** request body */
- body?: unknown;
+ body?: unknown;
- /** base url */
+ /** base url */
- baseUrl?: string;
+ baseUrl?: string;
- /** request cancellation token */
+ /** request cancellation token */
- cancelToken?: CancelToken;
+ cancelToken?: CancelToken;
}
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
export interface ApiConfig<SecurityDataType = unknown> {
- baseUrl?: string;
+ baseUrl?: string;
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
- customFetch?: typeof fetch;
+ customFetch?: typeof fetch;
}
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
- data: D;
+ data: D;
- error: E;
+ error: E;
}
type CancelToken = Symbol | string | number;
export enum ContentType {
- Json = "application/json",
+ Json = "application/json",
- FormData = "multipart/form-data",
+ FormData = "multipart/form-data",
- UrlEncoded = "application/x-www-form-urlencoded",
+ UrlEncoded = "application/x-www-form-urlencoded",
- Text = "text/plain",
+ Text = "text/plain",
}
export class HttpClient<SecurityDataType = unknown> {
- public baseUrl: string = "";
+ public baseUrl: string = "";
- private securityData: SecurityDataType | null = null;
+ private securityData: SecurityDataType | null = null;
- private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
+ private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
- private abortControllers = new Map<CancelToken, AbortController>();
+ private abortControllers = new Map<CancelToken, AbortController>();
- private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
+ private customFetch = (...fetchParams: Parameters<typeof fetch>) => fetch(...fetchParams);
- private baseApiParams: RequestParams = {
+ private baseApiParams: RequestParams = {
- credentials: "same-origin",
+ credentials: "same-origin",
- headers: {},
+ headers: {},
- redirect: "follow",
+ redirect: "follow",
- referrerPolicy: "no-referrer",
+ referrerPolicy: "no-referrer",
- };
+ };
- constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
+ constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
- Object.assign(this, apiConfig);
+ Object.assign(this, apiConfig);
- }
+ }
- public setSecurityData = (data: SecurityDataType | null) => {
+ public setSecurityData = (data: SecurityDataType | null) => {
- this.securityData = data;
+ this.securityData = data;
- };
+ };
- protected encodeQueryParam(key: string, value: any) {
+ protected encodeQueryParam(key: string, value: any) {
- const encodedKey = encodeURICo
|