{
message: [ {
code: 'INVALID_TYPE',
message: 'Expected type string but found type object',
schemaUrl: '.\\ImageAnalysis.json',
exampleUrl: 'examples\\SegmentFromStream_MaximumSet_Gen.json',
schemaPosition: {
line: 139, column: 23
}
,
schemaJsonPath: '#/properties/body/type',
examplePosition: {
line: 7, column: 21
}
,
exampleJsonPath: '$parameters.imageContent',
severity: 0,
source: 'request',
operationId: 'SegmentFromStream',
[Symbol(level)]: 'error',
[Symbol(message)]: '{"code":"INVALID_TYPE","exampleJsonPath":"$parameters.imageContent","examplePosition":{"column":21,"line":7},"exampleUrl":"examples\\\\SegmentFromStream_MaximumSet_Gen.json","level":"error","message":"Expected type string but found type object","operationId":"SegmentFromStream","schemaJsonPath":"#/properties/body/type","schemaPosition":{"column":23,"line":139},"schemaUrl":".\\\\ImageAnalysis.json","severity":0,"source":"request"}'
}
level: '\x1B[31merror\x1B[39m'
}
Discovered in this typespec generated PR
User entered
oav generate-examples ./generated.jsonusing thegenerated.jsonspec present in above PR.Here is an example of the specific place in the generated example that was problematic.
Prior to user manually correcting with
"<your image bytes>"these were generated with values that failed validation. Specifically:This is because the
imageContentwas generating with erroneous value{}. User correct{}to"<your bytes here>"and example passed validation.