File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,4 +286,7 @@ __pycache__/
286286* .btp.cs
287287* .btm.cs
288288* .odx.cs
289- * .xsd.cs
289+ * .xsd.cs
290+
291+ # Visual Studio Code
292+ /.vscode /
Original file line number Diff line number Diff line change 11# FINT.Model.Resource
22
33FINT Resource Model contains the core classes for FINT data models containing HATEOAS relations.
4+
5+ ## Usage
6+
7+ To add links to other resources, FINT resource classes contain ` addXXX(Link) ` methods for producing
8+ specific links.
9+
10+ Links are URIs, typically https URIs. The ` Link ` class has a static ` Link.with(String) ` that can be
11+ used if the full URI to the target is known.
12+
13+ ## Robust links
14+
15+ Full https URIs are sensitive to changes in the FINT API deployment configuration. To ensure that
16+ links are robust, the FINT APIs also support convenience methods that enables implementors to
17+ generate links when the target Java class is known. In these cases the methods
18+ ` Link.with(Link, String...) ` or ` Link.with(Type, String) ` come in handy. The first argument is the
19+ Java class of the target resource, so to link to a ` Person ` you use
20+ ` Link.with(typeof(Person), ...) ` .
21+
22+ The second parameter(s) are the path element that specify the identifier for the target. They are
23+ typically built using two fields, the name of the identifier field, and the identifier value. To
24+ produce a link to a ` Person ` with a ` fodselsnummer ` of ` 12345678901 ` , this becomes:
25+
26+ ``` csharp
27+ Link linktoPerson = Link .with (typeof (Person ), " fodselsnummer" , " 12345678901" );
28+ ```
You can’t perform that action at this time.
0 commit comments