* feat: manage authorized devices * chore: open api * get header from mobile app * write header from mobile app * styling * fix unit test * feat: use relative time * feat: update access time * fix: tests * chore: confirm wording * chore: bump test coverage thresholds * feat: add some icons * chore: icon tweaks --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
33 lines
696 B
TypeScript
33 lines
696 B
TypeScript
import { OpenAPIObject } from '@nestjs/swagger';
|
|
|
|
export function patchOpenAPI(document: OpenAPIObject) {
|
|
for (const path of Object.values(document.paths)) {
|
|
const operations = {
|
|
get: path.get,
|
|
put: path.put,
|
|
post: path.post,
|
|
delete: path.delete,
|
|
options: path.options,
|
|
head: path.head,
|
|
patch: path.patch,
|
|
trace: path.trace,
|
|
};
|
|
|
|
for (const operation of Object.values(operations)) {
|
|
if (!operation) {
|
|
continue;
|
|
}
|
|
|
|
if (operation.summary === '') {
|
|
delete operation.summary;
|
|
}
|
|
|
|
if (operation.description === '') {
|
|
delete operation.description;
|
|
}
|
|
}
|
|
}
|
|
|
|
return document;
|
|
}
|