8000 Allow JSON LD to be used with JSON API by ethanresnick · Pull Request #995 · json-api/json-api · GitHub
[go: up one dir, main page]

Skip to content

Allow JSON LD to be used with JSON API #995

8000
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
Apr 6, 2016
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions _format/1.1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,26 @@ The following characters **MUST NOT** be used in member names:
- U+007F DELETE
- U+0000 to U+001F (C0 Controls)

#### <a href="#document-member-names-at-members" id="document-member-names-at-members" class="headerlink"></a> @-Members

Member names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, "@").
Members named this way are called "@-Members". @-Members **MAY** appear
anywhere in a JSON API document.

However, JSON API processors **MUST** completely ignore @-Members (i.e. not
treat them as JSON API data).

Moreover, the existence of @-Members **MUST** be ignored when interpreting all
JSON API definitions and processing instructions given outside of this
subsection. For example, an [attribute][attributes] is defined above as any
member of the attributes object. However, because @-Members must be ignored
when interpreting that definition, an @-Member that occurs in an attributes
object is not an attribute.

> Note: Among other things, "@" members can be used to add JSON-LD data to a
JSON API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)
to convey to JSON-LD clients that they contain JSON-LD data.

## <a href="#fetching" id="fetching" class="headerlink"></a> Fetching Data

Data, including resources and relationships, can be fetched by sending a
Expand Down
58 changes: 57 additions & 1 deletion _format/1.1/normative-statements.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ layout: null
{ "id": "member-name-globally-allowed", "type": "normative-statements" },
{ "id": "member-name-url-safe", "type": "normative-statements" },
{ "id": "member-name-allowed-characters", "type": "normative-statements" },
{ "id": "member-name-reserved-characters", "type": "normative-statements" }
{ "id": "member-name-reserved-characters", "type": "normative-statements" },
{ "id": "member-name-at-members-definition", "type": "normative-statements" },
{ "id": "member-name-at-members-where", "type": "normative-statements" },
{ "id": "member-name-at-members-no-process", "type": "normative-statements" },
{ "id": "member-name-at-members-ignore-for-definitions", "type": "normative-statements" }
]
}
}
Expand Down Expand Up @@ -1002,6 +1006,58 @@ layout: null
}
}
},
{
"id": "member-name-at-members-definition",
"type": "normative-statements",
"attributes": {
"level": "MAY",
"description": "Member names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, \"@\"). Members named this way are called \"@-Members\"."
},
"relationships": {
"section": {
"data": { "id": "document-structure", "type": "sections" }
}
}
},
{
"id": "member-name-at-members-where",
"type": "normative-statements",
"attributes": {
"level": "MAY",
"description": "@-Members **MAY** appear anywhere in a JSON API document."
},
"relationships": {
"section": {
"data": { "id": "document-structure", "type": "sections" }
}
}
},
{
"id": "member-name-at-members-no-process",
"type": "normative-statements",
"attributes": {
"level": "MUST",
"description": "JSON API processors **MUST** completely ignore @-Members (i.e. not treat them as JSON API data)."
},
"relationships": {
"section": {
"data": { "id": "document-structure", "type": "sections" }
}
}
},
{
"id": "member-name-at-members-ignore-for-definitions",
"type": "normative-statements",
"attributes": {
"level": "MUST",
"description": "Moreover, the existence of @-Members **MUST** be ignored when interpreting all JSON API definitions and processing instructions given outside of the @-Members subsection."
},
"relationships": {
"section": {
"data": { "id": "document-structure", "type": "sections" }
}
}
},
{
"id": "fetch-url-support",
"type": "normative-statements",
Expand Down
0