claude-test/backend/ClaudeTest.API/ClaudeTest.API.csproj
Martin Švrčina 982b6d5fa6 Add NSwag for automatic TypeScript API client generation
- Replace Swashbuckle with NSwag.AspNetCore + NSwag.MSBuild
- Configure OpenAPI document in Program.cs via AddOpenApiDocument
- Add nswag.json: aspNetCoreToOpenApi → Axios TypeScript client
- Post-build target uses NSwagExe_Net80 to run on correct runtime
- Client generated to frontend/src/api/apiClient.ts (gitignored)
- Add axios to frontend dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 00:36:30 +01:00

28 lines
1001 B
XML

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ClaudeTest.Application\ClaudeTest.Application.csproj" />
<ProjectReference Include="..\ClaudeTest.Infrastructure\ClaudeTest.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NSwag.AspNetCore" Version="14.*" />
<PackageReference Include="NSwag.MSBuild" Version="14.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Target Name="NSwag" AfterTargets="Build">
<Exec Command="$(NSwagExe_Net80) run nswag.json /variables:Configuration=$(Configuration)" WorkingDirectory="$(ProjectDir)" />
</Target>
</Project>