Skip to content

Make InputFormatters and OutputFormatters implement IApiRequestFormatMetadataProvider #967

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

Closed
wants to merge 10 commits into from

Conversation

maurei
Copy link
Member

@maurei maurei commented Mar 11, 2021

  • JsonApiInputFormatter implements IApiRequestFormatMetadataProvider.
  • JsonApiOutputFormatter implements IApiResponseFormatMetadataProvider.
  • Example test project has been adjusted so that for each test collection only controllers are registered that originate from the same namespace, rather than loading all the controllers from the entire test assembly.

@maurei maurei requested review from bart-degreed and removed request for bart-degreed March 11, 2021 16:07

private bool IsAtomicOperationsType(Type objectType)
{
return objectType.GetInterface(nameof(IEnumerable)) != null && objectType.GetGenericArguments().First() == _operationContainerType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to try why such complex logic is needed, instead of the obvious typeof(IList<OperationContainer>), but there are no tests. Add some tests first, please.

@@ -5,8 +5,8 @@

namespace JsonApiDotNetCore.Middleware
{
/// <inheritdoc />
public sealed class JsonApiInputFormatter : IJsonApiInputFormatter
/// <inheritdoc cref="JsonApiDotNetCore.Middleware.IJsonApiInputFormatter" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the cref is to disambiguate between the docs on JsonApiFormatter and IJsonApiInputFormatter. We haven't used this before, but perhaps we should start doing that. Does this work correctly in:

  • the generated documentation website?
  • IntelliSense in IDE when consuming our NuGet?

@maurei
Copy link
Member Author

maurei commented Mar 18, 2021

superseded by #969 and #972

@maurei maurei closed this Mar 18, 2021
@bart-degreed bart-degreed deleted the JsonApiInputFormatter-fix branch March 18, 2021 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants