Emitter usage
Usage
- Via the command line
tsp compile . --emit=@typespec/http-server-csharp
- Via the config
emit: - "@typespec/http-server-csharp"
The config can be extended with options as follows:
emit: - "@typespec/http-server-csharp"options: "@typespec/http-server-csharp": option: value
Emitter options
skip-format
Type: boolean
Skips formatting of generated C# Types. By default, C# files are formatted using âdotnet formatâ.
output-type
Type: "models" | "all"
Chooses which service artifacts to emit. choices include âmodelsâ or âallâ artifacts.
emit-mocks
Type: "mocks-and-project-files" | "mocks-only" | "none"
Emits mock implementations of business logic, setup code, and project files, enabling the service to respond to requests before a real implementation is provided
use-swaggerui
Type: boolean
Configure a Swagger UI endpoint in the development configuration
openapi-path
Type: string
Use openapi at the given path for generating SwaggerUI endpoints. By default, this will be âopenapi/openapi.yamlâ if the âuse-swaggeruiâ option is enabled.
overwrite
Type: boolean
When generating mock and project files, overwrite any existing files with the same name.
project-name
Type: string
The name of the generated project.
http-port
Type: number
The service http port when hosting the project locally.
https-port
Type: number
The service https port when hosting the project locally.