From 0d894f59bbcc9a27eb7680969df2d4a06752b857 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Fri, 21 Jan 2022 20:16:38 +0100 Subject: [PATCH] fix(gatsby-cli): relax error location validation and ignore extra fields (#34559) --- .../gatsby-cli/src/structured-errors/error-schema.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/gatsby-cli/src/structured-errors/error-schema.ts b/packages/gatsby-cli/src/structured-errors/error-schema.ts index 306da6d31bdee..ec7dcdbb0e89c 100644 --- a/packages/gatsby-cli/src/structured-errors/error-schema.ts +++ b/packages/gatsby-cli/src/structured-errors/error-schema.ts @@ -1,10 +1,12 @@ import Joi from "joi" import { ILocationPosition, IStructuredError } from "./types" -export const Position: Joi.ObjectSchema = Joi.object().keys({ - line: Joi.number(), - column: Joi.number(), -}) +export const Position: Joi.ObjectSchema = Joi.object() + .keys({ + line: Joi.number(), + column: Joi.number(), + }) + .unknown() export const errorSchema: Joi.ObjectSchema = Joi.object().keys({ @@ -27,7 +29,7 @@ export const errorSchema: Joi.ObjectSchema = location: Joi.object({ start: Position.required(), end: Position, - }), + }).unknown(), docsUrl: Joi.string().uri({ allowRelative: false, relativeOnly: false,