prompty
prompty copied to clipboard
Update logic when parsing Inputs
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.