fix: AllOf when used in responses #66
Annotations
10 errors and 1 warning
Test:
packages/swagger-faker/src/OperationGenerator.test.tsx#L43
Error: Snapshot `OperationGenerator > [GET] should generate 1` mismatched
- Expected
+ Received
@@ -12,28 +12,12 @@
],
"path": "@faker-js/faker",
"root": undefined,
},
{
- "isTypeOnly": false,
- "name": [
- "Pets",
- ],
- "path": "Pets",
- "root": "listPets.ts",
- },
- {
"isTypeOnly": true,
"name": [
- "ListPetsError",
- ],
- "path": "ListPets",
- "root": "listPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
"ListPetsQueryParams",
],
"path": "ListPets",
"root": "listPets.ts",
},
@@ -64,17 +48,10 @@
"source": "export function ListPetsQueryParams(override: NonNullable<Partial<ListPetsQueryParams>> = {}): NonNullable<ListPetsQueryParams> {
return {
...{ "limit": faker.string.alpha() },
...override
};
- }
- /**
- * @description unexpected error
- */
-
- export function ListPetsError(override?: NonNullable<Partial<ListPetsError>>): NonNullable<ListPetsError> {
- return Pets(override);
}
/**
* @description A paged array of pets
*/
❯ packages/swagger-faker/src/OperationGenerator.test.tsx:43:19
|
Test:
packages/swagger-faker/src/OperationGenerator.test.tsx#L74
Error: Snapshot `OperationGenerator > [GET] should generate with seed `[222]` 1` mismatched
- Expected
+ Received
@@ -12,26 +12,10 @@
],
"path": "@faker-js/faker",
"root": undefined,
},
{
- "isTypeOnly": false,
- "name": [
- "Pets",
- ],
- "path": "Pets",
- "root": "listPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
- "ListPetsError",
- ],
- "path": "ListPets",
- "root": "listPets.ts",
- },
- {
"isTypeOnly": true,
"name": [
"ListPetsQueryParams",
],
"path": "ListPets",
@@ -65,18 +49,10 @@
faker.seed([222]);
return {
...{ "limit": faker.string.alpha() },
...override
};
- }
- /**
- * @description unexpected error
- */
-
- export function ListPetsError(override?: NonNullable<Partial<ListPetsError>>): NonNullable<ListPetsError> {
- faker.seed([222]);
- return Pets(override);
}
/**
* @description A paged array of pets
*/
❯ packages/swagger-faker/src/OperationGenerator.test.tsx:74:19
|
Test:
packages/swagger-faker/src/OperationGenerator.test.tsx#L102
Error: Snapshot `OperationGenerator > [POST] should generate 1` mismatched
- Expected
+ Received
@@ -14,26 +14,10 @@
"root": undefined,
},
{
"isTypeOnly": true,
"name": [
- "CreatePets201",
- ],
- "path": "CreatePets",
- "root": "createPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
- "CreatePetsError",
- ],
- "path": "CreatePets",
- "root": "createPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
"CreatePetsMutationRequest",
],
"path": "CreatePets",
"root": "createPets.ts",
},
@@ -51,26 +35,11 @@
"pluginKey": undefined,
"tag": "pets",
},
"override": undefined,
"path": "createPets.ts",
- "source": "/**
- * @description Null response
- */
-
- export function CreatePets201(override?: NonNullable<Partial<CreatePets201>>): NonNullable<CreatePets201> {
- return undefined;
- }
- /**
- * @description unexpected error
- */
-
- export function CreatePetsError(override?: NonNullable<Partial<CreatePetsError>>): NonNullable<CreatePetsError> {
- return undefined;
- }
-
- export function CreatePetsMutationRequest(override: NonNullable<Partial<CreatePetsMutationRequest>> = {}): NonNullable<CreatePetsMutationRequest> {
+ "source": "export function CreatePetsMutationRequest(override: NonNullable<Partial<CreatePetsMutationRequest>> = {}): NonNullable<CreatePetsMutationRequest> {
return {
...{ "name": faker.string.alpha(), "tag": faker.string.alpha() },
...override
};
}
❯ packages/swagger-faker/src/OperationGenerator.test.tsx:102:19
|
Test:
packages/swagger-ts/src/OperationGenerator.test.tsx#L45
Error: Snapshot `OperationGenerator > [GET] /pets with optionalType `questionToken` 1` mismatched
- Expected
+ Received
@@ -11,18 +11,10 @@
"Pets",
],
"path": "Pets",
"root": "listPets.ts",
},
- {
- "isTypeOnly": true,
- "name": [
- "Pets",
- ],
- "path": "Pets",
- "root": "listPets.ts",
- },
],
"meta": {
"name": "listPets",
"pluginKey": undefined,
"tag": "pets",
@@ -36,21 +28,15 @@
*/
limit?: string;
} | undefined;
/**
- * @description unexpected error
- */
- export type ListPetsError = Pets;
-
- /**
* @description A paged array of pets
*/
export type ListPetsQueryResponse = Pets;
export type ListPetsQuery = {
Response: ListPetsQueryResponse;
QueryParams: ListPetsQueryParams;
- Errors: ListPetsError;
};
",
},
]
❯ packages/swagger-ts/src/OperationGenerator.test.tsx:45:19
|
Test:
packages/swagger-ts/src/OperationGenerator.test.tsx#L75
Error: Snapshot `OperationGenerator > [POST] /pets 201 1` mismatched
- Expected
+ Received
@@ -19,42 +19,10 @@
"ErrorCode",
],
"path": "ErrorCode",
"root": "createPets.ts",
},
- {
- "isTypeOnly": true,
- "name": [
- "Error",
- ],
- "path": "Error",
- "root": "createPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
- "ErrorCode",
- ],
- "path": "ErrorCode",
- "root": "createPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
- "Error",
- ],
- "path": "Error",
- "root": "createPets.ts",
- },
- {
- "isTypeOnly": true,
- "name": [
- "ErrorCode",
- ],
- "path": "ErrorCode",
- "root": "createPets.ts",
- },
],
"meta": {
"name": "createPets",
"pluginKey": undefined,
"tag": "pets",
@@ -73,30 +41,15 @@
};
/**
* @description Null response
*/
- export type CreatePets201 = (Error & {
- name?: ErrorCode;
- });
-
- /**
- * @description unexpected error
- */
- export type CreatePetsError = (Error & {
- name?: ErrorCode;
- });
-
- /**
- * @description Null response
- */
export type CreatePetsMutationResponse = (Error & {
name?: ErrorCode;
});
export type CreatePetsMutation = {
Response: CreatePetsMutationResponse;
Request: CreatePetsMutationRequest;
- Errors: CreatePets201 | CreatePetsError;
};
",
},
]
❯ packages/swagger-ts/src/OperationGenerator.test.tsx:75:19
|
Test:
packages/swagger-zod/src/OperationGenerator.test.tsx#L45
Error: Snapshot `OperationGenerator > [GET] should generate 1` mismatched
- Expected
+ Received
@@ -19,32 +19,19 @@
"Pets",
],
"path": "Pets",
"root": "listPets.ts",
},
- {
- "isTypeOnly": false,
- "name": [
- "Pets",
- ],
- "path": "Pets",
- "root": "listPets.ts",
- },
],
"meta": {
"name": "listPets",
"pluginKey": undefined,
"tag": "pets",
},
"override": undefined,
"path": "listPets.ts",
"source": "export const ListPetsQueryParams = z.object({ "limit": z.string().describe(`How many items to return at one time (max 100)`).optional() }).optional();
-
- /**
- * @description unexpected error
- */
- export const ListPetsError = z.lazy(() => Pets);
/**
* @description A paged array of pets
*/
export const ListPetsQueryResponse = z.lazy(() => Pets);
❯ packages/swagger-zod/src/OperationGenerator.test.tsx:45:19
|
Test:
packages/swagger-zod/src/OperationGenerator.test.tsx#L75
Error: Snapshot `OperationGenerator > [POST] should generate 1` mismatched
- Expected
+ Received
@@ -19,19 +19,10 @@
"pluginKey": undefined,
"tag": "pets",
},
"override": undefined,
"path": "createPets.ts",
- "source": "/**
- * @description Null response
- */
- export const CreatePets201 = z.any();
-
- /**
- * @description unexpected error
- */
- export const CreatePetsError = z.any();
- export const CreatePetsMutationRequest = z.object({ "name": z.string(), "tag": z.string() });
+ "source": "export const CreatePetsMutationRequest = z.object({ "name": z.string(), "tag": z.string() });
export const CreatePetsMutationResponse = z.any();
",
},
]
❯ packages/swagger-zod/src/OperationGenerator.test.tsx:75:19
|
Test:
packages/swagger-faker/src/components/Mutation.test.tsx#L64
Error: Snapshot `<Mutation/> > pets 1` mismatched
- Expected
+ Received
@@ -1,22 +1,6 @@
- "/**
- * @description Null response
- */
-
- export function createCreatePets201(override?: NonNullable<Partial<CreatePets201>>): NonNullable<CreatePets201> {
- return undefined
- }
-
- /**
- * @description unexpected error
- */
-
- export function createCreatePetsError(override?: NonNullable<Partial<CreatePetsError>>): NonNullable<CreatePetsError> {
- return undefined
- }
-
- export function createCreatePetsMutationRequest(override: NonNullable<Partial<CreatePetsMutationRequest>> = {}): NonNullable<CreatePetsMutationRequest> {
+ "export function createCreatePetsMutationRequest(override: NonNullable<Partial<CreatePetsMutationRequest>> = {}): NonNullable<CreatePetsMutationRequest> {
return {
...{ name: faker.string.alpha(), tag: faker.string.alpha() },
...override,
}
}
❯ packages/swagger-faker/src/components/Mutation.test.tsx:64:20
|
Test:
packages/swagger-faker/src/components/Query.test.tsx#L64
Error: Snapshot `<Query/> > showPetById 1` mismatched
- Expected
+ Received
@@ -4,18 +4,10 @@
...override,
}
}
/**
- * @description unexpected error
- */
-
- export function createShowPetByIdError(override?: NonNullable<Partial<ShowPetByIdError>>): NonNullable<ShowPetByIdError> {
- return createPet(override)
- }
-
- /**
* @description Expected response to a valid request
*/
export function createShowPetByIdQueryResponse(override?: NonNullable<Partial<ShowPetByIdQueryResponse>>): NonNullable<ShowPetByIdQueryResponse> {
return createPet(override)
❯ packages/swagger-faker/src/components/Query.test.tsx:64:20
|
Test:
packages/swagger-swr/src/components/Mutation.test.tsx#L66
Error: Snapshot `<Mutation/> > pets 1` mismatched
- Expected
+ Received
@@ -1,9 +1,9 @@
- "type CreatePetsClient = typeof client<CreatePetsMutationResponse, CreatePets201 | CreatePetsError, CreatePetsMutationRequest>
+ "type CreatePetsClient = typeof client<CreatePetsMutationResponse, never, CreatePetsMutationRequest>
type CreatePets = {
data: CreatePetsMutationResponse
- error: CreatePets201 | CreatePetsError
+ error: never
request: CreatePetsMutationRequest
pathParams: never
queryParams: never
headerParams: never
response: CreatePetsMutationResponse
❯ packages/swagger-swr/src/components/Mutation.test.tsx:66:20
|
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: pnpm/[email protected], actions/setup-node@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
The logs for this run have expired and are no longer available.
Loading