-
-
Notifications
You must be signed in to change notification settings - Fork 158
Feature/request meta #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t at JsonApiOutputFormatter removes logic from JsonApiOutputFormatter and into JsonApiWriter. this also reduces the large method parameter requirements throughout the affected classes
…root at JsonApiInputFormatter removes logic from the input formatter and into JsonApiReader. Significantly reduces coupling of concrete types.
This is not a significant breaking change, but does affect the serialization APIs which may be used by tests
@@ -57,7 +57,7 @@ public RepositoryOverrideTests(DocsFixture<Startup, JsonDocWriter> fixture) | |||
// act | |||
var response = await client.SendAsync(request); | |||
var responseBody = await response.Content.ReadAsStringAsync(); | |||
var deserializedBody = JsonApiDeSerializer.DeserializeList<TodoItem>(responseBody, jsonApiContext, _fixture.GetService<AppDbContext>()); | |||
var deserializedBody = _fixture.GetService<IJsonApiDeSerializer>().DeserializeList<TodoItem>(responseBody); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only "breaking" changes here are Serialization/DeSerialization APIs. I would consider this a breaking change because it may be used in tests. This is a much needed change that helps to de-couple concrete types.
I implemented it in this PR because allowing an IRequestMeta
service to be injected and used by the DocumentBuilder
would require an extra call to HttpContext.RequestServices.GetService<TService>()
.
These changes reduce the number of times we have to go back to the container. We now define 3 distinct composition roots from which all services resolve:
JsonApiInputFormatter
JsonApiController
JsonApiOutputFormatter
Closes #56