Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/routes/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/util/RapLPBaseApiErrorHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down