Skip to content

Emitter Options

All options live under options."@lars-artmann/typespec-asyncapi" in tspconfig.yaml, or on the command line via --option @lars-artmann/typespec-asyncapi.<option>=<value>.

Option Type Default Purpose
output-file string asyncapi Base filename (without extension)
file-type string or object yaml "json", "yaml", "yml", or { format: "json", pretty: true, indent: 2 }
split-schemas boolean false Split schemas into individual files under schemas/
asyncapi-id string unset Root document id (e.g. "urn:com:example:api"); omitted when unset
version string unset Overrides info.version (highest precedence)

Pretty JSON:

options:
"@lars-artmann/typespec-asyncapi":
file-type: { format: "json", pretty: true, indent: 2 }

Split schemas with a URN id:

options:
"@lars-artmann/typespec-asyncapi":
split-schemas: true
asyncapi-id: "urn:com:example:api"

Output lands in tsp-output/@lars-artmann/typespec-asyncapi/ by convention (emitter-output-dir from the package manifest). With split-schemas, schema files land in a schemas/ subdirectory with all $ref pointers rewritten.