Skip to content

Commit c729913

Browse files
committed
refactor(query-set): error details for nested rel
1 parent 1dd7845 commit c729913

File tree

2 files changed

+4
-1
lines changed
  • src/JsonApiDotNetCore/Internal/Query
  • test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests

2 files changed

+4
-1
lines changed

src/JsonApiDotNetCore/Internal/Query/QuerySet.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ private List<SortQuery> ParseSortParameters(string value)
147147

148148
private List<string> ParseIncludedRelationships(string value)
149149
{
150+
if(value.Contains("."))
151+
throw new JsonApiException("400", "Deeply nested relationships are not supported");
152+
150153
return value
151154
.Split(',')
152155
.Select(s => s.ToProperCase())

test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public async Task Request_ToIncludeUnknownRelationship_Returns_400()
234234
}
235235

236236
[Fact]
237-
public async Task Request_ToIncludeRelationshipPath_Returns_400()
237+
public async Task Request_ToIncludeDeeplyNestedRelationships_Returns_400()
238238
{
239239
// arrange
240240
var person = _context.People.First();

0 commit comments

Comments
 (0)