Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

methodObj sometimes a string #4993

Closed
philipheinser opened this issue Jan 4, 2023 · 3 comments
Closed

methodObj sometimes a string #4993

philipheinser opened this issue Jan 4, 2023 · 3 comments

Comments

@philipheinser
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @omnigraph/openapi@0.19.6 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@omnigraph/openapi/cjs/getJSONSchemaOptionsFromOpenAPIOptions.js b/node_modules/@omnigraph/openapi/cjs/getJSONSchemaOptionsFromOpenAPIOptions.js
index 2582e65..38b4f3b 100644
--- a/node_modules/@omnigraph/openapi/cjs/getJSONSchemaOptionsFromOpenAPIOptions.js
+++ b/node_modules/@omnigraph/openapi/cjs/getJSONSchemaOptionsFromOpenAPIOptions.js
@@ -63,6 +63,12 @@ async function getJSONSchemaOptionsFromOpenAPIOptions(name, { source, fallbackFo
                 continue;
             }
             const methodObj = pathObj[method];
+
+            if(typeof methodObj !== 'object') {
+                logger.warn(`Skipping ${method} ${relativePath} because it is not an object`);
+                continue;
+            }
+
             const operationConfig = {
                 method: method.toUpperCase(),
                 path: relativePath,

This issue body was partially generated by patch-package.

@philipheinser
Copy link
Author

Found this maybe related #4934

@philipheinser
Copy link
Author

this is the log I get Skipping $resolvedRef /foo/{bar} because it is not an object

@ardatan
Copy link
Owner

ardatan commented Mar 31, 2023

Fixed by #4934

@ardatan ardatan closed this as completed Mar 31, 2023
This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants