Skip to content

Remove profile aliasing from 1.1-rc2 #1412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 9 additions & 54 deletions _format/1.1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,22 +562,15 @@ related resource collection:
#### <a href="#profile-links" id="profile-links" class="headerlink"></a> Profile Links

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

Here, the `profile` key specifies an array of `profile` links, including one
that includes a [profile alias][profile aliases]:
Here, the `profile` key specifies an array of `profile` links:

```json
"links": {
"profile": [
"http://example.com/profiles/flexible-pagination",
{
"href": "http://example.com/profiles/resource-versioning",
"aliases": {
"version": "v"
}
}
"http://example.com/profiles/resource-versioning"
]
}
```
Expand Down Expand Up @@ -2028,19 +2021,18 @@ https://example.com/?page[cursor]=xyz&profile=https://example.com/pagination-pro
```


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

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

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

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

Expand Down Expand Up @@ -2088,42 +2080,6 @@ This profile might be applied as follows:
}
```

Documents that apply a particular profile **MAY** represent each keyword with an
alternatively named member, or "alias". An alias fully assumes any meaning
specified for a keyword, which no longer retains that meaning. Any aliases
associated with a profile **MUST** be represented in the profile's corresponding
`aliases` object within its [link object][links]. The key of each alias **MUST**
be a keyword from the profile, and the value **MUST** be an alias that applies
to this particular representation. This aliasing mechanism allows profiles to be
applied in a way that is both consistent with the rest of the representation and
does not conflict with other profiles.

For instance, the following document provides an alias for `version`: `v`.
Interpreters of this representation should treat the key `v` as if it were the
key `version` described in the profile:

```json
{
"data": {
"type": "contacts",
"id": "345",
"meta": {
"v": "2018-04-14-879976658"
},
"attributes": {
"name": "Ethan"
}
},
"links": {
"profile": [{
"href": "http://example.com/profiles/resource-versioning",
"aliases": {
"version": "v"
}
}]
}
}
```

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

Expand Down Expand Up @@ -2287,8 +2243,7 @@ that "The elements... specified by a profile... **MUST NOT** change over time."

> The practical issue with adding a sibling element is that another profile
> in use on the document might already define a sibling element of the same
> name, and existing documents would not have any aliases defined to resolve
> this conflict.
> name.

However, the timestamps profile could evolve to allow other optional members,
such as `deleted`, in the `timestamps` object. This is possible because the
Expand Down Expand Up @@ -2435,7 +2390,7 @@ request as equivalent to one in which the square brackets were percent-encoded.
[link object]: #document-links-link-object
[profiles]: #profiles
[timestamps profile]: #profiles-timestamp-profile
[profile aliases]: #profile-keywords-and-aliases
[profile keywords]: #profile-keywords
[error details]: #errors
[error object]: #error-objects
[error objects]: #errror-objects
Expand Down
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