File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 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) {
4545 // ...
4646 }
4747```
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 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
3- <VersionPrefix >2.1.3 </VersionPrefix >
3+ <VersionPrefix >2.1.4 </VersionPrefix >
44 <TargetFrameworks >netstandard1.6</TargetFrameworks >
55 <AssemblyName >JsonApiDotNetCore</AssemblyName >
66 <PackageId >JsonApiDotNetCore</PackageId >
You can’t perform that action at this time.
0 commit comments