Skip to content

Array Element in x-faker Doesn't Work as Expected #2715

@AddisonSnyder

Description

@AddisonSnyder

The goal is to choose a random element using x-faker, as below:

  unitOfPurchase:
    type: string
    description: |
      FileMan Field Label: 'UNIT OF PURCHASE'  FileMan Field Number: '1.5'
      This is the unit of purchase for this item.
    title: UNIT OF PURCHASE
    x-faker:
      helpers.arrayElement: [ 'yard', 'foot' ]

All it gives is a random letter from the word 'yard'. Is this the proper way to use the x-faker method for getting a random array element?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions