TypeSpec service code generator for c-sharp
npm install @typespec/http-server-csharp
- 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
Type: absolutePath
Defines the emitter output directory. Defaults to {output-dir}/@typespec/http-server-csharp
See Configuring output directory for more info
Type: boolean
Skips formatting of generated C# Types. By default, C# files are formatted using 'dotnet format'.
Type: "models" | "all"
Chooses which service artifacts to emit. choices include 'models' or 'all' artifacts.
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
Type: boolean
Configure a Swagger UI endpoint in the development configuration
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.
Type: boolean
When generating mock and project files, overwrite any existing files with the same name.
Type: string
The name of the generated project.
Type: number
The service http port when hosting the project locally.
Type: number
The service https port when hosting the project locally.