Skip to content

Commit 766fb42

Browse files
authored
feat: filter oas/analyzer data by allowed keys (#1259)
| 🚥 Resolves ISSUE_ID | | :------------------- | ## 🧰 Changes This change introduces an explicit whitelist of keys that `rdme inspect` will process from the data returned by `oas/analyzer`. By filtering on known keys, we ensure that any new fields added by the analyzer won’t be rendered until we’ve explicitly implemented their handling in `rdme`.
1 parent 91b193c commit 766fb42

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/commands/openapi/inspect.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ function buildFeaturesReport(analysis: Analysis, features: string[]) {
106106

107107
function buildFullReport(analysis: Analysis, definitionVersion: string, tableBorder: Record<string, string>) {
108108
const report: string[] = ['Here are some interesting things we found in your API definition. 🕵️', ''];
109+
110+
const allowedKeys = ['dereferencedFileSize', 'mediaTypes', 'operationTotal', 'rawFileSize', 'securityTypes'];
109111
const sizeKeys = ['rawFileSize', 'dereferencedFileSize'];
110112

111113
// General API definition statistics
112114
report.push(
113115
...(Object.entries(analysis.general || {})
116+
.filter(([key]) => allowedKeys.includes(key))
114117
.map(([key, info]) => {
115118
if (Array.isArray(info.found)) {
116119
if (!info.found.length) return false;

0 commit comments

Comments
 (0)