@infinite-debugger/swagger-to-ts
Version:
swagger-to-ts is a powerful library that allows you to generate TypeScript code from Swagger documentation or OpenAPI specifications. It simplifies the process of integrating API definitions into your TypeScript projects, saving you time and effort.
25 lines (24 loc) • 1.03 kB
TypeScript
import { OpenAPISpecification } from '../../models';
import { ModelMappings, RequestGroupings } from '../../models/TypescriptAPIGenerator';
import { GenerateModelCodeOptions } from './ModelCodeGenerator';
export interface GenerateModelMappingsOptions extends Pick<GenerateModelCodeOptions, 'inferTypeFromValidationSchema'> {
/**
* The open api specification to use when looking up schemas
*/
openAPISpecification: OpenAPISpecification;
/**
* The request groupings to use when generating the model mappings
*/
requestGroupings: RequestGroupings;
/**
* Whether to generate code for tsed controllers
*/
generateTsEDControllers?: boolean;
}
/**
* Generate model mappings
*
* @param options The options to use when generating the model mappings
* @returns The model mappings
*/
export declare const generateModelMappings: ({ requestGroupings, openAPISpecification, generateTsEDControllers, inferTypeFromValidationSchema, }: GenerateModelMappingsOptions) => ModelMappings;