@kubb/adapter-oas 5.3.13 → 5.3.14

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 CHANGED
@@ -617,12 +617,15 @@ function isBinary(schema) {
617
617
  return schema.contentMediaType === "application/octet-stream" && schema.contentEncoding === void 0 && (schema.type === void 0 || schema.type === "string");
618
618
  }
619
619
  /**
620
- * Returns the binary schema for an `application/octet-stream` entry the OAS 3.1 upgrade emptied
621
- * out, or `undefined` when the entry carries a schema of its own. Without the fallback such a
622
- * body resolves to the empty schema type instead of a blob.
620
+ * Returns the binary schema for a non-JSON entry the OAS 3.1 upgrade emptied out, or `undefined`
621
+ * when the entry carries a schema of its own. The upgrade rewrites `format: 'binary'` into
622
+ * `contentMediaType` and drops it whenever it only repeats the media type key, for any binary
623
+ * media type (`application/octet-stream`, `application/pdf`, `image/png`, ...), not just
624
+ * `application/octet-stream`. Without the fallback such a body resolves to the empty schema type
625
+ * instead of a blob.
623
626
  */
624
627
  function getBinaryFallbackSchema(mediaType, schema) {
625
- if (mediaType !== "application/octet-stream") return void 0;
628
+ if (!mediaType || isJsonMimeType(mediaType)) return void 0;
626
629
  if (schema && Object.keys(schema).length > 0) return void 0;
627
630
  return {
628
631
  type: "string",