UNPKG

@scalar/openapi-parser

Version:

modern OpenAPI parser written in TypeScript

20 lines (19 loc) 529 B
import BaseValidationError from "./base.js"; class PatternValidationError extends BaseValidationError { constructor(...args) { super(...args); this.name = "PatternValidationError"; this.options.isIdentifierLocation = true; } getError() { const { params, propertyName } = this.options; return { message: `Property "${propertyName}" must match pattern ${params.pattern}`, path: this.instancePath }; } } export { PatternValidationError as default }; //# sourceMappingURL=pattern.js.map