use mime-type application/jsonl to align with openapi 3.2

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Nicolas De Loof
2025-12-05 09:48:43 +01:00
committed by Sebastiaan van Stijn
parent b8093b76fb
commit aef5d996ce
10 changed files with 17 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ func NewJSONStreamEncoder(w io.Writer, contentType string) EncoderFn {
json: jsonEncoder,
}
return jseq.Encode
case types.MediaTypeNDJSON, types.MediaTypeJSON:
case types.MediaTypeNDJSON, types.MediaTypeJSON, types.MediaTypeJSONLines:
fallthrough
default:
return jsonEncoder.Encode

View File

@@ -311,6 +311,7 @@ func (s *systemRouter) getEvents(ctx context.Context, w http.ResponseWriter, r *
}
contentType := httputil.NegotiateContentType(r, []string{
types.MediaTypeJSONLines,
types.MediaTypeNDJSON,
types.MediaTypeJSONSequence,
}, types.MediaTypeJSON) // output isn't actually JSON but API used to this content-type