-
-
Notifications
You must be signed in to change notification settings - Fork 158
Added support for bulk/batch requests (atomic:operations) #930
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
Merged
Conversation
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
Reverted operations-related changes from #571
…tly enabled when the appropriate controller is added to the project.
…t.IsBulkRequest to EndpointKind.AtomicOperations
…r)" to investigate why cibuild hangs This reverts commit d3ff09a.
This reverts commit 38c127a.
…yStrings subfolder and auto-adjusted namespaces.
…t, so they can share private models with integration tests for query strings. They are likely to evolve simultaneously, so I prefer not to make a copy of them. Renamed Blog to LegacyBlog in preparation for refactoring to make query string tests run against private models. LegacyBlog is going away at the end.
…ges: LegacyBlog -> Blog Title -> Title CompanyName -> PlatformName HasMany Articles -> Posts HasOne Owner -> Owner Article -> BlogPost Caption -> Caption Url -> Url HasOne Author -> Author + HasOne Reviewer HasManyThrough Tags -> Labels HasMany Revisions -> Comments HasOne Blog -> Parent Tag -> Label Name -> Name Color -> Color HasManyThrough Articles -> Posts Revision -> Comment + Text PublishTime -> CreatedAt HasOne Author -> Author HasOne Article -> Parent Author -> WebAccount FirstName/LastName -> UserName/DisplayName + Password DateOfBirth -> DateOfBirth BusinessEmail -> EmailAddress LivingAddress -> Preferences HasMany Articles -> Posts Address -> AccountPreferences + UseDarkTheme
maurei
suggested changes
Feb 7, 2021
src/JsonApiDotNetCore/Serialization/AtomicOperationsResponseSerializer.cs
Show resolved
Hide resolved
maurei
reviewed
Feb 8, 2021
maurei
reviewed
Feb 9, 2021
maurei
reviewed
Feb 9, 2021
maurei
approved these changes
Feb 9, 2021
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.
Introduction
This PR implements the Atomic Operations JSON:API extension, which defines how to perform multiple write operations in a linear and atomic manner.
Clients can send an array of operations in a single request. JsonApiDotNetCore guarantees that those operations will be processed in order and will either completely succeed or fail together.
For more details, see the updated documentation in this PR.
How it works
The request execution pipeline for operations is the following:
RequestDeserializer
->OperationsController
(new) ->OperationsProcessor
(new) ->ResourceService
->ResourceRepository
->ResponseSerializer
The deserializer and serializer have been updated to understand the new document structure. A new controller type performs ASP.NET ModelState validation on all operations upfront and then delegates to the processor. The processor starts a database transaction and loops over the operations in the list. For each operation, the associated service is called. From there, it follows the usual flow for single-resource requests. After all operations have been processed, the processor commits the transaction.
Fixes #936.
Fixes #247.