in packages/rulesets/src/spectral/functions/utils.ts [74:92]
export function getProperty(schema: any, propName: string): any {
if (!schema) {
return {}
}
if (schema.allOf && Array.isArray(schema.allOf)) {
for (const base of schema.allOf) {
const result = getProperty(base, propName)
if (result) {
return result
}
}
}
if (schema.properties) {
if (propName in schema.properties) {
return schema.properties[propName]
}
}
return undefined
}