use mime-type application/jsonl to align with openapi 3.2#51668
use mime-type application/jsonl to align with openapi 3.2#51668thaJeztah merged 1 commit intomoby:masterfrom
Conversation
api/types/types.go
Outdated
| MediaTypeJSON = "application/json" | ||
|
|
||
| // MediaTypeNDJSON is the MIME-Type for Newline Delimited JSON objects streams. | ||
| // MediaTypeNDJSON is the MIME-Type for Newline Delimited JSON objects streams (http://ndjson.org/). |
There was a problem hiding this comment.
We should probably use the GitHub repository for this, as it looks (also see the other discussion) that they let the domain expire, so it's now some unrelated website.
|
Trying to think what's the best way to implement this; currently this change is not versioned, and the daemon doesn't return an error if a new client would try to get this media-type on an older daemon, in which case it silently falls back to Of course, in practice, the response itself should still be fine, but it won't return the expected content-type :thinking_face: |
a409381 to
3b85c34
Compare
|
@thaJeztah engine does not check As long as response's Content-Type is correct, client should be able to parse with the adequate logic |
|
Derp; missed your comment Yeah, the Go client doesn't check the response type and just considers them all equal (which they "roughly" are). I was wondering if other clients would check the response type to handle (e.g.) I seemed to recall that the correct response was a 406 or a 300, but there's been quite some different descriptions throughout specs, and I just found that MDN (which is not the specification, but usually contains useful information) mentions; https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/406
So, yeah, looks like returning a 200 is not uncommon, so probably OK; perhaps we should add a code-comment that links to that page and a short blurb documenting that we've chosen to use 200 instead of 406? |
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * `GET /events` now also supports [`application/jsonl`](https://jsonlines.org/) | ||
| when negotiating content-type. | ||
| * Deprecated: The `POST /grpc` and `POST /session` endpoints are deprecated and |
There was a problem hiding this comment.
Did a quick rebase to get a fresh run of CI, and added a snippet here to mention that we added support for this content-type.
- What I did
while json-lines isn't (yet) an official Mime type (wardi/jsonlines#19), [OpenAPI 3.2 support for JSON streams](https://www.openapis.org/blog/2025/09/23/announcing-openapi-v3-2#sequential-and-streaming-data refers to "application/jsonl" as a commonly used mime type.
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)