Merged
Conversation
…ntation references
…ception types in PropertyMapper
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prepares the v2.0.0 release of TypedRequestContext by removing legacy aliases, refining middleware behavior (notably status codes and logging), improving mapping performance, and expanding documentation and tests around validation/propagation.
Changes:
- Update missing/invalid required header failures to return 400 (instead of 403), and adjust unit/integration tests accordingly.
- Improve request-context mapping/perf by compiling property setters and reusing conversion logic in propagation deserialization.
- Enhance propagation and validation coverage (new propagation validation tests) and update packages/docs/versioning for 2.0.0.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/TypedRequestContext.UnitTests/RequestContextCoreTests.cs | Updates expected status code for missing required header to 400. |
| tests/TypedRequestContext.Propagation.UnitTests/PropagationTests.cs | Adds propagation validation tests; adds infra import for validation exception types. |
| tests/TypedRequestContext.AspNetCore.IntegrationTests/RequestContextMiddlewareIntegrationTests.cs | Updates integration expectation for missing required header to 400/BadRequest. |
| src/TypedRequestContext/TypedRequestContext.csproj | Bumps core package version to 2.0.0. |
| src/TypedRequestContext/Middleware/RequestContextServiceCollectionExtensions.cs | Removes backward-compat aliases; switches to TryAddSingleton; doc reference fixes. |
| src/TypedRequestContext/Middleware/RequestContextMiddleware.cs | Improves error handling/logging when response has already started; updates alias mention in exception message. |
| src/TypedRequestContext/Infrastructure/PropertyMapper.cs | Compiles setters for faster mapping; changes header failures to 400; updates comments. |
| src/TypedRequestContext.Propagation/TypedRequestContext.Propagation.csproj | Bumps propagation package version to 2.0.0; adjusts Microsoft.Extensions.* package versions. |
| src/TypedRequestContext.Propagation/Infrastructure/PropagationHeadersProvider.cs | Adds serializer caching + singleton/scoped resolution strategy (but contains a scope-lifetime bug). |
| src/TypedRequestContext.Propagation/Infrastructure/AttributeBasedRequestContextDeserializer.cs | Reuses core conversion + compiled setters for propagation deserialization. |
| README.md | Updates docs for validation, non-HTTP flows, and revised status codes; expands examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/TypedRequestContext.Propagation/Infrastructure/PropagationHeadersProvider.cs
Outdated
Show resolved
Hide resolved
…zers and improve resource management
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.
Refactor the codebase by removing unused aliases and enhancing documentation. Update response status codes for missing headers to 400 and improve error logging. Add validation tests for context propagation and update the package version to 2.0.0.