-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1629 from json-api-dotnet/jsonapi-extensions-refa…
…ctor Refactorings for JSON:API extensions to unblock OpenAPI support
- Loading branch information
Showing
23 changed files
with
739 additions
and
75 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/JsonApiDotNetCore/Configuration/DefaultJsonApiApplicationBuilderEvents.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using JsonApiDotNetCore.Serialization.JsonConverters; | ||
|
||
namespace JsonApiDotNetCore.Configuration; | ||
|
||
internal sealed class DefaultJsonApiApplicationBuilderEvents : IJsonApiApplicationBuilderEvents | ||
{ | ||
private readonly IJsonApiOptions _options; | ||
|
||
public DefaultJsonApiApplicationBuilderEvents(IJsonApiOptions options) | ||
{ | ||
ArgumentGuard.NotNull(options); | ||
|
||
_options = options; | ||
} | ||
|
||
public void ResourceGraphBuilt(IResourceGraph resourceGraph) | ||
{ | ||
_options.SerializerOptions.Converters.Add(new ResourceObjectConverter(resourceGraph)); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/JsonApiDotNetCore/Configuration/IJsonApiApplicationBuilderEvents.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace JsonApiDotNetCore.Configuration; | ||
|
||
internal interface IJsonApiApplicationBuilderEvents | ||
{ | ||
void ResourceGraphBuilt(IResourceGraph resourceGraph); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.