fix: union when there are multiple request/response types defined #2751
Annotations
30 errors
|
tests/spec/modular/basic.test.ts > basic > modular:
tests/spec/modular/basic.test.ts#L39
Error: Snapshot `basic > modular > api 1` mismatched
- Expected
+ Received
@@ -8,11 +8,11 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
- import { ApiResponse, Currency, Order, Pet, User } from "./data-contracts";
+ import { ApiResponse, Order, Pet, User } from "./data-contracts";
import { ContentType, HttpClient, RequestParams } from "./http-client";
export class Api<
SecurityDataType = unknown,
> extends HttpClient<SecurityDataType> {
@@ -315,11 +315,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<Currency, void>({
+ this.request<string, void>({
path: `api/v1/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/modular/basic.test.ts:39:17
|
|
tests/spec/extractResponseError/basic.test.ts > basic > --extract-response-body:
tests/spec/extractResponseError/basic.test.ts#L32
Error: Snapshot `basic > --extract-response-body 1` mismatched
- Expected
+ Received
@@ -838,11 +838,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<CurrencyTTT, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/extractResponseError/basic.test.ts:32:21
|
|
tests/spec/extractRequestBody/basic.test.ts > basic > --extract-request-body:
tests/spec/extractRequestBody/basic.test.ts#L32
Error: Snapshot `basic > --extract-request-body 1` mismatched
- Expected
+ Received
@@ -141,10 +141,16 @@
* some description
* @pattern ^[A-Z]{3,3}$
*/
export type CurrencyTTT = string;
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayloadTTT = PetTTT;
+
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayloadTTT = PetTTT;
+
export interface SingleFormUrlEncodedRequestPayloadTTT {
/** @Format string */
param1: string;
param2: string;
}
@@ -458,11 +464,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: PetTTT, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayloadTTT, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -477,11 +483,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: PetTTT, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayloadTTT, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
@@ -825,11 +831,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<CurrencyTTT, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/extractRequestBody/basic.test.ts:32:21
|
|
tests/simple.test.ts > simple > 'another-example':
tests/simple.test.ts#L36
Error: Snapshot `simple > 'another-example' 1` mismatched
- Expected
+ Received
@@ -803,11 +803,11 @@
/** The user name for login */
username: string;
},
params: RequestParams = {},
) =>
- this.request<Currency, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/simple.test.ts:36:21
|
|
tests/simple.test.ts > simple > 'full-swagger-scheme':
tests/simple.test.ts#L36
Error: Snapshot `simple > 'full-swagger-scheme' 1` mismatched
- Expected
+ Received
@@ -11521,11 +11521,11 @@
* @tags markdown
* @name MarkdownRenderRaw
* @summary Render a Markdown document in raw mode
* @request POST:/markdown/raw
*/
- markdownRenderRaw: (data: WebhookConfigUrl, params: RequestParams = {}) =>
+ markdownRenderRaw: (data: string, params: RequestParams = {}) =>
this.request<WebhookConfigUrl, any>({
path: `/markdown/raw`,
method: "POST",
body: data,
type: ContentType.Text,
@@ -12114,11 +12114,12 @@
| BasicError
| {
documentation_url: string;
message: string;
}
- | (ValidationError | ValidationErrorSimple)
+ | ValidationError
+ | ValidationErrorSimple
>({
path: `/orgs/${org}`,
method: "PATCH",
body: data,
type: ContentType.Json,
@@ -15934,11 +15935,12 @@
params: RequestParams = {},
) =>
this.request<
ProjectCard,
| BasicError
- | (ValidationError | ValidationErrorSimple)
+ | ValidationError
+ | ValidationErrorSimple
| {
code?: string;
documentation_url?: string;
errors?: {
code?: string;
@@ -19442,11 +19444,11 @@
/** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */
until?: string;
},
params: RequestParams = {},
) =>
- this.request<Commit[], BasicError>({
+ this.request<Commit[], (BasicError | ScimError) | BasicError>({
path: `/repos/${owner}/${repo}/commits`,
method: "GET",
query: query,
format: "json",
...params,
@@ -19837,11 +19839,15 @@
/** The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */
ref?: string;
},
params: RequestParams = {},
) =>
- this.request<ContentTree, BasicError>({
+ this.request<
+ | ContentTree
+ | (ContentDirectory | ContentFile | ContentSymlink | ContentSubmodule),
+ BasicError
+ >({
path: `/repos/${owner}/${repo}/contents/${path}`,
method: "GET",
query: query,
format: "json",
...params,
@@ -20367,11 +20373,11 @@
*/
sort?: "newest" | "oldest" | "stargazers";
},
params: RequestParams = {},
) =>
- this.request<MinimalRepository[], BasicError>({
+ this.request<MinimalRepository[], BasicError | ScimError>({
path: `/repos/${owner}/${repo}/forks`,
method: "GET",
query: query,
format: "json",
...params,
@@ -20392,11 +20398,14 @@
/** Optional parameter to specify the organization name if forking into an organization. */
organization?: string;
},
params: RequestParams = {},
) =>
- this.request<Repository, BasicError | ValidationError>({
+ this.request<
+ Repository,
+ (BasicError | ScimError) | BasicError | ValidationError
+ >({
path: `/repos/${owner}/${repo}/forks`,
method: "POST",
body: data,
type: ContentType.Json,
format: "json",
@@ -23073,11 +23082,11 @@
path: "/" | "/docs";
};
},
params: RequestParams = {},
) =>
- this.request<void, BasicError | ValidationError>({
+ this.request<void, (BasicError | ScimError) | ValidationError>({
path: `/repos/${owner}/${repo}/pages`,
method: "PUT",
body: data,
type: ContentType.Json,
...params,
@@ -24747,11 +24756,11 @@
*/
per_page?: number;
},
params: RequestParams = {},
) =>
- this.request<SimpleUser[], ValidationError>({
+
|
|
tests/extended.test.ts > extended > 'petstore-swagger-io':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'petstore-swagger-io' 1` mismatched
- Expected
+ Received
@@ -8,10 +8,13 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayload = Pet;
+
export interface ApiResponse {
/** @Format int32 */
code?: number;
message?: string;
type?: string;
@@ -165,10 +168,13 @@
/** @Format int64 */
id?: number;
name?: string;
}
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayload = Pet;
+
export interface UpdatePetWithFormParams {
/**
* ID of pet that needs to be updated
* @Format int64
*/
@@ -230,11 +236,11 @@
* @secure
*/
export namespace AddPet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = AddPetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -331,11 +337,11 @@
* @secure
*/
export namespace UpdatePet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = UpdatePetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -874,11 +880,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: Pet, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -976,11 +982,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: Pet, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'authentiq':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'authentiq' 1` mismatched
- Expected
+ Received
@@ -189,17 +189,16 @@
export interface SignRequestParams {
/** test only mode, using test issuer */
test?: number;
}
- /** JWT */
- export interface SignRetrieveData {
+ export type SignRetrieveData = {
exp?: number;
field?: string;
/** base64safe encoded public signing key */
sub?: string;
- }
+ };
export type SignRetrieveError = Error;
export type SignRetrieveHeadData = any;
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'another-example':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'another-example' 1` mismatched
- Expected
+ Received
@@ -8,10 +8,13 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayload = Pet;
+
/** some description */
export interface Amount {
/** some description */
currency: Currency;
/**
@@ -252,10 +255,13 @@
/** @Format int64 */
id?: number;
name?: string;
}
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayload = Pet;
+
export interface UpdatePetWithFormParams {
/**
* ID of pet that needs to be updated
* @Format int64
*/
@@ -322,11 +328,11 @@
* @secure
*/
export namespace AddPet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = AddPetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -470,11 +476,11 @@
* @secure
*/
export namespace UpdatePet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = UpdatePetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -1009,11 +1015,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: Pet, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -1173,11 +1179,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: Pet, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'adafruit':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'adafruit' 1` mismatched
- Expected
+ Received
@@ -212,22 +212,22 @@
feed?: Feed;
group?: Group;
id?: string;
}
- export interface ChartDataData {
+ export type ChartDataData = {
/** The names of the columns returned as data. */
columns?: string[];
/** The actual chart data. */
data?: string[][];
feed?: {
id?: number;
key?: string;
name?: string;
};
parameters?: object;
- }
+ };
export interface ChartDataParams {
/**
* End time for filtering, returns records created before give time.
* @Format date-time
@@ -260,11 +260,11 @@
dashboardId: string;
/** a valid username string */
username: string;
}
- export interface CreateBlockPayload {
+ export type CreateBlockPayload = {
block_feeds?: {
feed_id?: string;
group_id?: string;
}[];
column?: number;
@@ -275,24 +275,24 @@
properties?: object;
row?: number;
size_x?: number;
size_y?: number;
visual_type?: string;
- }
+ };
export type CreateDashboardData = Dashboard;
export interface CreateDashboardParams {
/** a valid username string */
username: string;
}
- export interface CreateDashboardPayload {
+ export type CreateDashboardPayload = {
description?: string;
key?: string;
name?: string;
- }
+ };
export type CreateDataData = Data;
export interface CreateDataParams {
/** a valid feed key */
@@ -300,34 +300,34 @@
/** a valid username string */
username: string;
}
/** Data record including a `value` field (required) and optionally including: `lat`, `lon`, `ele` (latitude, longitude, and elevation values), and `created_at` (a date/time string). */
- export interface CreateDataPayload {
+ export type CreateDataPayload = {
/** @Format dateTime */
created_at?: string;
ele?: string;
epoch?: number;
lat?: string;
lon?: string;
value?: string;
- }
+ };
export type CreateFeedData = Feed;
export interface CreateFeedParams {
group_key?: string;
/** a valid username string */
username: string;
}
- export interface CreateFeedPayload {
+ export type CreateFeedPayload = {
description?: string;
key?: string;
license?: string;
name?: string;
- }
+ };
export type CreateGroupData = Group;
export type CreateGroupDataData = DataResponse[];
@@ -335,11 +335,11 @@
groupKey: string;
/** a valid username string */
username: string;
}
- export interface CreateGroupDataPayload {
+ export type CreateGroupDataPayload = {
/** Optional created_at timestamp which will be applied to all feed values created. */
created_at?: string;
/** An array of feed data records with `key` and `value` properties. */
feeds: {
key: string;
@@ -349,11 +349,11 @@
location?: {
ele?: number;
lat: number;
lon: number;
};
- }
+ };
export type CreateGroupFeedData = Feed;
export type CreateGroupFeedDataData = DataResponse;
@@ -364,48 +364,55 @@
/** a valid username string */
username: string;
}
/** Data record including a `value` field (required) and optionally including: `lat`, `lon`, `ele` (latitude, longitude, and elevation values), and `created_at` (a date/time string). */
- export interface CreateGroupFeedDataPayload {
+ export type CreateGroupFeedDataPayload = {
/** @Format dateTime */
created_at?: string;
ele?: string;
epoch?: number;
lat?: string;
lon?: string;
value?: string;
- }
+ };
export interface CreateGroupFeedParams {
groupKey: string;
/** a valid username string */
username: string;
}
- export interface CreateGroupFeedPayload {
+ export type CreateGroupFeedPayload = {
description?: string;
key?: string;
license?: string;
name?: string;
- }
+ };
export interface CreateGroupParams {
/** a valid username string */
username: string;
}
- export interface CreateGroupPayload {
+ export type CreateGroupPayload = {
description?: string;
key?: string;
name?: string;
- }
+ };
|
|
tests/extended.test.ts > extended > 'full-swagger-scheme':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'full-swagger-scheme' 1` mismatched
- Expected
+ Received
@@ -1261,11 +1261,13 @@
repo: string;
/** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */
since?: string;
}
- export type ActivityListReposStarredByAuthenticatedUserData = Repository[];
+ export type ActivityListReposStarredByAuthenticatedUserData =
+ | Repository[]
+ | StarredRepository[];
export interface ActivityListReposStarredByAuthenticatedUserParams {
/**
* One of `asc` (ascending) or `desc` (descending).
* @default "desc"
@@ -1304,11 +1306,13 @@
export enum ActivityListReposStarredByAuthenticatedUserParams1SortEnum {
Created = "created",
Updated = "updated",
}
- export type ActivityListReposStarredByUserData = Repository[];
+ export type ActivityListReposStarredByUserData =
+ | Repository[]
+ | StarredRepository[];
export interface ActivityListReposStarredByUserParams {
/**
* One of `asc` (ascending) or `desc` (descending).
* @default "desc"
@@ -1364,11 +1368,11 @@
*/
per_page?: number;
username: string;
}
- export type ActivityListStargazersForRepoData = SimpleUser[];
+ export type ActivityListStargazersForRepoData = SimpleUser[] | Stargazer[];
export interface ActivityListStargazersForRepoParams {
owner: string;
/**
* Page number of the results to fetch.
@@ -16100,11 +16104,13 @@
export interface ReposGetCommunityProfileMetricsParams {
owner: string;
repo: string;
}
- export type ReposGetContentData = ContentTree;
+ export type ReposGetContentData =
+ | ContentTree
+ | (ContentDirectory | ContentFile | ContentSymlink | ContentSubmodule);
export interface ReposGetContentParams {
owner: string;
/** path+ parameter */
path: string;
@@ -48030,11 +48036,14 @@
reposCreateFork: (
{ owner, repo, ...query }: ReposCreateForkParams,
data: ReposCreateForkPayload,
params: RequestParams = {},
) =>
- this.request<ReposCreateForkData, BasicError | ValidationError>({
+ this.request<
+ ReposCreateForkData,
+ (BasicError | ScimError) | BasicError | ValidationError
+ >({
path: `/repos/${owner}/${repo}/forks`,
method: "POST",
body: data,
type: ContentType.Json,
format: "json",
@@ -49542,17 +49551,19 @@
*/
reposListCommits: (
{ owner, repo, ...query }: ReposListCommitsParams,
params: RequestParams = {},
) =>
- this.request<ReposListCommitsData, BasicError>({
- path: `/repos/${owner}/${repo}/commits`,
- method: "GET",
- query: query,
- format: "json",
- ...params,
- }),
+ this.request<ReposListCommitsData, (BasicError | ScimError) | BasicError>(
+ {
+ path: `/repos/${owner}/${repo}/commits`,
+ method: "GET",
+ query: query,
+ format: "json",
+ ...params,
+ },
+ ),
/**
* @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.
*
* @tags repos
@@ -49667,11 +49678,11 @@
*/
reposListForks: (
{ owner, repo, ...query }: ReposListForksParams,
params: RequestParams = {},
) =>
- this.request<ReposListForksData, BasicError>({
+ this.request<ReposListForksData, BasicError | ScimError>({
path: `/repos/${owner}/${repo}/forks`,
method: "GET",
query: query,
format: "json",
...params,
@@ -50352,11 +50363,11 @@
data: ReposUpdateInformationAboutPagesSitePayload,
params: RequestParams = {},
) =>
this.reques
|
|
tests/spec/modular/basic.test.ts > basic > modular:
tests/spec/modular/basic.test.ts#L39
Error: Snapshot `basic > modular > api 1` mismatched
- Expected
+ Received
@@ -8,11 +8,11 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
- import { ApiResponse, Currency, Order, Pet, User } from "./data-contracts";
+ import { ApiResponse, Order, Pet, User } from "./data-contracts";
import { ContentType, HttpClient, RequestParams } from "./http-client";
export class Api<
SecurityDataType = unknown,
> extends HttpClient<SecurityDataType> {
@@ -315,11 +315,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<Currency, void>({
+ this.request<string, void>({
path: `api/v1/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/modular/basic.test.ts:39:17
|
|
tests/spec/extractResponseError/basic.test.ts > basic > --extract-response-body:
tests/spec/extractResponseError/basic.test.ts#L32
Error: Snapshot `basic > --extract-response-body 1` mismatched
- Expected
+ Received
@@ -838,11 +838,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<CurrencyTTT, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/extractResponseError/basic.test.ts:32:21
|
|
tests/spec/extractRequestBody/basic.test.ts > basic > --extract-request-body:
tests/spec/extractRequestBody/basic.test.ts#L32
Error: Snapshot `basic > --extract-request-body 1` mismatched
- Expected
+ Received
@@ -141,10 +141,16 @@
* some description
* @pattern ^[A-Z]{3,3}$
*/
export type CurrencyTTT = string;
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayloadTTT = PetTTT;
+
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayloadTTT = PetTTT;
+
export interface SingleFormUrlEncodedRequestPayloadTTT {
/** @Format string */
param1: string;
param2: string;
}
@@ -458,11 +464,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: PetTTT, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayloadTTT, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -477,11 +483,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: PetTTT, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayloadTTT, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
@@ -825,11 +831,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<CurrencyTTT, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/extractRequestBody/basic.test.ts:32:21
|
|
tests/simple.test.ts > simple > 'another-example':
tests/simple.test.ts#L36
Error: Snapshot `simple > 'another-example' 1` mismatched
- Expected
+ Received
@@ -803,11 +803,11 @@
/** The user name for login */
username: string;
},
params: RequestParams = {},
) =>
- this.request<Currency, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/simple.test.ts:36:21
|
|
tests/simple.test.ts > simple > 'full-swagger-scheme':
tests/simple.test.ts#L36
Error: Snapshot `simple > 'full-swagger-scheme' 1` mismatched
- Expected
+ Received
@@ -11521,11 +11521,11 @@
* @tags markdown
* @name MarkdownRenderRaw
* @summary Render a Markdown document in raw mode
* @request POST:/markdown/raw
*/
- markdownRenderRaw: (data: WebhookConfigUrl, params: RequestParams = {}) =>
+ markdownRenderRaw: (data: string, params: RequestParams = {}) =>
this.request<WebhookConfigUrl, any>({
path: `/markdown/raw`,
method: "POST",
body: data,
type: ContentType.Text,
@@ -12114,11 +12114,12 @@
| BasicError
| {
documentation_url: string;
message: string;
}
- | (ValidationError | ValidationErrorSimple)
+ | ValidationError
+ | ValidationErrorSimple
>({
path: `/orgs/${org}`,
method: "PATCH",
body: data,
type: ContentType.Json,
@@ -15934,11 +15935,12 @@
params: RequestParams = {},
) =>
this.request<
ProjectCard,
| BasicError
- | (ValidationError | ValidationErrorSimple)
+ | ValidationError
+ | ValidationErrorSimple
| {
code?: string;
documentation_url?: string;
errors?: {
code?: string;
@@ -19442,11 +19444,11 @@
/** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */
until?: string;
},
params: RequestParams = {},
) =>
- this.request<Commit[], BasicError>({
+ this.request<Commit[], (BasicError | ScimError) | BasicError>({
path: `/repos/${owner}/${repo}/commits`,
method: "GET",
query: query,
format: "json",
...params,
@@ -19837,11 +19839,15 @@
/** The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */
ref?: string;
},
params: RequestParams = {},
) =>
- this.request<ContentTree, BasicError>({
+ this.request<
+ | ContentTree
+ | (ContentDirectory | ContentFile | ContentSymlink | ContentSubmodule),
+ BasicError
+ >({
path: `/repos/${owner}/${repo}/contents/${path}`,
method: "GET",
query: query,
format: "json",
...params,
@@ -20367,11 +20373,11 @@
*/
sort?: "newest" | "oldest" | "stargazers";
},
params: RequestParams = {},
) =>
- this.request<MinimalRepository[], BasicError>({
+ this.request<MinimalRepository[], BasicError | ScimError>({
path: `/repos/${owner}/${repo}/forks`,
method: "GET",
query: query,
format: "json",
...params,
@@ -20392,11 +20398,14 @@
/** Optional parameter to specify the organization name if forking into an organization. */
organization?: string;
},
params: RequestParams = {},
) =>
- this.request<Repository, BasicError | ValidationError>({
+ this.request<
+ Repository,
+ (BasicError | ScimError) | BasicError | ValidationError
+ >({
path: `/repos/${owner}/${repo}/forks`,
method: "POST",
body: data,
type: ContentType.Json,
format: "json",
@@ -23073,11 +23082,11 @@
path: "/" | "/docs";
};
},
params: RequestParams = {},
) =>
- this.request<void, BasicError | ValidationError>({
+ this.request<void, (BasicError | ScimError) | ValidationError>({
path: `/repos/${owner}/${repo}/pages`,
method: "PUT",
body: data,
type: ContentType.Json,
...params,
@@ -24747,11 +24756,11 @@
*/
per_page?: number;
},
params: RequestParams = {},
) =>
- this.request<SimpleUser[], ValidationError>({
+
|
|
tests/extended.test.ts > extended > 'petstore-swagger-io':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'petstore-swagger-io' 1` mismatched
- Expected
+ Received
@@ -8,10 +8,13 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayload = Pet;
+
export interface ApiResponse {
/** @Format int32 */
code?: number;
message?: string;
type?: string;
@@ -165,10 +168,13 @@
/** @Format int64 */
id?: number;
name?: string;
}
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayload = Pet;
+
export interface UpdatePetWithFormParams {
/**
* ID of pet that needs to be updated
* @Format int64
*/
@@ -230,11 +236,11 @@
* @secure
*/
export namespace AddPet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = AddPetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -331,11 +337,11 @@
* @secure
*/
export namespace UpdatePet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = UpdatePetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -874,11 +880,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: Pet, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -976,11 +982,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: Pet, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'authentiq':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'authentiq' 1` mismatched
- Expected
+ Received
@@ -189,17 +189,16 @@
export interface SignRequestParams {
/** test only mode, using test issuer */
test?: number;
}
- /** JWT */
- export interface SignRetrieveData {
+ export type SignRetrieveData = {
exp?: number;
field?: string;
/** base64safe encoded public signing key */
sub?: string;
- }
+ };
export type SignRetrieveError = Error;
export type SignRetrieveHeadData = any;
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'another-example':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'another-example' 1` mismatched
- Expected
+ Received
@@ -8,10 +8,13 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayload = Pet;
+
/** some description */
export interface Amount {
/** some description */
currency: Currency;
/**
@@ -252,10 +255,13 @@
/** @Format int64 */
id?: number;
name?: string;
}
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayload = Pet;
+
export interface UpdatePetWithFormParams {
/**
* ID of pet that needs to be updated
* @Format int64
*/
@@ -322,11 +328,11 @@
* @secure
*/
export namespace AddPet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = AddPetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -470,11 +476,11 @@
* @secure
*/
export namespace UpdatePet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = UpdatePetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -1009,11 +1015,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: Pet, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -1173,11 +1179,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: Pet, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'adafruit':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'adafruit' 1` mismatched
- Expected
+ Received
@@ -212,22 +212,22 @@
feed?: Feed;
group?: Group;
id?: string;
}
- export interface ChartDataData {
+ export type ChartDataData = {
/** The names of the columns returned as data. */
columns?: string[];
/** The actual chart data. */
data?: string[][];
feed?: {
id?: number;
key?: string;
name?: string;
};
parameters?: object;
- }
+ };
export interface ChartDataParams {
/**
* End time for filtering, returns records created before give time.
* @Format date-time
@@ -260,11 +260,11 @@
dashboardId: string;
/** a valid username string */
username: string;
}
- export interface CreateBlockPayload {
+ export type CreateBlockPayload = {
block_feeds?: {
feed_id?: string;
group_id?: string;
}[];
column?: number;
@@ -275,24 +275,24 @@
properties?: object;
row?: number;
size_x?: number;
size_y?: number;
visual_type?: string;
- }
+ };
export type CreateDashboardData = Dashboard;
export interface CreateDashboardParams {
/** a valid username string */
username: string;
}
- export interface CreateDashboardPayload {
+ export type CreateDashboardPayload = {
description?: string;
key?: string;
name?: string;
- }
+ };
export type CreateDataData = Data;
export interface CreateDataParams {
/** a valid feed key */
@@ -300,34 +300,34 @@
/** a valid username string */
username: string;
}
/** Data record including a `value` field (required) and optionally including: `lat`, `lon`, `ele` (latitude, longitude, and elevation values), and `created_at` (a date/time string). */
- export interface CreateDataPayload {
+ export type CreateDataPayload = {
/** @Format dateTime */
created_at?: string;
ele?: string;
epoch?: number;
lat?: string;
lon?: string;
value?: string;
- }
+ };
export type CreateFeedData = Feed;
export interface CreateFeedParams {
group_key?: string;
/** a valid username string */
username: string;
}
- export interface CreateFeedPayload {
+ export type CreateFeedPayload = {
description?: string;
key?: string;
license?: string;
name?: string;
- }
+ };
export type CreateGroupData = Group;
export type CreateGroupDataData = DataResponse[];
@@ -335,11 +335,11 @@
groupKey: string;
/** a valid username string */
username: string;
}
- export interface CreateGroupDataPayload {
+ export type CreateGroupDataPayload = {
/** Optional created_at timestamp which will be applied to all feed values created. */
created_at?: string;
/** An array of feed data records with `key` and `value` properties. */
feeds: {
key: string;
@@ -349,11 +349,11 @@
location?: {
ele?: number;
lat: number;
lon: number;
};
- }
+ };
export type CreateGroupFeedData = Feed;
export type CreateGroupFeedDataData = DataResponse;
@@ -364,48 +364,55 @@
/** a valid username string */
username: string;
}
/** Data record including a `value` field (required) and optionally including: `lat`, `lon`, `ele` (latitude, longitude, and elevation values), and `created_at` (a date/time string). */
- export interface CreateGroupFeedDataPayload {
+ export type CreateGroupFeedDataPayload = {
/** @Format dateTime */
created_at?: string;
ele?: string;
epoch?: number;
lat?: string;
lon?: string;
value?: string;
- }
+ };
export interface CreateGroupFeedParams {
groupKey: string;
/** a valid username string */
username: string;
}
- export interface CreateGroupFeedPayload {
+ export type CreateGroupFeedPayload = {
description?: string;
key?: string;
license?: string;
name?: string;
- }
+ };
export interface CreateGroupParams {
/** a valid username string */
username: string;
}
- export interface CreateGroupPayload {
+ export type CreateGroupPayload = {
description?: string;
key?: string;
name?: string;
- }
+ };
|
|
tests/extended.test.ts > extended > 'full-swagger-scheme':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'full-swagger-scheme' 1` mismatched
- Expected
+ Received
@@ -1261,11 +1261,13 @@
repo: string;
/** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */
since?: string;
}
- export type ActivityListReposStarredByAuthenticatedUserData = Repository[];
+ export type ActivityListReposStarredByAuthenticatedUserData =
+ | Repository[]
+ | StarredRepository[];
export interface ActivityListReposStarredByAuthenticatedUserParams {
/**
* One of `asc` (ascending) or `desc` (descending).
* @default "desc"
@@ -1304,11 +1306,13 @@
export enum ActivityListReposStarredByAuthenticatedUserParams1SortEnum {
Created = "created",
Updated = "updated",
}
- export type ActivityListReposStarredByUserData = Repository[];
+ export type ActivityListReposStarredByUserData =
+ | Repository[]
+ | StarredRepository[];
export interface ActivityListReposStarredByUserParams {
/**
* One of `asc` (ascending) or `desc` (descending).
* @default "desc"
@@ -1364,11 +1368,11 @@
*/
per_page?: number;
username: string;
}
- export type ActivityListStargazersForRepoData = SimpleUser[];
+ export type ActivityListStargazersForRepoData = SimpleUser[] | Stargazer[];
export interface ActivityListStargazersForRepoParams {
owner: string;
/**
* Page number of the results to fetch.
@@ -16100,11 +16104,13 @@
export interface ReposGetCommunityProfileMetricsParams {
owner: string;
repo: string;
}
- export type ReposGetContentData = ContentTree;
+ export type ReposGetContentData =
+ | ContentTree
+ | (ContentDirectory | ContentFile | ContentSymlink | ContentSubmodule);
export interface ReposGetContentParams {
owner: string;
/** path+ parameter */
path: string;
@@ -48030,11 +48036,14 @@
reposCreateFork: (
{ owner, repo, ...query }: ReposCreateForkParams,
data: ReposCreateForkPayload,
params: RequestParams = {},
) =>
- this.request<ReposCreateForkData, BasicError | ValidationError>({
+ this.request<
+ ReposCreateForkData,
+ (BasicError | ScimError) | BasicError | ValidationError
+ >({
path: `/repos/${owner}/${repo}/forks`,
method: "POST",
body: data,
type: ContentType.Json,
format: "json",
@@ -49542,17 +49551,19 @@
*/
reposListCommits: (
{ owner, repo, ...query }: ReposListCommitsParams,
params: RequestParams = {},
) =>
- this.request<ReposListCommitsData, BasicError>({
- path: `/repos/${owner}/${repo}/commits`,
- method: "GET",
- query: query,
- format: "json",
- ...params,
- }),
+ this.request<ReposListCommitsData, (BasicError | ScimError) | BasicError>(
+ {
+ path: `/repos/${owner}/${repo}/commits`,
+ method: "GET",
+ query: query,
+ format: "json",
+ ...params,
+ },
+ ),
/**
* @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.
*
* @tags repos
@@ -49667,11 +49678,11 @@
*/
reposListForks: (
{ owner, repo, ...query }: ReposListForksParams,
params: RequestParams = {},
) =>
- this.request<ReposListForksData, BasicError>({
+ this.request<ReposListForksData, BasicError | ScimError>({
path: `/repos/${owner}/${repo}/forks`,
method: "GET",
query: query,
format: "json",
...params,
@@ -50352,11 +50363,11 @@
data: ReposUpdateInformationAboutPagesSitePayload,
params: RequestParams = {},
) =>
this.reques
|
|
tests/spec/modular/basic.test.ts > basic > modular:
tests/spec/modular/basic.test.ts#L39
Error: Snapshot `basic > modular > api 1` mismatched
- Expected
+ Received
@@ -8,11 +8,11 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
- import { ApiResponse, Currency, Order, Pet, User } from "./data-contracts";
+ import { ApiResponse, Order, Pet, User } from "./data-contracts";
import { ContentType, HttpClient, RequestParams } from "./http-client";
export class Api<
SecurityDataType = unknown,
> extends HttpClient<SecurityDataType> {
@@ -315,11 +315,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<Currency, void>({
+ this.request<string, void>({
path: `api/v1/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/modular/basic.test.ts:39:17
|
|
tests/spec/extractResponseError/basic.test.ts > basic > --extract-response-body:
tests/spec/extractResponseError/basic.test.ts#L32
Error: Snapshot `basic > --extract-response-body 1` mismatched
- Expected
+ Received
@@ -838,11 +838,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<CurrencyTTT, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/extractResponseError/basic.test.ts:32:21
|
|
tests/spec/extractRequestBody/basic.test.ts > basic > --extract-request-body:
tests/spec/extractRequestBody/basic.test.ts#L32
Error: Snapshot `basic > --extract-request-body 1` mismatched
- Expected
+ Received
@@ -141,10 +141,16 @@
* some description
* @pattern ^[A-Z]{3,3}$
*/
export type CurrencyTTT = string;
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayloadTTT = PetTTT;
+
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayloadTTT = PetTTT;
+
export interface SingleFormUrlEncodedRequestPayloadTTT {
/** @Format string */
param1: string;
param2: string;
}
@@ -458,11 +464,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: PetTTT, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayloadTTT, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -477,11 +483,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: PetTTT, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayloadTTT, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
@@ -825,11 +831,11 @@
/** The password for login in clear text */
password: string;
},
params: RequestParams = {},
) =>
- this.request<CurrencyTTT, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/spec/extractRequestBody/basic.test.ts:32:21
|
|
tests/simple.test.ts > simple > 'another-example':
tests/simple.test.ts#L36
Error: Snapshot `simple > 'another-example' 1` mismatched
- Expected
+ Received
@@ -803,11 +803,11 @@
/** The user name for login */
username: string;
},
params: RequestParams = {},
) =>
- this.request<Currency, void>({
+ this.request<string, void>({
path: `/user/login`,
method: "GET",
query: query,
format: "json",
...params,
❯ tests/simple.test.ts:36:21
|
|
tests/simple.test.ts > simple > 'full-swagger-scheme':
tests/simple.test.ts#L36
Error: Snapshot `simple > 'full-swagger-scheme' 1` mismatched
- Expected
+ Received
@@ -11521,11 +11521,11 @@
* @tags markdown
* @name MarkdownRenderRaw
* @summary Render a Markdown document in raw mode
* @request POST:/markdown/raw
*/
- markdownRenderRaw: (data: WebhookConfigUrl, params: RequestParams = {}) =>
+ markdownRenderRaw: (data: string, params: RequestParams = {}) =>
this.request<WebhookConfigUrl, any>({
path: `/markdown/raw`,
method: "POST",
body: data,
type: ContentType.Text,
@@ -12114,11 +12114,12 @@
| BasicError
| {
documentation_url: string;
message: string;
}
- | (ValidationError | ValidationErrorSimple)
+ | ValidationError
+ | ValidationErrorSimple
>({
path: `/orgs/${org}`,
method: "PATCH",
body: data,
type: ContentType.Json,
@@ -15934,11 +15935,12 @@
params: RequestParams = {},
) =>
this.request<
ProjectCard,
| BasicError
- | (ValidationError | ValidationErrorSimple)
+ | ValidationError
+ | ValidationErrorSimple
| {
code?: string;
documentation_url?: string;
errors?: {
code?: string;
@@ -19442,11 +19444,11 @@
/** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */
until?: string;
},
params: RequestParams = {},
) =>
- this.request<Commit[], BasicError>({
+ this.request<Commit[], (BasicError | ScimError) | BasicError>({
path: `/repos/${owner}/${repo}/commits`,
method: "GET",
query: query,
format: "json",
...params,
@@ -19837,11 +19839,15 @@
/** The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */
ref?: string;
},
params: RequestParams = {},
) =>
- this.request<ContentTree, BasicError>({
+ this.request<
+ | ContentTree
+ | (ContentDirectory | ContentFile | ContentSymlink | ContentSubmodule),
+ BasicError
+ >({
path: `/repos/${owner}/${repo}/contents/${path}`,
method: "GET",
query: query,
format: "json",
...params,
@@ -20367,11 +20373,11 @@
*/
sort?: "newest" | "oldest" | "stargazers";
},
params: RequestParams = {},
) =>
- this.request<MinimalRepository[], BasicError>({
+ this.request<MinimalRepository[], BasicError | ScimError>({
path: `/repos/${owner}/${repo}/forks`,
method: "GET",
query: query,
format: "json",
...params,
@@ -20392,11 +20398,14 @@
/** Optional parameter to specify the organization name if forking into an organization. */
organization?: string;
},
params: RequestParams = {},
) =>
- this.request<Repository, BasicError | ValidationError>({
+ this.request<
+ Repository,
+ (BasicError | ScimError) | BasicError | ValidationError
+ >({
path: `/repos/${owner}/${repo}/forks`,
method: "POST",
body: data,
type: ContentType.Json,
format: "json",
@@ -23073,11 +23082,11 @@
path: "/" | "/docs";
};
},
params: RequestParams = {},
) =>
- this.request<void, BasicError | ValidationError>({
+ this.request<void, (BasicError | ScimError) | ValidationError>({
path: `/repos/${owner}/${repo}/pages`,
method: "PUT",
body: data,
type: ContentType.Json,
...params,
@@ -24747,11 +24756,11 @@
*/
per_page?: number;
},
params: RequestParams = {},
) =>
- this.request<SimpleUser[], ValidationError>({
+
|
|
tests/extended.test.ts > extended > 'petstore-swagger-io':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'petstore-swagger-io' 1` mismatched
- Expected
+ Received
@@ -8,10 +8,13 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayload = Pet;
+
export interface ApiResponse {
/** @Format int32 */
code?: number;
message?: string;
type?: string;
@@ -165,10 +168,13 @@
/** @Format int64 */
id?: number;
name?: string;
}
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayload = Pet;
+
export interface UpdatePetWithFormParams {
/**
* ID of pet that needs to be updated
* @Format int64
*/
@@ -230,11 +236,11 @@
* @secure
*/
export namespace AddPet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = AddPetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -331,11 +337,11 @@
* @secure
*/
export namespace UpdatePet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = UpdatePetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -874,11 +880,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: Pet, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -976,11 +982,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: Pet, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'authentiq':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'authentiq' 1` mismatched
- Expected
+ Received
@@ -189,17 +189,16 @@
export interface SignRequestParams {
/** test only mode, using test issuer */
test?: number;
}
- /** JWT */
- export interface SignRetrieveData {
+ export type SignRetrieveData = {
exp?: number;
field?: string;
/** base64safe encoded public signing key */
sub?: string;
- }
+ };
export type SignRetrieveError = Error;
export type SignRetrieveHeadData = any;
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'another-example':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'another-example' 1` mismatched
- Expected
+ Received
@@ -8,10 +8,13 @@
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
+ /** Pet object that needs to be added to the store */
+ export type AddPetPayload = Pet;
+
/** some description */
export interface Amount {
/** some description */
currency: Currency;
/**
@@ -252,10 +255,13 @@
/** @Format int64 */
id?: number;
name?: string;
}
+ /** Pet object that needs to be added to the store */
+ export type UpdatePetPayload = Pet;
+
export interface UpdatePetWithFormParams {
/**
* ID of pet that needs to be updated
* @Format int64
*/
@@ -322,11 +328,11 @@
* @secure
*/
export namespace AddPet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = AddPetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -470,11 +476,11 @@
* @secure
*/
export namespace UpdatePet {
export type RequestParams = {};
export type RequestQuery = {};
- export type RequestBody = Pet;
+ export type RequestBody = UpdatePetPayload;
export type RequestHeaders = {};
export type ResponseBody = any;
}
/**
@@ -1009,11 +1015,11 @@
* @name AddPet
* @summary Add a new pet to the store
* @request POST:/pet
* @secure
*/
- addPet: (body: Pet, params: RequestParams = {}) =>
+ addPet: (body: AddPetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "POST",
body: body,
secure: true,
@@ -1173,11 +1179,11 @@
* @name UpdatePet
* @summary Update an existing pet
* @request PUT:/pet
* @secure
*/
- updatePet: (body: Pet, params: RequestParams = {}) =>
+ updatePet: (body: UpdatePetPayload, params: RequestParams = {}) =>
this.request<any, void>({
path: `/pet`,
method: "PUT",
body: body,
secure: true,
❯ tests/extended.test.ts:43:21
|
|
tests/extended.test.ts > extended > 'adafruit':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'adafruit' 1` mismatched
- Expected
+ Received
@@ -212,22 +212,22 @@
feed?: Feed;
group?: Group;
id?: string;
}
- export interface ChartDataData {
+ export type ChartDataData = {
/** The names of the columns returned as data. */
columns?: string[];
/** The actual chart data. */
data?: string[][];
feed?: {
id?: number;
key?: string;
name?: string;
};
parameters?: object;
- }
+ };
export interface ChartDataParams {
/**
* End time for filtering, returns records created before give time.
* @Format date-time
@@ -260,11 +260,11 @@
dashboardId: string;
/** a valid username string */
username: string;
}
- export interface CreateBlockPayload {
+ export type CreateBlockPayload = {
block_feeds?: {
feed_id?: string;
group_id?: string;
}[];
column?: number;
@@ -275,24 +275,24 @@
properties?: object;
row?: number;
size_x?: number;
size_y?: number;
visual_type?: string;
- }
+ };
export type CreateDashboardData = Dashboard;
export interface CreateDashboardParams {
/** a valid username string */
username: string;
}
- export interface CreateDashboardPayload {
+ export type CreateDashboardPayload = {
description?: string;
key?: string;
name?: string;
- }
+ };
export type CreateDataData = Data;
export interface CreateDataParams {
/** a valid feed key */
@@ -300,34 +300,34 @@
/** a valid username string */
username: string;
}
/** Data record including a `value` field (required) and optionally including: `lat`, `lon`, `ele` (latitude, longitude, and elevation values), and `created_at` (a date/time string). */
- export interface CreateDataPayload {
+ export type CreateDataPayload = {
/** @Format dateTime */
created_at?: string;
ele?: string;
epoch?: number;
lat?: string;
lon?: string;
value?: string;
- }
+ };
export type CreateFeedData = Feed;
export interface CreateFeedParams {
group_key?: string;
/** a valid username string */
username: string;
}
- export interface CreateFeedPayload {
+ export type CreateFeedPayload = {
description?: string;
key?: string;
license?: string;
name?: string;
- }
+ };
export type CreateGroupData = Group;
export type CreateGroupDataData = DataResponse[];
@@ -335,11 +335,11 @@
groupKey: string;
/** a valid username string */
username: string;
}
- export interface CreateGroupDataPayload {
+ export type CreateGroupDataPayload = {
/** Optional created_at timestamp which will be applied to all feed values created. */
created_at?: string;
/** An array of feed data records with `key` and `value` properties. */
feeds: {
key: string;
@@ -349,11 +349,11 @@
location?: {
ele?: number;
lat: number;
lon: number;
};
- }
+ };
export type CreateGroupFeedData = Feed;
export type CreateGroupFeedDataData = DataResponse;
@@ -364,48 +364,55 @@
/** a valid username string */
username: string;
}
/** Data record including a `value` field (required) and optionally including: `lat`, `lon`, `ele` (latitude, longitude, and elevation values), and `created_at` (a date/time string). */
- export interface CreateGroupFeedDataPayload {
+ export type CreateGroupFeedDataPayload = {
/** @Format dateTime */
created_at?: string;
ele?: string;
epoch?: number;
lat?: string;
lon?: string;
value?: string;
- }
+ };
export interface CreateGroupFeedParams {
groupKey: string;
/** a valid username string */
username: string;
}
- export interface CreateGroupFeedPayload {
+ export type CreateGroupFeedPayload = {
description?: string;
key?: string;
license?: string;
name?: string;
- }
+ };
export interface CreateGroupParams {
/** a valid username string */
username: string;
}
- export interface CreateGroupPayload {
+ export type CreateGroupPayload = {
description?: string;
key?: string;
name?: string;
- }
+ };
|
|
tests/extended.test.ts > extended > 'full-swagger-scheme':
tests/extended.test.ts#L43
Error: Snapshot `extended > 'full-swagger-scheme' 1` mismatched
- Expected
+ Received
@@ -1261,11 +1261,13 @@
repo: string;
/** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */
since?: string;
}
- export type ActivityListReposStarredByAuthenticatedUserData = Repository[];
+ export type ActivityListReposStarredByAuthenticatedUserData =
+ | Repository[]
+ | StarredRepository[];
export interface ActivityListReposStarredByAuthenticatedUserParams {
/**
* One of `asc` (ascending) or `desc` (descending).
* @default "desc"
@@ -1304,11 +1306,13 @@
export enum ActivityListReposStarredByAuthenticatedUserParams1SortEnum {
Created = "created",
Updated = "updated",
}
- export type ActivityListReposStarredByUserData = Repository[];
+ export type ActivityListReposStarredByUserData =
+ | Repository[]
+ | StarredRepository[];
export interface ActivityListReposStarredByUserParams {
/**
* One of `asc` (ascending) or `desc` (descending).
* @default "desc"
@@ -1364,11 +1368,11 @@
*/
per_page?: number;
username: string;
}
- export type ActivityListStargazersForRepoData = SimpleUser[];
+ export type ActivityListStargazersForRepoData = SimpleUser[] | Stargazer[];
export interface ActivityListStargazersForRepoParams {
owner: string;
/**
* Page number of the results to fetch.
@@ -16100,11 +16104,13 @@
export interface ReposGetCommunityProfileMetricsParams {
owner: string;
repo: string;
}
- export type ReposGetContentData = ContentTree;
+ export type ReposGetContentData =
+ | ContentTree
+ | (ContentDirectory | ContentFile | ContentSymlink | ContentSubmodule);
export interface ReposGetContentParams {
owner: string;
/** path+ parameter */
path: string;
@@ -48030,11 +48036,14 @@
reposCreateFork: (
{ owner, repo, ...query }: ReposCreateForkParams,
data: ReposCreateForkPayload,
params: RequestParams = {},
) =>
- this.request<ReposCreateForkData, BasicError | ValidationError>({
+ this.request<
+ ReposCreateForkData,
+ (BasicError | ScimError) | BasicError | ValidationError
+ >({
path: `/repos/${owner}/${repo}/forks`,
method: "POST",
body: data,
type: ContentType.Json,
format: "json",
@@ -49542,17 +49551,19 @@
*/
reposListCommits: (
{ owner, repo, ...query }: ReposListCommitsParams,
params: RequestParams = {},
) =>
- this.request<ReposListCommitsData, BasicError>({
- path: `/repos/${owner}/${repo}/commits`,
- method: "GET",
- query: query,
- format: "json",
- ...params,
- }),
+ this.request<ReposListCommitsData, (BasicError | ScimError) | BasicError>(
+ {
+ path: `/repos/${owner}/${repo}/commits`,
+ method: "GET",
+ query: query,
+ format: "json",
+ ...params,
+ },
+ ),
/**
* @description Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.
*
* @tags repos
@@ -49667,11 +49678,11 @@
*/
reposListForks: (
{ owner, repo, ...query }: ReposListForksParams,
params: RequestParams = {},
) =>
- this.request<ReposListForksData, BasicError>({
+ this.request<ReposListForksData, BasicError | ScimError>({
path: `/repos/${owner}/${repo}/forks`,
method: "GET",
query: query,
format: "json",
...params,
@@ -50352,11 +50363,11 @@
data: ReposUpdateInformationAboutPagesSitePayload,
params: RequestParams = {},
) =>
this.reques
|