Skip to content

Commit

Permalink
chore: remove unused swaggerDoc property in buildSwaggerHTML and adap…
Browse files Browse the repository at this point in the history
…t usages
  • Loading branch information
lucas-gregoire committed Feb 14, 2024
1 parent c373d51 commit de2d695
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
25 changes: 1 addition & 24 deletions lib/swagger-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,9 @@ export class SwaggerModule {
document = lazyBuildDocument();
}

if (options.swaggerOptions.patchDocumentOnRequest) {
const documentToSerialize =
options.swaggerOptions.patchDocumentOnRequest(req, res, document);
const htmlPerRequest = buildSwaggerHTML(
baseUrlForSwaggerUI,
documentToSerialize,
options.swaggerOptions
);
return res.send(htmlPerRequest);
}

if (!html) {
html = buildSwaggerHTML(
baseUrlForSwaggerUI,
document,
options.swaggerOptions
);
}
Expand All @@ -211,24 +199,13 @@ export class SwaggerModule {
document = lazyBuildDocument();
}

if (options.swaggerOptions.patchDocumentOnRequest) {
const documentToSerialize =
options.swaggerOptions.patchDocumentOnRequest(req, res, document);
const htmlPerRequest = buildSwaggerHTML(
baseUrlForSwaggerUI,
documentToSerialize,
options.swaggerOptions
);
return res.send(htmlPerRequest);
}

if (!html) {
html = buildSwaggerHTML(
baseUrlForSwaggerUI,
document,
options.swaggerOptions
);
}

res.send(html);
});
} catch (err) {
Expand Down
1 change: 0 additions & 1 deletion lib/swagger-ui/swagger-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function toTags(
*/
export function buildSwaggerHTML(
baseUrl: string,
swaggerDoc: OpenAPIObject,
customOptions: SwaggerCustomOptions = {}
) {
const {
Expand Down

0 comments on commit de2d695

Please sign in to comment.