Skip to content

Commit 9f4628d

Browse files
fix: fix mixed languages in response to client
Signed-off-by: Fredrik Nordlander <fredrik.nordlander@digg.se>
1 parent 7f1ef9d commit 9f4628d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/routes/validate.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export const registerValidationRoutes = (app: Express) => {
9898
//0.5 Check input
9999
if (!body.spec) {
100100
throw new RapLPBaseApiError(
101-
'Invalid request',
102-
'Missing required field: spec',
101+
'Ogiltig request',
102+
'Obligatoriskt fält saknas: spec',
103103
ERROR_TYPE.BAD_REQUEST,
104104
);
105105
}
@@ -129,9 +129,9 @@ export const registerValidationRoutes = (app: Express) => {
129129
return res.status(400).json(
130130
new ProblemDetailsDTO({
131131
type: 'https://rap-lp./problems/semantic-validation',
132-
title: 'Rule validation failed',
132+
title: 'Regelvalideringen misslyckades',
133133
status: 400,
134-
detail: 'The specification contains structural or semantic errors',
134+
detail: 'Specifikationen innehåller strukturella eller semantiska fel',
135135
instance: req.originalUrl,
136136

137137
// Put in kind field to indicate violation
@@ -157,9 +157,9 @@ export const registerValidationRoutes = (app: Express) => {
157157
return res.status(400).json(
158158
new ProblemDetailsDTO({
159159
type: 'https://rap-lp./problems/rule-validation',
160-
title: 'Rule validation failed',
160+
title: 'Regelvalideringen misslyckades',
161161
status: 400,
162-
detail: 'The api specification violates one or more rules according to the Swedish REST API-profile',
162+
detail: 'API-specifikationen bryter mot en eller flera regler enligt den svenska REST API-profilen.',
163163
instance: req.originalUrl,
164164

165165
// Put in kind field to indicate violation

src/util/RapLPBaseApiErrorHandling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const errorHandler = (err: any, req: Request, res: Response, next: NextFunction)
3434
if (err instanceof SpecParseError) {
3535
const problemDetails = new ProblemDetailsDTO({
3636
type: 'https://rap-lp./problems/spec-parse-error',
37-
title: 'Specification parse error',
37+
title: 'Okänt fel vid parsning av API-specifikationen',
3838
status: ERROR_TYPE.BAD_REQUEST,
3939
detail: err.message,
4040
instance: req.originalUrl,

0 commit comments

Comments
 (0)