I was setting up my Swagger alongside Express and I've been receiving this response (below) in Swagger UI. Any idea as to why this is occurring?
Swagger UI is displayed in its entirety, it's just the responses that are rather unusual.
File with endpoint:
import express from 'express';
import swaggerOptions from './config';
const expressJSDocSwagger = require('express-jsdoc-swagger');
export const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
const PORT = 3000;
expressJSDocSwagger(app)(swaggerOptions);
/**
* GET /test
* @summary This is the summary of the endpoin
* @tags Normalization
* @return {object} 200 - Success
* @return {object} 400 - Bad request
*/
app.get('/test', (req, resp) => {
resp.send({ foo: 'bar' });
});
app.listen(PORT);
Response body:
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /><link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body {
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" ....