UNPKG

568 BTypeScriptView Raw
1/**
2 * Validate the path to be compatible with OpenAPI path template. No parameter
3 * modifier, custom pattern, or unnamed parameter is allowed.
4 */
5export declare function validateApiPath(path?: string): string;
6/**
7 * Get all path variables. For example, `/root/{foo}/bar` => `['foo']`
8 */
9export declare function getPathVariables(path: string): RegExpMatchArray | null;
10/**
11 * Convert an OpenAPI path to Express (path-to-regexp) style
12 * @param path - OpenAPI path with optional variables as `{var}`
13 */
14export declare function toExpressPath(path: string): string;