private emitDefinitionTypes()

in src/cfn-resource-generator.ts [84:100]


  private emitDefinitionTypes(code: j2j.Code) {
    const gen = new j2j.TypeGenerator({
      definitions: this.schema.definitions,
    });

    const schema = JSON.parse(JSON.stringify(this.schema));
    for (const prop of this.resourceAttributes) {
      // Remove attributes that cannot be written but are used as attributes
      // These should not be part of the Props struct
      delete schema.properties[prop];
    }

    gen.emitType(this.propsStructName, schema);

    gen.renderToCode(code);
    code.line();
  }