File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,42 @@ defmodule JS2E.Types.TypeReference do
5
5
JSON Schema:
6
6
7
7
"self": {
8
- "$ref": "#/definitions/link "
8
+ "$ref": "#/definitions/foo "
9
9
}
10
10
11
- Where "#/definitions/link" resolves to
11
+ "other": {
12
+ "$ref": "http://www.example.com/definitions.json#bar"
13
+ }
14
+
15
+ Where "#/definitions/foo" resolves to
12
16
13
17
"definitions": {
14
- "link": {
15
- "type": "string"
16
- }
18
+ "foo": {
19
+ "type": "string"
20
+ }
21
+ }
22
+
23
+ and "http://www.example.com/definitions.json#bar" resolves to
24
+
25
+ "definitions": {
26
+ "bar": {
27
+ "id": "#bar",
28
+ "type": "number"
29
+ }
17
30
}
18
31
19
32
Elixir intermediate representation:
20
33
21
34
%TypeReference{name: "self",
22
35
path: ["#", "definitions", "link"]}
23
36
37
+ %TypeReference{name: "other",
38
+ path: %URI{scheme: "http",
39
+ host: "www.example.com",
40
+ path: "/definitions.json",
41
+ fragment: "bar",
42
+ ...}}
43
+
24
44
"""
25
45
26
46
alias JS2E.Types
You can’t perform that action at this time.
0 commit comments