Merge pull request #19670 from Bonial-International-GmbH/pjungermann/xml2js/replace-xml-parser

chore(deps): replace `express-xml-bodyparser` with `body-parser-xml`
This commit is contained in:
Fredrik Adelöw
2023-08-31 10:02:02 +02:00
committed by GitHub
4 changed files with 46 additions and 26 deletions
+3 -2
View File
@@ -36,9 +36,10 @@
"@backstage/errors": "workspace:^",
"@backstage/integration": "workspace:^",
"@types/express": "^4.17.6",
"body-parser": "^1.20.0",
"body-parser-xml": "^2.0.5",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"express-xml-bodyparser": "^0.3.0",
"knex": "^2.0.0",
"uuid": "^8.3.2",
"winston": "^3.2.1",
@@ -46,7 +47,7 @@
},
"devDependencies": {
"@backstage/cli": "workspace:^",
"@types/express-xml-bodyparser": "^0.3.2",
"@types/body-parser-xml": "^2.0.2",
"@types/supertest": "^2.0.8",
"msw": "^1.0.0",
"supertest": "^6.1.6",
@@ -17,7 +17,8 @@
import express from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import xmlparser from 'express-xml-bodyparser';
import BodyParser from 'body-parser';
import bodyParserXml from 'body-parser-xml';
import { CatalogApi, CatalogClient } from '@backstage/catalog-client';
import {
errorHandler,
@@ -62,8 +63,9 @@ export const makeRouter = async (
options.catalogApi ?? new CatalogClient({ discoveryApi: discovery });
const scm = ScmIntegrations.fromConfig(config);
bodyParserXml(BodyParser);
const router = Router();
router.use(xmlparser());
router.use(BodyParser.xml());
router.use(express.json());
const utils = new CoverageUtils(scm, urlReader);