Skip to content

Commit

Permalink
bodyParsers is deprecated so update with expess bodyParsers (#974)
Browse files Browse the repository at this point in the history
* Change path-to-regexp 6.2.2 to 6.3.0

* express version update

* bodyParsers is deprecated so update with expess bodyParsers

* update express to 4.21.0
  • Loading branch information
cvchauhan authored Sep 12, 2024
1 parent 772d1dc commit 6dc3b97
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 121 deletions.
7 changes: 3 additions & 4 deletions examples/3-eov-operations/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const logger = require('morgan');
const http = require('http');
const { OpenApiValidator } = require('express-openapi-validator');
Expand All @@ -10,9 +9,9 @@ const app = express();
const apiSpec = path.join(__dirname, 'api.yaml');

// 1. Install bodyParsers for the request types your API will support
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.text());
app.use(bodyParser.json());
app.use(bodyParsers.urlencoded({ extended: false }));
app.use(express.text());
app.use(express.json());

app.use(logger('dev'));

Expand Down
Loading

1 comment on commit 6dc3b97

@himabindugit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When are you planning to release the next version? waiting for the path-to-regexp vulnerability fix to be released

Please sign in to comment.