openapi-ts-mock-generator
Version:
typescript mock data generator based openapi
32 lines (28 loc) • 1.17 kB
TypeScript
import { Options, PathNormalizedType, HttpMethods } from '../core/types.js';
import 'openapi-types';
/**
* API 경로 정보 생성 로직
* OpenAPI 문서에서 경로 정보를 추출하고 정규화하여 반환
*/
/**
* OpenAPI 문서에서 API 경로 정보를 생성
* 모든 경로와 메서드를 분석하여 정규화된 형태로 반환
*/
declare const generateAPI: (options: Options) => Promise<PathNormalizedType[] | undefined>;
/**
* API 경로에서 고유한 태그 목록 추출
*/
declare const extractUniqueTags: (paths: PathNormalizedType[]) => string[];
/**
* 특정 태그에 해당하는 경로들만 필터링
*/
declare const filterPathsByTag: (paths: PathNormalizedType[], tag: string) => PathNormalizedType[];
/**
* HTTP 메서드별로 경로들을 그룹화
*/
declare const groupPathsByMethod: (paths: PathNormalizedType[]) => Record<HttpMethods, PathNormalizedType[]>;
/**
* 경로에서 사용된 모든 스키마 참조 추출
*/
declare const extractSchemaReferences: (paths: PathNormalizedType[]) => string[];
export { extractSchemaReferences, extractUniqueTags, filterPathsByTag, generateAPI, groupPathsByMethod };