Skip to content

Consolidate ConNeg requirements into the LWS Media Type Section#190

Open
ebremer wants to merge 2 commits into
mainfrom
contentneg
Open

Consolidate ConNeg requirements into the LWS Media Type Section#190
ebremer wants to merge 2 commits into
mainfrom
contentneg

Conversation

@ebremer

@ebremer ebremer commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Resolves #91


Preview | Diff

@ebremer ebremer requested a review from acoburn July 7, 2026 05:17
Comment on lines 7 to +17
#### Content Negotiation

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:

- If a client requests `application/lws+json`, the server MUST respond with `Content-Type: application/lws+json`.
- If a client requests `application/ld+json`, the server MUST respond with `Content-Type: application/ld+json`.
- If a client requests `application/json`, the server MUST respond with `Content-Type: application/json`.

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.
In all three cases, the response body is the same JSON-LD document conforming to the <a>container representation</a> structure defined in [](#container-representation). Servers MAY support additional media types through content negotiation.

Because the `Content-Type` of these responses varies with the request's `Accept` header, responses subject to content negotiation SHOULD include a `Vary: Accept` header [[!RFC9110]].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we are incorrect in describing this as content-negotiation.

It would be more accurate to say that these media types are treated as equivalent. Content negotiation is more commonly used for negotiating between different representations (e.g. image/jpeg vs image/png or application/n-triples vs text/turtle): representations whose body is encoded differently.

Here, we are saying that HTTP entity bodies with the media type application/lws+json are treated as equivalent to entity bodies with the media types application/ld+json and application/json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling of content-negotiation on resources in LWS

3 participants