Skip to content

Commit adedc20

Browse files
committed
fix(link-builder): relationship links included duplicate pathstrings
1 parent a43edb0 commit adedc20

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
- [ ] Ability to disable dasherization of names
2828
- [ ] Rename ContextEntity ??
2929

30+
# Generators
31+
32+
- TODO: Document usage of the yeoman jadn generator
33+
3034
## Usage
3135

3236
- Add Middleware

src/JsonApiDotNetCore/Builders/LinkBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ private string GetNamespaceFromPath(string path, string entityName)
3636

3737
public string GetSelfRelationLink(string parent, string parentId, string child)
3838
{
39-
return $"{_context.BasePath}/{parent.Dasherize()}/{parentId}/relationships/{child.Dasherize()}";
39+
return $"{_context.BasePath}/relationships/{child.Dasherize()}";
4040
}
4141

4242
public string GetRelatedRelationLink(string parent, string parentId, string child)
4343
{
44-
return $"{_context.BasePath}/{parent.Dasherize()}/{parentId}/{child.Dasherize()}";
44+
return $"{_context.BasePath}/{child.Dasherize()}";
4545
}
4646
}
4747
}

0 commit comments

Comments
 (0)