Skip to content

Commit de2d695

Browse files
chore: remove unused swaggerDoc property in buildSwaggerHTML and adapt usages
1 parent c373d51 commit de2d695

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

lib/swagger-module.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,9 @@ export class SwaggerModule {
180180
document = lazyBuildDocument();
181181
}
182182

183-
if (options.swaggerOptions.patchDocumentOnRequest) {
184-
const documentToSerialize =
185-
options.swaggerOptions.patchDocumentOnRequest(req, res, document);
186-
const htmlPerRequest = buildSwaggerHTML(
187-
baseUrlForSwaggerUI,
188-
documentToSerialize,
189-
options.swaggerOptions
190-
);
191-
return res.send(htmlPerRequest);
192-
}
193-
194183
if (!html) {
195184
html = buildSwaggerHTML(
196185
baseUrlForSwaggerUI,
197-
document,
198186
options.swaggerOptions
199187
);
200188
}
@@ -211,24 +199,13 @@ export class SwaggerModule {
211199
document = lazyBuildDocument();
212200
}
213201

214-
if (options.swaggerOptions.patchDocumentOnRequest) {
215-
const documentToSerialize =
216-
options.swaggerOptions.patchDocumentOnRequest(req, res, document);
217-
const htmlPerRequest = buildSwaggerHTML(
218-
baseUrlForSwaggerUI,
219-
documentToSerialize,
220-
options.swaggerOptions
221-
);
222-
return res.send(htmlPerRequest);
223-
}
224-
225202
if (!html) {
226203
html = buildSwaggerHTML(
227204
baseUrlForSwaggerUI,
228-
document,
229205
options.swaggerOptions
230206
);
231207
}
208+
232209
res.send(html);
233210
});
234211
} catch (err) {

lib/swagger-ui/swagger-ui.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ function toTags(
6666
*/
6767
export function buildSwaggerHTML(
6868
baseUrl: string,
69-
swaggerDoc: OpenAPIObject,
7069
customOptions: SwaggerCustomOptions = {}
7170
) {
7271
const {

0 commit comments

Comments
 (0)