-
-
Notifications
You must be signed in to change notification settings - Fork 158
Relationship endpoint bugfixes, implement POST and DELETE on to-many relationship link #851
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
Closed
Changes from all commits
Commits
Show all changes
274 commits
Select commit
Hold shift + click to select a range
3b82416
feat: implemented post and delete to-many by using refactored code of…
maurei f68e82e
chore: self review
maurei 7c84aed
feat: implemented new pipeline elements for the repository, performed…
maurei 4b500e9
fix: merge
maurei f4853af
chore: refactor
maurei fee6027
fix: remove test that is no longer expected to pass after refactor of…
maurei a30c62c
chore: self review
maurei baa649f
fix: test
maurei 90a2051
fix: failing test
maurei 9f5606f
chore: self review
maurei 7236fb4
Refactored AddRepositoryLayer/AddServiceLayer
fcc42b7
fix broken tests
5ea2ca5
fix logging
15c52a2
relationship renames and documentation
4d677a7
renamed exception
4d95ea3
First steps in error refactoring
5f2f430
removed comments
0a0612b
chore: refactor service layer
maurei a8222ef
chore: cleanup
maurei ad76ccb
fix: test error missing relationship assignment resources
maurei 1e8ebdd
feat: support for composite foreign keys
maurei e0be517
feat: return secondary resources from GetRelationshipAsync service pi…
maurei 37da563
fix broken build
ab5a05d
fix broken tests
07968fb
Cleanup RepositoryAccessor
222b831
Merge branch 'master' into feat/post-relationship-link-353
bc87317
TopFieldSelection
aa8ba92
fixes and cleanup
92f9eef
test: test cases for set RequestRelationship no longer relevant
maurei 1bf957e
tests: missing resources in relationship endpoint tests
maurei 790734b
Refactored mising resources in relationships at service layer
180779f
plural naming because it may affect multiple relationships
37d7489
Merge remote-tracking branch 'upstream/master' into feat/post-relatio…
9adeab9
fixed broken build
8f2b331
more cleanup
6058e5a
repository renames
3106f14
fixed test for composite foreign keys
25a1604
Temporary snapshot for work in progress...
a599f60
Rewrite of UpdatingRelationshipsTests to new syntax
140cb52
fixed broken test
754a05e
fixed broken test
2539126
refactored inverse navigation handling
672edfe
Merge branch 'master' into feat/post-relationship-link-353
8ba2cf6
fix: broken tests except for missing primary resource test
maurei 36baa5a
fix: merge
maurei ac0eec2
cleanup
92f7a92
fix test
6cff598
renames
c5e67a7
revert diff
e23b368
feat: remove excess inverse loading logic
maurei 230d712
Refactored CreatingDataTests to use new syntax
47ab72a
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
fe0e463
various comments
7705a38
added tests to ModelStateValidationTests for new endpoints
1fa1287
more cleanup
994ed05
test: skip injectable resource test until efcore 5 lands
maurei cb528e9
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei f26e88a
Merged tests
d3e2174
move/merge tests
e571406
isolated tests with composite primary key
7cff727
Added TODO
ea16a8b
clean; update test to allow deleting non-existing relationship
4140c6a
added remarks
66a173b
Merge
maurei 0bc914b
chore: replied to a Todo, removed flushing and simplified helper meth…
maurei 159b6d6
feat: add FK relationship assignment optimalization in case of relati…
maurei 18fae52
chore: refactor around SetRelationshipsAsync and UpdateAsync
maurei ebbf430
fix: debugged foreign key assignment optimization in repository
maurei e5ffdbc
fix: improved FK optimization
maurei 7686cbf
chore: refactor
maurei 50dd481
chore: cleanup
maurei e9ae2a0
cleanup
9059a57
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
a1a5736
comments
8e3ffb3
feat: remove dependency on foreign keys
maurei 7efe790
chore: worked through todos
maurei 44f454b
workaround for https://github.com/dotnet/efcore/issues/20502
a8b913d
fix: rename
maurei 967b97d
Comment
maurei a4e52de
chore: refactor
maurei ff564ec
chore: refactor using EnsureCompleteReplacement, add two todos
maurei a0fe2db
chore: add todo
maurei 44fd448
renames
eb0bcd9
changes on resource factory
a711f4f
chore: refactor proposal
maurei d2a06ad
chore: add comment
maurei acbf66f
chore: rename
maurei 3172e41
comments
764f033
fix: Todo item on NoContent in PatchAsync controller method
maurei 4bf60de
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
1627bef
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
0c4d3b6
revert: removed assertions on response body
78cb9cc
revert name changes
dfcd28d
Use ISet in public signatures
6d72a0c
made public
9e81c91
docs update
c8630bc
Refactored and isolated tests for resource creation (without relation…
411b52d
Added tests for create with relationships
067c553
feat: ISet in serializer, 204/200 return values post/patch
maurei cc728f4
feat: support post relationships endpoint for many-to-many
maurei b7a90b9
chore: review
maurei c5d0816
fix: additional logging flaky test
maurei 825d7db
chore: made GetManyValue internal
maurei a500a1d
Test improvements and cleanup. Removed TODO claiming that checking on…
7126be7
Replaced TODO with GitHub issue https://github.com/json-api-dotnet/Js…
b35b1a2
review
0a7805d
fix cibuild
844a886
added tests for delete resource
b72735a
more on tests
a3a1ffb
chore: review
maurei 3b36f8f
fix: resource factory null check
maurei 74aa64f
chore: review
maurei 515d778
chore: static setter ResourceFactory HasManyThroughAttribute
maurei f7e233f
revert
maurei fcd86e8
fix: Remove AsNoTracking in favour of explicit loading
maurei 2b9db0d
Moved tests from the wrong folder
4d1406f
fix test
9b29fd4
Tests for posting to HasMany relationship through relationship endpoint
d8096cf
fix flaky test
4bb8dd9
Deterministic fakers
272a102
Updates on TODOs
96562eb
reduced test duplication
f61b44f
Added tests for removing from to-many relationships through DELETE re…
7cd3ff0
tomany test tweaks
95f0e35
removed old test
04db10e
more on tests
a64cc14
rename test
5c4fa96
Fixed: let fakers generate different data on subsequent calls within …
d2421b8
Added tests for update to-one relationships through relationships end…
575d66a
Refactor tests: .Where(expr).FirstAsync() -> .FirstAsync(expr)
6a3ed79
Added tests for updating to-many relationships through relationships …
cb75a0b
fixed: missing null check
f2f8dcb
Fix for disabled test: Cannot_remove_for_relationship_mismatch_betwee…
f8a87d3
feat: remove already related resources from assignment with expressio…
maurei 016e0c6
fix: merge
maurei fff7aa1
cleanup
4fcc8e8
chore: improved GetFilteredThroughEntities call and reused it in Enab…
maurei 4ce2cd0
merge
maurei 00258f2
renames
ec31388
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
39fa101
Revert: commented-out code. This is needed to guard internal consiste…
e8db7fe
updated test
d68e584
Clarified documentation that PATCH replaces relationships.
d4787e9
added tests for missing cases
6d9ebff
changed tests order for consistency
b142258
Added tests for updating to-one relationships through primary endpoint
075b081
chore: review, remove resource factory, todos
maurei 4a83fad
chore: add todos
maurei 90368ec
Added tests for updating to-many relationships through primary endpoint
9536bcd
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
f6cb370
chore: review
maurei 4eac167
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei d850c6e
revert changes
8dd4ba3
added missing test
4af1e93
chore: add todos, draft bugfix deserializer id validation
maurei 4bc315f
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei 5274383
added missing test for create
333e3b0
added tests for updating resources without relationships
583ba50
chore: add review todos
maurei 258f224
feat: hook executor is no longer an optional dependency
maurei 04585d0
feat: hook executor is no longer an optional dependency
maurei 2351d2c
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei 45f4966
added tests for attribute type mismatch
6333be3
removed duplicate tests
fbcc23f
Added tests for missing request body; fixed tests for missing ID in body
590860b
cleanup assertions and fixed test name
b35edaf
merge
maurei 914c8a2
chore: add review todos
maurei 526a00e
chore: review todos
maurei 413479e
fix broken build
6d5a332
cleanup hooks
f8e2875
Use public name in error for setting read-only attribute.
430b018
Hooks: do not execute only if default non-empty implemenation is acti…
1b94084
FirstAsync TODOs
50614b8
revert whitespace changes
3d41f45
revert unneeded whitespace changes
55a345c
Clarified test names for blocked usage
d451fc5
Replacement of ToListAsync with FirstAsync in tests
a1bdbc4
Renamed WorkItem.AssignedTo to WorkItem.Assignee
258a2bc
test improvements
756b8ff
Fail with status Conflict for pre-existing resource ID in POST.
e078b7e
Fail when trying to update resource ID
13ad9f5
test: Can_create_resource_with_duplicate_HasOne_relationship_member t…
maurei da53b64
chore: remove finished todo
maurei e5eb798
chore: remove setting of FK in base deserializer
maurei 53f5cd6
Wrap hooks execution in facade that fits the needs of resource service.
f483990
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
9974b42
renamed test to match existing conventions
0ad8c8a
cleanup and revert changes
68f6a74
feat: draft for using raw queries in complete replacement
maurei 0ae089d
chore: remove draft, add todo about complete replacement performance …
maurei 17f93f6
removed duplicate test
eee289c
re-orderd tests
e405d31
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei 9804a93
chore: revert nuget package
maurei 394ce8e
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
4187065
chore: revert
maurei 59d6836
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei ce43c6e
revert: remove duplicate (it was not)
69038e1
feat: correct deletion of resources when EF Core deletion requires en…
maurei f2e2320
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei 6911398
refactor: remove use of RelatedIdMapper
maurei 81ca325
Fixed: attributes must never have optional constructor parameters
d38e8b2
added todo and revert whitespace changes
7e90f2c
added missing tests
8036daf
added more missing tests
b149365
review
maurei c85583c
review
maurei 8faf1d0
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei 87f2012
chore: remove commented out code
maurei 0bb759d
remove comments
644edba
added missing test
80d53b9
Removed unneeded Ignore: property already has NotMapped.
01cbcad
- Fixed: In POST resource, ?fields= must not influence change tracker…
885fb7e
added composite test (attr plus multiple relationships) for patch res…
1477a10
Split of CreateResourceWithRelationshipTests
493d7da
removed old test (duplicate)
f0c5c9f
replaced more old tests
34ac223
Removed TODO (these are implemented by Cannot_replace_on_relationship…
b6d4122
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei c0a52aa
fix: fix bug for update/create with include/fieldset
maurei 6b070e5
Remove explicit foreign key properties from models
c470289
cleanup example models
f17a90f
removed left-over todo
52a0421
Reduced usage of InvalidRequestBodyException
c9bcba8
feat: preview spec compliance in 404 remove from relationship endpoint
maurei 0e0f693
Moved throwing InvalidRequestBodyException out of resource service.
12e082f
fix: cleanup FlushFromCache
maurei a0cddab
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei f0cd7f0
fix: resource factory usage bug in static query building
maurei bfc6773
Wrap serialization errors
e688863
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
d110dfa
removed unneeded new whitespace
becb87d
comments
0673986
merge
maurei a263977
feat: ThroughEntityFilter service to abstract away getting of through…
maurei fbcdda2
chore: add overload to DataStoreUpdateException
maurei f0e5a1f
chore: renamed composite foreign key test to not repeat 'composite_fo…
maurei 08e5978
tests: added new composite foreign key tests
maurei 480cf30
test: composite foreign key relationship tests
maurei 2eac821
chore: review, revert accessor
maurei c731281
chore: rename Destination to Address in Dealership, fix IResourceRead…
maurei 596a331
cleanup
d7ba03d
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
896af96
fix: revert unneccesary changes, add validation test for document parser
maurei 3f15618
test: add clear one-to-one
maurei edccb59
post-merge fixes
73285dd
changed to offset for better coverage
bb5be51
Merge branch 'feat/post-relationship-link-353' of https://github.com/…
maurei cec8104
test: add clearing one-to-one tests
maurei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
18 changes: 18 additions & 0 deletions
18
src/Examples/JsonApiDotNetCoreExample/Models/IdentifiableArticleTag.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using JsonApiDotNetCore.Resources; | ||
using JsonApiDotNetCore.Resources.Annotations; | ||
|
||
namespace JsonApiDotNetCoreExample.Models | ||
{ | ||
public class IdentifiableArticleTag : Identifiable | ||
{ | ||
public int ArticleId { get; set; } | ||
[HasOne] | ||
public Article Article { get; set; } | ||
|
||
public int TagId { get; set; } | ||
[HasOne] | ||
public Tag Tag { get; set; } | ||
|
||
public string SomeMetaData { get; set; } | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
src/Examples/JsonApiDotNetCoreExample/Models/NonJsonApiResource.cs
This file was deleted.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace JsonApiDotNetCoreExample.Models | ||
{ | ||
public enum TagColor | ||
{ | ||
Red, | ||
Green, | ||
Blue | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.