openapi-metadata
Version:
Auto-Generate OpenAPI specifications from Typescript decorators
25 lines (22 loc) • 928 B
JavaScript
class NoExplicitTypeError extends Error {
constructor(typeName, propertyKey, parameterIndex, argName) {
let errorMessage = "Unable to infer OpenAPI type from TypeScript reflection system. You need to provide explicit type for ";
if (argName) {
errorMessage += `argument named '${argName}' of `;
} else if (parameterIndex !== void 0) {
errorMessage += `parameter #${parameterIndex} of `;
}
errorMessage += `'${propertyKey}' of '${typeName}' class.`;
super(errorMessage);
Object.setPrototypeOf(this, new.target.prototype);
}
}
class ReflectMetadataMissingError extends Error {
constructor() {
super(
"Looks like you've forgot to provide experimental metadata API polyfill. Please read the installation instruction for more details."
);
Object.setPrototypeOf(this, new.target.prototype);
}
}
export { NoExplicitTypeError as N, ReflectMetadataMissingError as R };