export function schemaForResource()

in src/cdk-schema.ts [82:102]


export function schemaForResource(construct: ConstructAndProps, ctx: SchemaContext) {
  ctx = ctx.child('resource', construct.constructClass.fqn);

  const propsSchema = schemaForTypeReference(construct.propsTypeRef, ctx);
  if (!propsSchema) {
    return undefined;
  }

  return ctx.define(construct.constructClass.fqn, () => {
    return {
      additionalProperties: false,
      properties: {
        Properties: propsSchema,
        Type: {
          enum: [construct.constructClass.fqn],
          type: 'string',
        },
      },
    };
  });
}