diff --git a/src/routes/validate.ts b/src/routes/validate.ts index bce43764..7686db50 100644 --- a/src/routes/validate.ts +++ b/src/routes/validate.ts @@ -98,8 +98,8 @@ export const registerValidationRoutes = (app: Express) => { //0.5 Check input if (!body.spec) { throw new RapLPBaseApiError( - 'Invalid request', - 'Missing required field: spec', + 'Ogiltig request', + 'Obligatoriskt fält saknas: spec', ERROR_TYPE.BAD_REQUEST, ); } @@ -129,9 +129,9 @@ export const registerValidationRoutes = (app: Express) => { return res.status(400).json( new ProblemDetailsDTO({ type: 'https://rap-lp./problems/semantic-validation', - title: 'Rule validation failed', + title: 'Regelvalideringen misslyckades', status: 400, - detail: 'The specification contains structural or semantic errors', + detail: 'Specifikationen innehåller strukturella eller semantiska fel', instance: req.originalUrl, // Put in kind field to indicate violation @@ -157,9 +157,9 @@ export const registerValidationRoutes = (app: Express) => { return res.status(400).json( new ProblemDetailsDTO({ type: 'https://rap-lp./problems/rule-validation', - title: 'Rule validation failed', + title: 'Regelvalideringen misslyckades', status: 400, - detail: 'The api specification violates one or more rules according to the Swedish REST API-profile', + detail: 'API-specifikationen bryter mot en eller flera regler enligt den svenska REST API-profilen.', instance: req.originalUrl, // Put in kind field to indicate violation diff --git a/src/util/RapLPBaseApiErrorHandling.ts b/src/util/RapLPBaseApiErrorHandling.ts index 5f5e4fba..eb9c1f07 100644 --- a/src/util/RapLPBaseApiErrorHandling.ts +++ b/src/util/RapLPBaseApiErrorHandling.ts @@ -34,7 +34,7 @@ const errorHandler = (err: any, req: Request, res: Response, next: NextFunction) if (err instanceof SpecParseError) { const problemDetails = new ProblemDetailsDTO({ type: 'https://rap-lp./problems/spec-parse-error', - title: 'Specification parse error', + title: 'Okänt fel vid parsning av API-specifikationen', status: ERROR_TYPE.BAD_REQUEST, detail: err.message, instance: req.originalUrl,