Skip to content

Commit 6baa6d5

Browse files
author
Peter Amstutz
committed
Fix formatting.
1 parent 0960222 commit 6baa6d5

File tree

3 files changed

+313
-313
lines changed

3 files changed

+313
-313
lines changed
Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,112 @@
1-
## Import
2-
3-
During preprocessing traversal, an implementation must resolve `$import`
4-
directives. An `$import` directive is an object consisting of exactly one
5-
field `$import` specifying resource by URI string. It is an error if there
6-
are additional fields in the `$import` object, such additional fields must
7-
be ignored.
8-
9-
The URI string must be resolved to an absolute URI using the link
10-
resolution rules described previously. Implementations must support
11-
loading from `file`, `http` and `https` resources. The URI referenced by
12-
`$import` must be loaded and recursively preprocessed as a Salad document.
13-
The external imported document does not inherit the context of the
14-
importing document, and the default base URI for processing the imported
15-
document must be the URI used to retrieve the imported document. If the
16-
`$import` URI includes a document fragment, the fragment must be excluded
17-
from the base URI used to preprocess the imported document.
18-
19-
Once loaded and processed, the `$import` node is replaced in the document
20-
structure by the object or array yielded from the import operation.
21-
22-
URIs may reference document fragments which refer to specific an object in
23-
the target document. This indicates that the `$import` node must be
24-
replaced by only the object with the appropriate fragment identifier.
25-
26-
It is a fatal error if an import directive refers to an external resource
27-
or resource fragment which does not exist or is not accessible.
28-
29-
### Import example
30-
31-
import.yml:
32-
```
33-
{
34-
"hello": "world"
35-
}
36-
37-
```
38-
39-
parent.yml:
40-
```
41-
{
42-
"form": {
43-
"bar": {
44-
"$import": "import.yml"
45-
}
1+
## Import
2+
3+
During preprocessing traversal, an implementation must resolve `$import`
4+
directives. An `$import` directive is an object consisting of exactly one
5+
field `$import` specifying resource by URI string. It is an error if there
6+
are additional fields in the `$import` object, such additional fields must
7+
be ignored.
8+
9+
The URI string must be resolved to an absolute URI using the link
10+
resolution rules described previously. Implementations must support
11+
loading from `file`, `http` and `https` resources. The URI referenced by
12+
`$import` must be loaded and recursively preprocessed as a Salad document.
13+
The external imported document does not inherit the context of the
14+
importing document, and the default base URI for processing the imported
15+
document must be the URI used to retrieve the imported document. If the
16+
`$import` URI includes a document fragment, the fragment must be excluded
17+
from the base URI used to preprocess the imported document.
18+
19+
Once loaded and processed, the `$import` node is replaced in the document
20+
structure by the object or array yielded from the import operation.
21+
22+
URIs may reference document fragments which refer to specific an object in
23+
the target document. This indicates that the `$import` node must be
24+
replaced by only the object with the appropriate fragment identifier.
25+
26+
It is a fatal error if an import directive refers to an external resource
27+
or resource fragment which does not exist or is not accessible.
28+
29+
### Import example
30+
31+
import.yml:
32+
```
33+
{
34+
"hello": "world"
35+
}
36+
37+
```
38+
39+
parent.yml:
40+
```
41+
{
42+
"form": {
43+
"bar": {
44+
"$import": "import.yml"
4645
}
47-
}
46+
}
47+
}
4848
49-
```
49+
```
5050

51-
This becomes:
51+
This becomes:
5252

