Skip to content

Commit b6bed3d

Browse files
committed
feat: define application/lws+json as default container media type
Define application/lws+json as the default media type for container representations, equivalent to application/ld+json with the LWS profile. Servers must return the same payload for application/lws+json, application/ld+json, and application/json — only the Content-Type header varies. Update IANA considerations with profile parameter, security considerations, and equivalence note following the Activity Streams precedent.
1 parent e8dba98 commit b6bed3d

4 files changed

Lines changed: 49 additions & 12 deletions

File tree

lws10-core/IANA-Considerations.html

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,55 @@ <h3>OAuth Authorization Server Metadata Registry</h3>
4545
</section>
4646

4747
<section id="iana-media-type-registry">
48-
<h3>Media Type Registry</h3>
48+
<h3>The <code>application/lws+json</code> Media Type</h3>
4949

5050
<p>
51-
This specification registers the <code>application/lws+json</code> media type for identifying documents conforming to the
52-
linked web storage document format.
51+
This specification registers the <code>application/lws+json</code> media type specifically for identifying documents
52+
conforming to the Linked Web Storage container format.
5353
</p>
5454

5555
<ul>
5656
<li>
57-
Type Name: application
57+
Type name: application
5858
</li>
5959
<li>
60-
Subtype Name: lws+json
60+
Subtype name: lws+json
6161
</li>
6262
<li>
63-
Required parameter: None
63+
Required parameters: None
64+
</li>
65+
<li>
66+
Optional parameters: <b>profile</b>: The profile parameter for the <code>application/lws+json</code> media type allows
67+
one or more profile URIs to be specified. These profile URIs have the identifier semantics defined in [[RFC6906]].
68+
The "profile" media type parameter MUST be quoted. It contains a non-empty list of space-separated URIs (the profile URIs).
69+
<pre>
70+
profile-param = "profile=" profile-value
71+
profile-value = &lt;"&gt; profile-URI 0*( 1*SP profile-URI ) &lt;"&gt;
72+
profile-URI = URI
73+
</pre>
74+
The "URI" in the above grammar refers to the "URI" as defined in Section 3 of [[RFC3986]].
6475
</li>
6576
<li>
6677
Encoding considerations: Resources that use the <code>application/lws+json</code> media type are required to conform to
6778
all of the requirements for the <code>application/json</code> media type and are therefore subject to the same encoding
6879
considerations specified in Section 11 of [[RFC8259]].
6980
</li>
7081
<li>
71-
Contact: W3C Linked Web Storage Working Group public-lws-wg@w3.org
82+
Security considerations: As defined in this specification.
83+
</li>
84+
<li>
85+
Contact: W3C Linked Web Storage Working Group &lt;public-lws-wg@w3.org&gt;
7286
</li>
7387
</ul>
88+
89+
<p>
90+
Note that while the Linked Web Storage format uses JSON-LD conventions, there are a number of constraints and additional
91+
requirements for LWS implementations that justify the use of a specific media type.
92+
</p>
93+
94+
<p>
95+
Because LWS containers can be considered a restricted profile of JSON-LD, implementations SHOULD consider the
96+
<code>application/ld+json; profile="https://www.w3.org/ns/lws/v1"</code> media type as equivalent to
97+
<code>application/lws+json</code>.
98+
</p>
7499
</section>

lws10-core/Operations/read-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Accept: application/ld+json
5151
Assuming the container exists and the client has access:
5252
```
5353
HTTP/1.1 200 OK
54-
Content-Type: application/ld+json; profile="https://www.w3.org/ns/lws/v1"
54+
Content-Type: application/lws+json
5555
ETag: "container-etag-789"
5656
Link: </alice/notes/.meta>; rel="linkset"; type="application/linkset+json"
5757
Link: </alice/>; rel="up"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
For each core operation (create, read, update, delete), we describe the HTTP method(s) to use, required headers or special considerations (including concurrency controls via ETags, content negotiation, and pagination for container listings), and what the server should do and return. Standard HTTP status codes are used to indicate outcomes with additional mappings for scenarios such as quota exceeded (507 Insufficient Storage) or precondition failures (412 Precondition Failed). The binding tries to adhere to HTTP/1.1 and relevant RFCs (such as [[!RFC7231]] for HTTP semantics, [[!RFC7233]] for range requests, [[!RFC5789]] for PATCH, [[!RFC8288]] for Web Linking, and [[!RFC9264]] for Link Sets) so that it integrates naturally with web standards. Discoverability is emphasized through mechanisms like Link headers and WWW-Authenticate headers on 401 responses, avoiding hardcoded URI locations. Metadata integration is required across operations, ensuring atomicity and use of Link Sets for server-managed and user-managed properties.
22

3-
**Note:** As all examples in this specifications, examples given in this section (HTTP request and response snippets) are **non-normative**, meant to illustrate typical usage. The actual requirements are stated in the descriptive text and tables. Also, while this binding covers HTTP (as the initial target protocol), the LWS operations could in principle be bound to other protocols in the future. Servers SHOULD support content negotiation for formats like JSON-LD (with normative contexts for containers) and Turtle, using the LWS media type `application/ld+json; profile="https://www.w3.org/ns/lws/v1"` for container representations.
3+
**Note:** As all examples in this specifications, examples given in this section (HTTP request and response snippets) are **non-normative**, meant to illustrate typical usage. The actual requirements are stated in the descriptive text and tables. Also, while this binding covers HTTP (as the initial target protocol), the LWS operations could in principle be bound to other protocols in the future. Servers MUST support content negotiation for `application/lws+json`, `application/ld+json`, and `application/json` for container representations (see [Container Media Type](#container-media-type)). Servers MAY additionally support formats like Turtle.

lws10-core/container-media-type.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
### Container Media Type
22

3-
Container representations MUST be served using the following media type:
3+
The default media type for LWS container representations is:
44

55
```
6-
application/ld+json; profile="https://www.w3.org/ns/lws/v1"
6+
application/lws+json
77
```
88

9-
This media type indicates a JSON-LD document conforming to the LWS container vocabulary. Servers MUST use this media type in the `Content-Type` header when responding to requests for container resources. Clients MUST use this media type in the `Content-Type` header when creating new containers.
9+
While LWS container representations use JSON-LD conventions, the constraints and requirements for LWS justify the use of a specific media type. Because LWS containers can be considered a restricted profile of JSON-LD, implementations SHOULD consider the `application/ld+json; profile="https://www.w3.org/ns/lws/v1"` media type as equivalent to `application/lws+json`.
10+
11+
#### Content Negotiation
12+
13+
Servers MUST support content negotiation for container representations. The response payload MUST be identical regardless of the requested media type — only the `Content-Type` response header varies:
14+
15+
- If a client requests `application/lws+json`, the server MUST respond with `Content-Type: application/lws+json`.
16+
- If a client requests `application/ld+json`, the server MUST respond with `Content-Type: application/ld+json`.
17+
- If a client requests `application/json`, the server MUST respond with `Content-Type: application/json`.
18+
19+
In all three cases, the response body is the same JSON-LD document conforming to the LWS container vocabulary. Servers are free to support additional media types (e.g., `text/turtle`) through content negotiation.
20+
21+
#### Processing as JSON
1022

1123
Although container representations are valid JSON-LD, clients MAY process them as plain JSON without invoking a full JSON-LD processor. The `@context` property in the representation provides the mapping to the LWS vocabulary, but all property names used in container representations are short, predictable tokens (e.g., `id`, `type`, `items`, `totalItems`) that can be consumed directly as JSON keys.

0 commit comments

Comments
 (0)