Skip to content

Fix codegen for HTTP endpoints with Startup.Configure() pattern#2366

Merged
jeremydmiller merged 1 commit intomainfrom
fix-codegen-startup-style
Mar 29, 2026
Merged

Fix codegen for HTTP endpoints with Startup.Configure() pattern#2366
jeremydmiller merged 1 commit intomainfrom
fix-codegen-startup-style

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

Fixes #2363

  • Root cause: When using the old ASP.NET Core Startup.Configure() hosting pattern, MapWolverineEndpoints() is called during host startup — not during Build(). The JasperFx codegen command only called Build(), so Configure() never ran and HTTP endpoints were never discovered.
  • Fix: Upgrades JasperFx to 1.22.0 which adds a --start flag to the codegen command. Running dotnet run -- codegen write --start starts the host before code generation, ensuring Startup.Configure() executes and all HTTP endpoints are discovered.
  • Sample project: Adds StartupStyleTarget in src/Http/ that uses the old Startup pattern and validates the fix — codegen write --start generates both GET_api_test.cs and POST_api_items.cs.

Usage for affected users

# Instead of:
dotnet run -- codegen write

# Use:
dotnet run -- codegen write --start

Test plan

  • dotnet run -- codegen write on StartupStyleTarget produces no HTTP files (reproduces bug)
  • dotnet run -- codegen write --start on StartupStyleTarget produces both GET_api_test.cs and POST_api_items.cs (fix works)
  • Existing CodeGenTarget project (modern style) continues to work without --start

🤖 Generated with Claude Code

Fixes #2363

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codegen is not generating a class for Wolverine.Http endpoint

1 participant