(schema: JSONSchema7 | null | undefined)
| 1211 | } |
| 1212 | |
| 1213 | export function hasSchemaPayload(schema: JSONSchema7 | null | undefined): boolean { |
| 1214 | if (!schema) return false; |
| 1215 | if (schema.properties) return Object.keys(schema.properties).length > 0; |
| 1216 | if (schema.additionalProperties) return true; |
| 1217 | if (schema.items) return true; |
| 1218 | if (schema.anyOf || schema.oneOf || schema.allOf) return true; |
| 1219 | if (schema.enum && schema.enum.length > 0) return true; |
| 1220 | if (schema.const !== undefined) return true; |
| 1221 | if (schema.$ref) return true; |
| 1222 | if (Array.isArray(schema.type)) return schema.type.length > 0 && !(schema.type.length === 1 && schema.type[0] === "object"); |
| 1223 | return schema.type !== undefined && schema.type !== "object"; |
| 1224 | } |
| 1225 | |
| 1226 | export function collectDefinitionCollections( |
| 1227 | schema: Record<string, unknown> |
no outgoing calls
no test coverage detected
searching dependent graphs…