• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobinTail / express-zod-api / 15978075268

30 Jun 2025 04:11PM UTC coverage: 100.0%. Remained the same
15978075268

Pull #2777

github

web-flow
Merge 1e71529ec into fb62f90f2
Pull Request #2777: feat(v25): `undefined` input schema for factories and middlewares by default

1229 of 1272 branches covered (96.62%)

28 of 28 new or added lines in 3 files covered. (100.0%)

3987 of 3987 relevant lines covered (100.0%)

360.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/express-zod-api/src/api-response.ts
1
import { z } from "zod/v4";
2

3
export const defaultStatusCodes = {
6✔
4
  positive: 200,
6✔
5
  negative: 400,
6✔
6
} satisfies Record<string, number>;
6✔
7

8
export type ResponseVariant = keyof typeof defaultStatusCodes;
9
export const responseVariants = Object.keys(
6✔
10
  defaultStatusCodes,
6✔
11
) as ResponseVariant[];
6✔
12

13
/** @public this is the user facing configuration */
14
export interface ApiResponse<S extends z.ZodType> {
15
  schema: S;
16
  /** @default 200 for a positive and 400 for a negative response */
17
  statusCode?: number | [number, ...number[]];
18
  /**
19
   * @example null is for no content, such as 204 and 302
20
   * @default "application/json"
21
   * */
22
  mimeType?: string | [string, ...string[]] | null;
23
}
24

25
/**
26
 * @private This is what the framework entities operate
27
 * @see normalize
28
 * */
29
export interface NormalizedResponse {
30
  schema: z.ZodType;
31
  statusCodes: [number, ...number[]];
32
  mimeTypes: [string, ...string[]] | null;
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc