Apstory.TypescriptCodeGen.Swagger 1.1.0.33

Prefix Reserved
dotnet tool install --global Apstory.TypescriptCodeGen.Swagger --version 1.1.0.33
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Apstory.TypescriptCodeGen.Swagger --version 1.1.0.33
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Apstory.TypescriptCodeGen.Swagger&version=1.1.0.33
                    
nuke :add-package Apstory.TypescriptCodeGen.Swagger --version 1.1.0.33
                    

Apstory Typescript Code Generator

Typescript code generator, generating typescript models and api service calls from a swagger.json endpoint

Usage

dotnet Apstory.TypescriptCodeGen.Swagger.dll -u http://localhost -v 1 -o c:\project\gen

Command Options

-u The base url of the swagger api endpoint -v The version of the swagger api endpoint -o The directory to write the generated models and services to

Prerequisites

Swaggers OperationId value must be populated in the JSON as its used as the method name in the typescript api service

Here is an example of how to achieve this in c#

public class AddActionNameAsOperationIdOperationFilter : IOperationFilter
{
    public void Apply(OpenApiOperation operation, OperationFilterContext context)
    {
        if (operation.Parameters == null) operation.Parameters = new List<OpenApiParameter>();

        var descriptor = context.ApiDescription.ActionDescriptor as ControllerActionDescriptor;
        if (descriptor != null)
            operation.OperationId = descriptor.ActionName;
    }
}

Then in program.cs, add in the OperationFilter to your swagger documentation generation.

builder.Services.AddSwaggerGen(c =>
{
    c.OperationFilter<AddActionNameAsOperationIdOperationFilter>();
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.1.0.33 130 1/21/2026
1.1.0.32 133 1/21/2026
1.1.0.26 109 8/2/2025
1.1.0.25 96 8/2/2025
1.1.0.24 200 5/26/2025
1.1.0.23 190 5/26/2025
1.1.0.22 197 5/26/2025
1.1.0.21 195 5/26/2025
1.1.0.20 206 5/7/2025
1.1.0.19 210 3/10/2025