In swagger, we have testmodeler
to extends m4 model to help to link swagger example file to corresponding operation, as well as map example value to its type schema. When we switch to TypeSpec, we currently still use swagger example file to show the payload example of an operation. Also, TCGC is the middle model layer for TypeSpec, just like m4 for swagger. So, TCGC need to do what testmodeler
do.
Current example/test generation way of all languages could be grouped into two kinds:
- Use example model in
testmodeler
to generate the example/test codes: Go MPG from swagger, JS HLC, .NET MPG from swagger - Use self-defined example model and do example value mapping/fake value generation by language's code generator: Java, .NET DPG, Python