prompty icon indicating copy to clipboard operation
prompty copied to clipboard

Update logic when parsing Inputs

Open markwallace-microsoft opened this issue 10 months ago • 0 comments

Currently it is possible to set an input in two ways

The full definition of the input

inputs:
  firstName:
    type: string
    default: User
    sample: April
    description: The first name of the customer
  lastName:
    type: string
    sample: Kwong
    required: true
    strict: false
    description: The last name of the customer

Or a shorthand to provide just the sample

inputs:
  firstName: Jane
  lastName: Doe
  question: What is the meaning of life?

A problem arises when the sample is a complex object e.g.

inputs:
  customer: 
    id: 123
    location: Dublin

When parsing the frontmatter we need to distinguish between a dictionary that is an input definition or a sample.

To resolve this the decision is that we do not allow setting complex objects using the shorthand syntax. Only primitive values and collections will be supported.

markwallace-microsoft avatar Apr 23 '25 17:04 markwallace-microsoft