Emitter usage
Emitter usage
Section titled “Emitter 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: valueEmitter options
Section titled “Emitter options”emitter-output-dir
Section titled “emitter-output-dir”Type: absolutePath
Defines the emitter output directory. Defaults to {output-dir}/@typespec/http-server-csharp
See Configuring output directory for more info
skip-format
Section titled “skip-format”Type: boolean
Default: false
Skips formatting of generated C# Types. By default, C# files are formatted using ‘dotnet format’.
output-type
Section titled “output-type”Type: "models" | "all"
Default: "all"
Chooses which service artifacts to emit. choices include ‘models’ or ‘all’ artifacts.
emit-mocks
Section titled “emit-mocks”Type: "mocks-and-project-files" | "mocks-only" | "none"
Default: "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
Section titled “use-swaggerui”Type: boolean
Default: false
Configure a Swagger UI endpoint in the development configuration
openapi-path
Section titled “openapi-path”Type: string
Default: null
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
Section titled “overwrite”Type: boolean
Default: false
When generating mock and project files, overwrite any existing files with the same name.
project-name
Section titled “project-name”Type: string
Default: "ServiceProject"
The name of the generated project.
http-port
Section titled “http-port”Type: number
Default: null
The service http port when hosting the project locally.
https-port
Section titled “https-port”Type: number
Default: null
The service https port when hosting the project locally.
collection-type
Section titled “collection-type”Type: "array" | "enumerable"
Default: "array"
Specifies the collection type to use: ‘array’ or ‘enumerable’. The default is ‘array’.