@codegena/oapi3ts
Version:
Codegeneration from OAS3 to TypeScript
33 lines (32 loc) • 1.31 kB
TypeScript
import { Generic as SchemaGeneric, Schema } from '@codegena/definitions/json-schema';
import { Oas3Specification } from '@codegena/definitions/oas3';
import { DataTypeDescriptor, DescriptorContext } from './data-type-descriptor';
export interface ParsingProblemMeta {
context?: DescriptorContext;
descriptors?: DataTypeDescriptor | DataTypeDescriptor[];
oasStructure?: Oas3Specification;
schema?: Schema | SchemaGeneric;
/**
* Path of place in {@link oasStructure} was in parsing when the error occurred.
* Using format [RFC-6901](https://tools.ietf.org/html/rfc6901).
*/
jsonPath?: string;
/**
* JSON Schema `$ref` was trying to parse or related with parsed descriptor
* in moment when error occurred.
*/
relatedRef?: string;
originalError?: any;
}
export declare class ParsingProblems {
static throwErrorOnWarning: boolean;
static onWarnings: (message: string, meta?: ParsingProblemMeta) => void;
static parsingWarning(message: string, meta?: ParsingProblemMeta): void;
}
export declare class ParsingError implements Error {
readonly message: string;
readonly meta?: ParsingProblemMeta;
readonly stack: string;
readonly name = "OAS3 Parsing Error";
constructor(message: string, meta?: ParsingProblemMeta);
}