@kubb/adapter-oas 5.21.2 → 5.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -3
- package/dist/index.d.ts +69 -3
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var compatibility = {
|
|
|
16
16
|
"node": ">=22.22"
|
|
17
17
|
};
|
|
18
18
|
// package.json
|
|
19
|
-
var version = "5.
|
|
19
|
+
var version = "5.23.0";
|
|
20
20
|
// src/constants.ts
|
|
21
21
|
/**
|
|
22
22
|
* Default parser options applied when no explicit options are provided.
|
|
@@ -1738,11 +1738,18 @@ function toInputTags(tags) {
|
|
|
1738
1738
|
});
|
|
1739
1739
|
}
|
|
1740
1740
|
// src/model/mediaType.ts
|
|
1741
|
+
const streamMediaTypes = /* @__PURE__ */ new Set([
|
|
1742
|
+
"application/jsonl",
|
|
1743
|
+
"application/x-ndjson",
|
|
1744
|
+
"application/json-seq",
|
|
1745
|
+
"text/event-stream"
|
|
1746
|
+
]);
|
|
1741
1747
|
/**
|
|
1742
|
-
* Returns `true` for a media type read as a stream of items:
|
|
1748
|
+
* Returns `true` for a media type read as a stream of items: SSE, JSON Lines, a `+json-seq` sequence, or any media type that declares `itemSchema`.
|
|
1743
1749
|
*/
|
|
1744
1750
|
function isStream(contentType, mediaType) {
|
|
1745
|
-
|
|
1751
|
+
const baseType = _kubb_kit.ast.mediaType.getBase(contentType);
|
|
1752
|
+
return streamMediaTypes.has(baseType) || baseType.startsWith("application/") && baseType.endsWith("+json-seq") || mediaType?.itemSchema !== void 0;
|
|
1746
1753
|
}
|
|
1747
1754
|
/**
|
|
1748
1755
|
* Whether the media type is `text/event-stream`, with or without parameters.
|