UNPKG

openapi-ts-generator

Version:

Based on swagger-ts-generator, this is a type script model generator specifically for services with OpenApi spec documentation.

33 lines (32 loc) 2.29 kB
import { IGeneratorOptions } from './models/generator-options'; import { SchemaWrapperInfo } from './models/schema-info'; import { IImportType, IPath, ITemplateData } from './models/template-data'; import { IEntity } from './models/entity'; import { IReferenceProperty } from './models/reference-property'; import { IValueProperty } from './models/value-property'; import { OpenAPIObject } from 'openapi3-ts/dist/oas30'; export declare class OpenApiDocConverter { private readonly options; private readonly apiDocument; readonly endAlphaNumRegex: RegExp; readonly startNumberregex: RegExp; constructor(options: IGeneratorOptions, apiDocument: OpenAPIObject); convertDocument(): ITemplateData; convertPaths(): IPath[]; convertEntities(): IEntity[]; buildSchemaWrapperInfoForEnum(schemaWrapperInfo: SchemaWrapperInfo): void; buildSchemaWrapperInfo(parentTypeName: string, schemaWrapperInfo: SchemaWrapperInfo): void; convertArray(parentTypeName: string, propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): void; convertSchemaObjectToPropertyType(parentTypeName: string, propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IValueProperty; private convertValidator; convertArrayObjectToValuePropertyType(parentTypeName: string, propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IValueProperty; getInitialValue(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): string; getInitialTestValue(parentTypeName: string, propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): string; convertArrayObjectToReferencePropertyType(parentTypeName: string, propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IReferenceProperty; convertReferenceObjectToPropertyType(parentTypeName: string, propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IReferenceProperty; getValidatorCount(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): number; getPropertyTypeScriptType(schemaWrapperInfo: SchemaWrapperInfo): string; parseRef(schemaWrapperInfo: SchemaWrapperInfo): string; getImportTypes(entityName: string, schemaWrapperInfo: SchemaWrapperInfo): IImportType[]; getIsRequired(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): boolean; }