bentonam / fakeit

Generates JSON documents based on models defined in YAML and adds them to a Couchbase Bucket
MIT License
86 stars 21 forks source link

post_build steps not being run in referenced array item object definitions #63

Closed ghost closed 8 years ago

ghost commented 8 years ago

When defining array items by a referenced definition, the post_build step does not get executed. The following is an example with output:

Array Property Definition:

tags:
  type: array
  description: An array of tags describing the prospect and their interests
  items:
    $ref: '#/definitions/Tags'
    data:
      min: 0
      max: 10

Items Definition

Tags:
  type: string
  data:
    pre_build: "console.log('pre');"
    build: >
      console.log('build');
      return chance.word();
    post_build: "console.log('post');"

Run command fakeit -m prospects.yaml -i input/ -n 5 -d output/

Output Generating 5 documents for Prospects model pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build pre build