counterfact
Version:
Generate a TypeScript-based mock server from an OpenAPI spec in seconds — with stateful routes, hot reload, and REPL support.
27 lines (26 loc) • 640 B
text/typescript
/**
* Describes a single parameter (path, query, header, cookie, body, or
* formData) as defined in an OpenAPI document. Used internally to type the
* `path`, `query`, `headers`, and `body` properties of a route handler's
* argument object.
*/
export interface OpenApiParameters {
explode?: boolean;
in:
| "body"
| "cookie"
| "formData"
| "header"
| "path"
| "query"
| "querystring";
name: string;
required?: boolean;
schema?: {
[key: string]: unknown;
properties?: Record<string, unknown>;
type?: string;
};
style?: string;
type?: "string" | "number" | "integer" | "boolean";
}