UNPKG

openapi-metadata

Version:

Auto-Generate OpenAPI specifications from Typescript decorators

28 lines (24 loc) 990 B
'use strict'; 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); } } exports.NoExplicitTypeError = NoExplicitTypeError; exports.ReflectMetadataMissingError = ReflectMetadataMissingError;