swagger-typescript-generator
Version:
Generate typescript code from swagger.json. Before start this project I try use [swagger-typescript-codegen](https://github.com/mtennoe/swagger-typescript-codegen) based on [mustache templates](https://github.com/mtennoe/swagger-js-codegen/tree/master/lib
27 lines (26 loc) • 1.55 kB
TypeScript
import { ModelType, SwaggerClass, SwaggerMethod, SwaggerMethodParameter, SwaggerModel, SwaggerModelProperty } from '.';
import { SwaggerEnum } from './swagger-enum';
import { SwaggerPath } from './swagger-path';
export interface ISwaggerUtils {
getClassName: (context: SwaggerClass, name: string) => string;
getClassFileName: (context: SwaggerClass, name: string) => string;
getMethodName: (context: SwaggerMethod, name: string) => string;
getMethodParameterName: (context: SwaggerMethodParameter, name: string) => string;
getMethodResponseType: (context: SwaggerMethod, shema: any) => string;
getMethodParameterType: (context: SwaggerMethodParameter, shema: any) => string;
getModelName: (context: SwaggerModel, name: string) => string;
getModelFileName: (context: SwaggerModel, name: string) => string;
getModelType: (context: SwaggerModel, schema: any) => string;
getModelPropertyType: (context: SwaggerModelProperty, schema: any) => string;
getEnumName: (name: string) => string;
getEnumFileName: (context: SwaggerEnum, name: string) => string;
getPathName: (context: SwaggerPath, name: string) => string;
escapeMethodQueryParameterName: (name: string) => string;
isArray: (schema: any) => boolean;
isEnum: (schema: any) => boolean;
isJsType: (name: string) => boolean;
getEnumValues: (schema: any) => string[] | undefined;
getArrayItemType: (schema: any) => string;
getModelType2: (schema: any) => ModelType;
}
export declare const defaultUtils: ISwaggerUtils;