Skip to content

Commit f44a0c0

Browse files
committed
Updated overlay metrics
1 parent d329484 commit f44a0c0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bin/__snapshots__/cli.test.js.snap

+2-1
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,11 @@ OpenAPI-Format CLI settings:
305305
OpenAPI Overlay actions summary:
306306
- Total actions: 4
307307
- Applied actions: 3
308+
- Unused actions: 1
308309
================================================================================
309310
Unused overlay actions:
310311
- Target: $.server[*]
311-
Description: No description provided
312+
Type: remove
312313
================================================================================
313314
✅ OpenAPI formatted successfully
314315
================================================================================

bin/cli.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ async function run(oaFile, options) {
257257
if (resOverlay?.resultData &&
258258
(resOverlay.resultData.unusedActions || resOverlay.resultData.appliedActions || resOverlay.resultData.totalActions)) {
259259
cliLog.unusedActions = resOverlay.resultData.unusedActions || [];
260-
cliLog.appliedActions = resOverlay.resultData.appliedActions || 0;
260+
cliLog.totalUsedActions = resOverlay.resultData.totalUsedActions || 0;
261+
cliLog.totalUnusedActions = resOverlay.resultData.totalUnusedActions || 0;
261262
cliLog.totalActions = resOverlay.resultData.totalActions || 0;
262263
}
263264
resObj = resOverlay.data;
@@ -362,12 +363,13 @@ async function run(oaFile, options) {
362363
logOut(`${consoleLine}`, options.verbose); // LOG - horizontal rule
363364
logOut(`OpenAPI Overlay actions summary:`, options.verbose);
364365
logOut(`- Total actions: \t${cliLog.totalActions}`, options.verbose);
365-
logOut(`- Applied actions: \t${cliLog.appliedActions}`, options.verbose);
366+
logOut(`- Applied actions: \t${cliLog.totalUsedActions}`, options.verbose);
367+
logOut(`- Unused actions: \t${cliLog.totalUnusedActions}`, options.verbose);
366368

367369
const cliOut = [];
368370
cliLog.unusedActions.forEach(action => {
369371
const description = action.description || 'No description provided';
370-
cliOut.push(`- Target: ${action.target}\n Description: ${description}`);
372+
cliOut.push(`- Target: ${action.target}\n Type: ${action.update ? 'update' : action.remove ? 'remove' : 'unknown'}`);
371373
});
372374

373375
if (cliLog.unusedActions.length > 0) {

0 commit comments

Comments
 (0)