File tree 2 files changed +37
-1
lines changed
2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -45,3 +45,39 @@ public IServiceProvider ConfigureServices(IServiceCollection services) {
45
45
// ...
46
46
}
47
47
```
48
+
49
+ ## Relative Links
50
+
51
+ All links are absolute by default. However, you can configure relative links:
52
+
53
+ ``` csharp
54
+ public IServiceProvider ConfigureServices (IServiceCollection services ) {
55
+ services .AddJsonApi <AppDbContext >(
56
+ opt => opt .RelativeLinks = true );
57
+ // ...
58
+ }
59
+ ```
60
+
61
+
62
+ ``` http
63
+ GET /api/v1/articles/4309 HTTP/1.1
64
+ Accept: application/vnd.api+json
65
+ ```
66
+
67
+ ``` json
68
+ {
69
+ "type" : " articles" ,
70
+ "id" : " 4309" ,
71
+ "attributes" : {
72
+ "name" : " Voluptas iure est molestias."
73
+ },
74
+ "relationships" : {
75
+ "author" : {
76
+ "links" : {
77
+ "self" : " /api/v1/articles/4309/relationships/author" ,
78
+ "related" : " /api/v1/articles/4309/author"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ ```
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
<PropertyGroup >
3
- <VersionPrefix >2.1.3 </VersionPrefix >
3
+ <VersionPrefix >2.1.4 </VersionPrefix >
4
4
<TargetFrameworks >netstandard1.6</TargetFrameworks >
5
5
<AssemblyName >JsonApiDotNetCore</AssemblyName >
6
6
<PackageId >JsonApiDotNetCore</PackageId >
You can’t perform that action at this time.
0 commit comments