Skip to content

Commit 3a08b94

Browse files
authored
Merge pull request json-api#1412 from json-api/remove-aliases
Remove profile aliasing from 1.1-rc2
2 parents fb51d8e + dbb74da commit 3a08b94

File tree

1 file changed

+9
-54
lines changed

1 file changed

+9
-54
lines changed

_format/1.1/index.md

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -561,22 +561,15 @@ related resource collection:
561561
#### <a href="#profile-links" id="profile-links" class="headerlink"></a> Profile Links
562562

563563
Like all [links][link], a link in an array of `profile` links can be represented
564-
with a [link object]. In that case, the link object **MAY** contain an `aliases`
565-
member listing any [profile aliases].
564+
with a [link object].
566565

567-
Here, the `profile` key specifies an array of `profile` links, including one
568-
that includes a [profile alias][profile aliases]:
566+
Here, the `profile` key specifies an array of `profile` links:
569567

570568
```json
571569
"links": {
572570
"profile": [
573571
"http://example.com/profiles/flexible-pagination",
574-
{
575-
"href": "http://example.com/profiles/resource-versioning",
576-
"aliases": {
577-
"version": "v"
578-
}
579-
}
572+
"http://example.com/profiles/resource-versioning"
580573
]
581574
}
582575
```
@@ -2027,19 +2020,18 @@ https://example.com/?page[cursor]=xyz&profile=https://example.com/pagination-pro
20272020
```
20282021

20292022

2030-
### <a href="#profile-keywords-and-aliases" id="profile-keywords-and-aliases" class="headerlink"></a> Profile Keywords and Aliases
2023+
### <a href="#profile-keywords" id="profile-keywords" class="headerlink"></a> Profile Keywords
20312024

20322025
A profile **SHOULD** explicitly declare "keywords" for any elements that it
20332026
introduces to the document structure. If a profile does not explicitly declare a
20342027
keyword for an element, then the name of the element itself (i.e., its key in
20352028
the document) is considered to be its keyword. All profile keywords **MUST**
20362029
meet this specification's requirements for [member names].
20372030

2038-
For the purposes of aliasing, a profile's elements are defined shallowly.
20392031
In other words, if a profile introduces an object-valued document member, that
2040-
member is an element (and so subject to aliasing), but any keys in it are not
2041-
themselves elements. Likewise, if the profile defines an array-valued element,
2042-
the keys in nested objects within that array are not elements.
2032+
member is an element, but any keys in it are not themselves elements. Likewise,
2033+
if the profile defines an array-valued element, the keys in nested objects
2034+
within that array are not elements.
20432035

20442036
The following example profile defines a single keyword, `version`:
20452037

@@ -2087,42 +2079,6 @@ This profile might be applied as follows:
20872079
}
20882080
```
20892081

2090-
Documents that apply a particular profile **MAY** represent each keyword with an
2091-
alternatively named member, or "alias". An alias fully assumes any meaning
2092-
specified for a keyword, which no longer retains that meaning. Any aliases
2093-
associated with a profile **MUST** be represented in the profile's corresponding
2094-
`aliases` object within its [link object][links]. The key of each alias **MUST**
2095-
be a keyword from the profile, and the value **MUST** be an alias that applies
2096-
to this particular representation. This aliasing mechanism allows profiles to be
2097-
applied in a way that is both consistent with the rest of the representation and
2098-
does not conflict with other profiles.
2099-
2100-
For instance, the following document provides an alias for `version`: `v`.
2101-
Interpreters of this representation should treat the key `v` as if it were the
2102-
key `version` described in the profile:
2103-
2104-
```json
2105-
{
2106-
"data": {
2107-
"type": "contacts",
2108-
"id": "345",
2109-
"meta": {
2110-
"v": "2018-04-14-879976658"
2111-
},
2112-
"attributes": {
2113-
"name": "Ethan"
2114-
}
2115-
},
2116-
"links": {
2117-
"profile": [{
2118-
"href": "http://example.com/profiles/resource-versioning",
2119-
"aliases": {
2120-
"version": "v"
2121-
}
2122-
}]
2123-
}
2124-
}
2125-
```
21262082

21272083
### <a href="#profiles-processing" id="profiles-processing" class="headerlink"></a> Processing Profiled Documents/Requests
21282084

@@ -2286,8 +2242,7 @@ that "The elements... specified by a profile... **MUST NOT** change over time."
22862242

22872243
> The practical issue with adding a sibling element is that another profile
22882244
> in use on the document might already define a sibling element of the same
2289-
> name, and existing documents would not have any aliases defined to resolve
2290-
> this conflict.
2245+
> name.
22912246
22922247
However, the timestamps profile could evolve to allow other optional members,
22932248
such as `deleted`, in the `timestamps` object. This is possible because the
@@ -2434,7 +2389,7 @@ request as equivalent to one in which the square brackets were percent-encoded.
24342389
[link object]: #document-links-link-object
24352390
[profiles]: #profiles
24362391
[timestamps profile]: #profiles-timestamp-profile
2437-
[profile aliases]: #profile-keywords-and-aliases
2392+
[profile keywords]: #profile-keywords
24382393
[error details]: #errors
24392394
[error object]: #error-objects
24402395
[error objects]: #errror-objects

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy