(components: Record<string, unknown>)
| 45 | } |
| 46 | } |
| 47 | |
| 48 | const processComponents = (components: Record<string, unknown>): Record<string, unknown> => { |
| 49 | const newComponents: Record<string, unknown> = {} |
| 50 | for (const [compKey, compValue] of Object.entries(components)) |
| 51 | if (compKey === 'schemas' && typeof compValue === 'object' && compValue !== null) { |
| 52 | const schemas = compValue as Record<string, unknown> |
| 53 | const newSchemas: Record<string, unknown> = {} |
| 54 | for (const [schemaKey, schemaValue] of Object.entries(schemas)) |
| 55 | newSchemas[schemaKey] = removeDefaultsFromRequired(schemaValue) |
| 56 | newComponents[compKey] = newSchemas |
| 57 | } else { |
| 58 | newComponents[compKey] = removeDefaultsFromRequired(compValue) |
| 59 | } |
| 60 | return newComponents |
| 61 | } |
| 62 | |
| 63 | // Recursively process nested objects |
no test coverage detected