@protocolnebula/ts-openapi-generator
Version:
Build API and models from Swagger/OpenAPI to use in any project type
37 lines • 2.33 kB
TypeScript
import { USED_IN_ATTRIBUTE } from '@model/entities';
import { ParameterStore } from '@src/stores/parameter.store';
import { OpenAPIV3 } from 'openapi-types';
import { ModelAttributessModel } from '../../../models/model-attributes.model';
import { StoreI } from '../../../stores/entities.store';
import { ModelStore } from '../../../stores/model.store';
/**
* This service Process all COMPONENTS (components/schemas/*) and convert it to ModelModel instances
*
*/
export declare abstract class ParserBaseService {
protected document: OpenAPIV3.Document;
protected store: StoreI;
constructor(document: OpenAPIV3.Document, store: StoreI);
get modelStore(): ModelStore;
get parameterStore(): ParameterStore;
protected getParameterUsedInType(inValue: string): USED_IN_ATTRIBUTE;
protected isEnumObject(rawAttribute: any): rawAttribute is OpenAPIV3.SchemaObject;
protected isRefObject(rawAttribute: any): rawAttribute is OpenAPIV3.ReferenceObject;
protected isSchemaObject(rawAttribute: any): rawAttribute is OpenAPIV3.SchemaObject;
protected isParameterObject(rawAttribute: any): rawAttribute is OpenAPIV3.ParameterObject;
protected isRequestBodyObject(rawAttribute: any): rawAttribute is OpenAPIV3.RequestBodyObject;
protected isResponseObject(rawAttribute: any): rawAttribute is OpenAPIV3.ResponseObject;
/**
* Get an Schema and get the REF
* If is a custom model (scheme), it will create a new model
* @param schema
* @param modelName Name for the model if is not a "ref"
*/
protected parseApiParameters(parameters: (OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject)[], modelName: string): ModelAttributessModel;
protected parseParameter(rawParameter: OpenAPIV3.ParameterObject, modelName: string): ModelAttributessModel;
protected parseSchema(schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject, defaultName: string, mediaType?: string): ModelAttributessModel;
protected parseAttributes(rawModel: OpenAPIV3.NonArraySchemaObject, parentName: string): ModelAttributessModel[];
protected isAttributeRequired(attrName: string, requiredList: string[]): boolean;
protected fillAttribute(attribute: ModelAttributessModel, rawAttribute: any, defaultName: string): void;
}
//# sourceMappingURL=parser-base.service.d.ts.map