Skip to content

Referencing key of a dependency #190

@mgroves

Description

@mgroves

I define one yaml file with a key that is built on its own:

name: Things
 . . . snip . . .
key:
  data:
    build: `thing::${faker.random.number({ min: 10000000, max: 50000000, precision: 1})}`
. . . etc . . . 

I then define another yaml file with a dependency on the first. I want one of its properties to refer to a random Thing by key. But it doesn't look like I can refer to the key, only the properties:

name: Boxes
data:
  dependencies:
     - things.yaml
. . . snip . . .
properties:
   thingId:
      data:
          build: faker.random.arrayElement(documents.Things).someProperty
. . . etc . . .

So, I could make an id property in Things, and make that property the key, but I don't want _id to actually be stored as a property. Is there any way around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions