You can set default values on method parameters and return values.
type Type
interface API
This feature is used by the TYML for VSCode
extension.
When opened in VSCode with the extension installed, you should see â–¶ Run server
and â–¶ Run client
like this:
Clicking these lets you run a mock server or client so you can quickly test your application with one click.
Defaults correspond to the actual JSON values used at runtime, but the syntax is slightly different from JSON.
Primitive values are the same as JSON:
// int
100
// float
100.0
// string
"text"
// bool
true
false
// null
null
Objects differ slightly from JSON.
Name literals do not need quotes, and :
becomes =
.
{ id = 100, name = "text" }
Arrays are the same as JSON.