@@ -268,7 +268,7 @@ const app = express();
268268const OpenApiValidator = require (' express-openapi-validator' ).OpenApiValidator ;
269269
270270// 2. Set up body parsers for the request body types you expect
271- // Must be specified prior to endpoints in 4 .
271+ // Must be specified prior to endpoints in 5 .
272272app .use (bodyParser .json ());
273273app .use (bodyParser .text ());
274274app .use (bodyParser .urlencoded ());
@@ -290,7 +290,7 @@ new OpenApiValidator({
290290 // unknownFormats: ['my-format'] // <-- to provide custom formats
291291}).install (app );
292292
293- // 4 . Define routes using Express
293+ // 5 . Define routes using Express
294294app .get (' /v1/pets' , function (req , res , next ) {
295295 res .json ([{ id: 1 , name: ' max' }, { id: 2 , name: ' mini' }]);
296296});
@@ -303,7 +303,7 @@ app.get('/v1/pets/:id', function(req, res, next) {
303303 res .json ({ id: req .params .id , name: ' sparky' });
304304});
305305
306- // 5 . Define route(s) to upload file(s)
306+ // 5a . Define route(s) to upload file(s)
307307app .post (' /v1/pets/:id/photos' , function (req , res , next ) {
308308 // files are found in req.files
309309 // non-file multipart params can be found as such: req.body['my-param']
0 commit comments