in src/cdk-schema.ts [17:56]
export function renderFullSchema(typeSystem: jsiiReflect.TypeSystem, options: RenderSchemaOptions = { }) {
if (!process.stdin.isTTY || options.colors === false) {
// Disable chalk color highlighting
process.env.FORCE_COLOR = '0';
}
// Find all constructs for which the props interface
// (transitively) only consists of JSON primitives or interfaces
// that consist of JSON primitives
const constructType = typeSystem.findClass('constructs.Construct');
const constructs = typeSystem.classes.filter(c => c.extends(constructType));
const deconstructs = constructs
.map(unpackConstruct)
.filter(c => c && !isCfnResource(c.constructClass)) as ConstructAndProps[];
// eslint-disable-next-line @typescript-eslint/no-require-imports
const output = require('../cloudformation.schema.json');
output.definitions = output.definitions || { };
const ctx = SchemaContext.root(output.definitions);
for (const deco of deconstructs) {
const resource = schemaForResource(deco, ctx);
if (resource) {
output.properties.Resources.patternProperties['^[a-zA-Z0-9]+$'].anyOf.push(resource);
}
}
output.properties.$schema = {
type: 'string',
};
if (options.warnings) {
printWarnings(ctx);
}
return output;
}