Port typed streaming IResult types from Marten.AspNetCore#35
Merged
jeremydmiller merged 2 commits intomainfrom Apr 21, 2026
Merged
Port typed streaming IResult types from Marten.AspNetCore#35jeremydmiller merged 2 commits intomainfrom
jeremydmiller merged 2 commits intomainfrom
Conversation
Closes #32 Add three streaming IResult types to Polecat.AspNetCore for Minimal API endpoints: - StreamOne<T> — streams first matching document as JSON (200/404) - StreamMany<T> — streams JSON array of documents (always 200) - StreamAggregate<T> — streams latest event-sourced aggregate (200/404) All types implement IResult and IEndpointMetadataProvider for OpenAPI. Since Polecat doesn't have Marten's raw-JSON streaming path, documents are materialized via the regular query path then serialized to the response. A later enhancement can swap to true streaming once Polecat grows one. 6 Alba integration tests covering: hit, 404, JSON array, empty array, aggregate projection, and unknown aggregate ID. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Restore EnableCorrelationId and EnableCausationId in Program.cs (removed accidentally, broke mcp_endpoint_tests assertions) - Apply schema migration in streaming tests InitializeAsync so event store tables exist on fresh CI databases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32
Summary
Port the three typed streaming
IResulttypes from Marten.AspNetCore to Polecat.AspNetCore:StreamOne<T>— streams first matching document as JSON (200/404)StreamMany<T>— streams JSON array of all matching documents (always 200, empty[]if none)StreamAggregate<T>— streams latest event-sourced aggregate state (200/404)All types implement
IResult(for Minimal API dispatch) andIEndpointMetadataProvider(for OpenAPI metadata). Each exposesOnFoundStatusandContentTypeasinit-only properties.Since Polecat doesn't have Marten's raw-JSON streaming path yet, these materialize documents via the regular query path then serialize with
System.Text.Json. A later enhancement can swap to a true deserialize-free streaming path.Test plan
stream_one_returns_200_with_document— hit casestream_one_returns_404_when_not_found— miss casestream_many_returns_200_with_json_array— multiple docsstream_many_returns_empty_array_when_no_results— empty setstream_aggregate_returns_200_with_aggregate— event-sourced hitstream_aggregate_returns_404_for_unknown_id— event-sourced miss🤖 Generated with Claude Code