-
-
Notifications
You must be signed in to change notification settings - Fork 158
Fix: crash when deserializing post with relationship to abstract base class #833
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
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
2649203
feat: resource inheritance compatabiliy
maurei 9104cb9
test: fix and add new tests
maurei a49a99e
feat: finished resource inheritance
maurei b8837da
fix: whitespace
maurei 8a7392c
fix: tests
maurei 1a8f41b
chore: review
maurei 172126e
feat: improved inheritance support. Partially doneE
maurei 0d20475
fix: tests
maurei b4649b3
chore: revert unnecessary changes
maurei 198ffcf
test: reveal issue with filtering
maurei c0d3994
fix: better error handling inheritance bug
maurei a8d296f
chore: rename tests
maurei 1ded442
chore: ignore tests for unsupported features
maurei 03cfb07
fix: inheritance support in response deserializer
maurei 0c7f327
fix: overlapping tests
maurei 6c76785
fix: white space
maurei 632fe53
Merge branch 'master' into fix/696
753a5bf
chore: review
maurei 431d8aa
chore: remove suggestive tests
maurei d717614
merge
maurei 1f393f6
fix: more intuitive test models
maurei 5dab42d
fix: more intuitive test models
maurei 27cc727
fix: renamed
maurei 365cd32
fix: tests
maurei 0193d40
Merge branch 'master' into fix/696
c1a5b71
review
maurei 59ce978
fix: remove unused controllers
maurei 3f4079d
Merge branch 'fix/696' of https://github.com/json-api-dotnet/JsonApiD…
maurei f20fe5f
fix: undo unwanted remove
maurei 273ddf7
review
maurei a4c1d55
fix: disable warning
maurei 44a607e
fix: rename models
maurei e2569ba
fix: review
maurei b5ac3ee
fix: review
maurei d127188
fix: examples
maurei 88b1de6
fix
maurei 3fef707
improved example
maurei b39a9b8
fix: unused ref
maurei c1f8c30
fix: improve examples
maurei bd9ad25
review
maurei 6ccb4bd
fix tests
maurei e76b437
fix: tests
maurei 2fe2b40
fix
maurei c657bb5
fix
maurei 7f53304
fix: review
maurei 8ce063c
fix: verified lambda parameter names for consistency
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
18 changes: 0 additions & 18 deletions
18
src/Examples/JsonApiDotNetCoreExample/Controllers/KebabCasedModelsController.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
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
41 changes: 41 additions & 0 deletions
41
...sonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceDbContext.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,41 @@ | ||
using JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance.Models; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance | ||
{ | ||
public sealed class InheritanceDbContext : DbContext | ||
{ | ||
public InheritanceDbContext(DbContextOptions<InheritanceDbContext> options) : base(options) { } | ||
|
||
public DbSet<Human> Humans { get; set; } | ||
|
||
public DbSet<Man> Men { get; set; } | ||
|
||
public DbSet<CompanyHealthInsurance> CompanyHealthInsurances { get; set; } | ||
|
||
public DbSet<ContentItem> ContentItems { get; set; } | ||
|
||
public DbSet<HumanFavoriteContentItem> HumanFavoriteContentItems { get; set; } | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.Entity<Human>() | ||
.HasDiscriminator<int>("Type") | ||
.HasValue<Man>(1) | ||
.HasValue<Woman>(2); | ||
|
||
modelBuilder.Entity<HealthInsurance>() | ||
.HasDiscriminator<int>("Type") | ||
.HasValue<CompanyHealthInsurance>(1) | ||
.HasValue<FamilyHealthInsurance>(2); | ||
|
||
modelBuilder.Entity<ContentItem>() | ||
.HasDiscriminator<int>("Type") | ||
.HasValue<Video>(1) | ||
.HasValue<Book>(2); | ||
|
||
modelBuilder.Entity<HumanFavoriteContentItem>() | ||
.HasKey(hfci => new { ContentPersonId = hfci.ContentItemId, PersonId = hfci.HumanId }); | ||
} | ||
} | ||
} |
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.