Skip to content

Add endpoint content type metadata#200

Open
ejsmith wants to merge 2 commits into
mainfrom
endpoint-metadata-overrides
Open

Add endpoint content type metadata#200
ejsmith wants to merge 2 commits into
mainfrom
endpoint-metadata-overrides

Conversation

@ejsmith
Copy link
Copy Markdown
Contributor

@ejsmith ejsmith commented May 18, 2026

Adds content-type metadata overrides for generated endpoints so migrations can preserve request and response media type declarations.

Summary:

  • Add AcceptsContentTypes and ProducesContentTypes to HandlerEndpointAttribute.
  • Carry content-type metadata through endpoint analysis and generated Minimal API metadata.
  • Emit .Accepts<T>() for body-bound endpoints.
  • Emit content-type arguments for generated success response metadata, using .Produces<T>() for typed responses and .Produces() for Result<FileResult> file downloads.
  • Cover class defaults, method overrides, multiple content types, and file response content types in endpoint generation tests.
  • Document the new endpoint properties and the file download use case.

Validation:

  • dotnet build Foundatio.Mediator.slnx
  • dotnet test Foundatio.Mediator.slnx

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.

1 participant