53-
```
54-
{
55-
"form": {
56-
"bar": {
57-
"hello": "world"
58-
}
59-
}
53+
```
54+
{
55+
"form": {
56+
"bar": {
57+
"hello": "world"
6058
}
61-
```
62-
63-
## Include
64-
65-
During preprocessing traversal, an implementation must resolve `$include`
66-
directives. An `$include` directive is an object consisting of exactly one
67-
field `$include` specifying a URI string. It is an error if there are
68-
additional fields in the `$include` object, such additional fields must be
69-
ignored.
70-
71-
The URI string must be resolved to an absolute URI using the link
72-
resolution rules described previously. The URI referenced by `$include` must
73-
be loaded as a text data. Implementations must support loading from
74-
`file`, `http` and `https` resources. Implementations may transcode the
75-
character encoding of the text data to match that of the parent document,
76-
but must not interpret or parse the text document in any other way.
77-
78-
Once loaded, the `$include` node is replaced in the document structure by a
79-
string containing the text data loaded from the resource.
80-
81-
It is a fatal error if an import directive refers to an external resource
82-
which does not exist or is not accessible.
83-
84-
### Include example
85-
86-
parent.yml:
87-
```
88-
{
89-
"form": {
90-
"bar": {
91-
"$include": "include.txt"
92-
}
59+
}
60+
}
61+
```
62+
63+
## Include
64+
65+
During preprocessing traversal, an implementation must resolve `$include`
66+
directives. An `$include` directive is an object consisting of exactly one
67+
field `$include` specifying a URI string. It is an error if there are
68+
additional fields in the `$include` object, such additional fields must be
69+
ignored.
70+
71+
The URI string must be resolved to an absolute URI using the link
72+
resolution rules described previously. The URI referenced by `$include` must
73+
be loaded as a text data. Implementations must support loading from
74+
`file`, `http` and `https` resources. Implementations may transcode the
75+
character encoding of the text data to match that of the parent document,
76+
but must not interpret or parse the text document in any other way.
77+
78+
Once loaded, the `$include` node is replaced in the document structure by a
79+
string containing the text data loaded from the resource.
80+
81+
It is a fatal error if an import directive refers to an external resource
82+
which does not exist or is not accessible.
83+
84+
### Include example
85+
86+
parent.yml:
87+
```
88+
{
89+
"form": {
90+
"bar": {
91+
"$include": "include.txt"
9392
}
94-
}
93+
}
94+
}
9595
96-
```
96+
```
9797

98-
include.txt:
99-
```
100-
hello world
98+
include.txt:
99+
```
100+
hello world
101101
102-
```
102+
```
103103

104-
This becomes:
104+
This becomes:
105105

106-
```
107-
{
108-
"form": {
109-
"bar": "hello world"
110-
}
111-
}
112-
```
106+
```
107+
{
108+
"form": {
109+
"bar": "hello world"
110+
}
111+
}
112+
```

schema_salad/metaschema/link_res.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
- |
22
## Link resolution
33
4-
The schema may designate one or more fields as link fields reference other
5-
objects. Processing must resolve links to either absolute URIs using the
6-
following rules:
7-
8-
* If a reference URI is prefixed with `#` it is a relative
9-
fragment identifier. It is resolved relative to the base URI by setting
10-
or replacing the fragment portion of the base URI.
11-
12-
* If a reference URI does not contain a scheme and is not prefixed with
13-
`#` it is a path relative reference. If the reference URI contains `#`
14-
in any position other than the first character, the reference URI must be
15-
divided into a path portion and a fragment portion split on the first
16-
instance of `#`. The path portion is resolved relative to the base URI
17-
by the following rule: if the path portion of the base URI ends in a
18-
slash `/`, append the path portion of the reference URI to the path
19-
portion of the base URI. If the path portion of the base URI does not
20-
end in a slash, replace the final path segment with the path portion of
21-
the reference URI. Replace the fragment portion of the base URI with the
22-
fragment portion of the reference URI.
23-
24-
* If a reference URI begins with a namespace prefix declared in
25-
`$namespaces` followed by a colon `:`, the prefix and colon must be replaced
26-
by the namespace declared in `$namespaces`.
27-
28-
* If a reference URI is an absolute URI consisting of a scheme and path,
29-
no processing occurs.
30-
31-
Link resolution must not affect the base URI used to resolve identifiers
32-
and other links.
33-
34-
### Link resolution example
4+
The schema may designate one or more fields as link fields reference other
5+
objects. Processing must resolve links to either absolute URIs using the
6+
following rules:
7+
8+
* If a reference URI is prefixed with `#` it is a relative
9+
fragment identifier. It is resolved relative to the base URI by setting
10+
or replacing the fragment portion of the base URI.
11+
12+
* If a reference URI does not contain a scheme and is not prefixed with `#`
13+
it is a path relative reference. If the reference URI contains `#` in any
14+
position other than the first character, the reference URI must be divided
15+
into a path portion and a fragment portion split on the first instance of
16+
`#`. The path portion is resolved relative to the base URI by the following
17+
rule: if the path portion of the base URI ends in a slash `/`, append the
18+
path portion of the reference URI to the path portion of the base URI. If
19+
the path portion of the base URI does not end in a slash, replace the final
20+
path segment with the path portion of the reference URI. Replace the
21+
fragment portion of the base URI with the fragment portion of the reference
22+
URI.
23+
24+
* If a reference URI begins with a namespace prefix declared in `$namespaces`
25+
followed by a colon `:`, the prefix and colon must be replaced by the
26+
namespace declared in `$namespaces`.
27+
28+
* If a reference URI is an absolute URI consisting of a scheme and path,
29+
no processing occurs.
30+
31+
Link resolution must not affect the base URI used to resolve identifiers
32+
and other links.
33+
34+
### Link resolution example
3535
3636
Given the following schema:
3737

0 commit comments

Comments
 (0)