Contents

encode(to:)

The scenario’s own fields, plus the utterances as one line.

Declaration

func encode(to encoder: any Encoder) throws

Discussion

The line is written as input. The evaluation runner stores the whole scenario in the report’s Input column, and Xcode shows a sample’s input field when it has one. Without it, Xcode prints the scenario’s entire JSON. Decoding is unchanged (it is synthesized, over CodingKeys), so a scenario file with or without input reads the same.