Skip to content

Commit

Permalink
fix(openapi): handle custom mime types (#6910)
Browse files Browse the repository at this point in the history
* fix(openapi): handle custom mime types

* Fix
  • Loading branch information
ardatan authored Apr 29, 2024
1 parent 539220e commit 9f41ea8
Show file tree
Hide file tree
Showing 5 changed files with 5,984 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/big-cooks-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@omnigraph/openapi": patch
---

When a custom mime type provided in `operationHeaders`, it sets all the fields as generic `JSON` scalar.
Fixes https://github.com/ardatan/graphql-mesh/issues/4460
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions(
}

for (const contentKey in responseObj.content) {
if (!mimeTypes.includes(contentKey)) {
if (!mimeTypes.some(mimeType => mimeType.includes(contentKey))) {
continue;
}
schemaObj = responseObj.content[contentKey].schema as any;
Expand Down
Loading

0 comments on commit 9f41ea8

Please sign in to comment.