Another TypeError on OpenAPI 3.0 to OpenAPI 2.0 converted document
jdesai61 opened this issue · 3 comments
jdesai61 commented
What are the steps to reproduce?
Get JIRA swagger 3.0 definition file
wget https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json
Convert it to 2.0 using
api-spec-converter -f openapi_3 -t swagger_2 https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json > swagger-jira-v2.json
Try to generate code using nodegen
node-red-nodegen swagger-jira-v2.json
What happens?
I get an error message
Error: TypeError: Cannot read property 'definitions' of undefined
What do you expect to happen?
I expect code to be generated per the README file
Please tell us about your environment:
- Node generator version: 0.1.0
- Node-RED version: v1.0.3
- Node.js version: v13.7.0
- npm version: 6.13.6
- Platform/OS: Linux 4.4.0-18362-Microsoft x64 LE (WSL2 for Linux on Windows 10)
- Browser: N/A
kazuhitoyokoi commented
@jdesai61 The api-spec-converter
command seems to output the invalid swagger file.
To avoid the problem, I used the jq
command like the following to remove the definitions
property.
- api-spec-converter -f openapi_3 -t swagger_2 https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json | jq 'del(.definitions)' > swagger-jira-v2.json
- node-red-nodegen swagger-jira-v2.json
Could you try this command?
jdesai61 commented
Thank you - that works.
…________________________________
From: Kazuhito Yokoi <notifications@github.com>
Sent: Thursday, March 19, 2020 8:41 AM
To: node-red/node-red-nodegen <node-red-nodegen@noreply.github.com>
Cc: Jatin Desai <jrdft@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [node-red/node-red-nodegen] Another TypeError on OpenAPI 3.0 to OpenAPI 2.0 converted document (#105)
@jdesai61<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjdesai61&data=02%7C01%7C%7Cd948e8c5d3be4a9fccd508d7cc02e2eb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637202185070100778&sdata=yDWoqVh0%2B4pXg4jiDqdy0A3St6FJ4ebQVVPZ%2F%2BrCxyw%3D&reserved=0> The api-spec-converter command seems to output the invalid swagger file.
To avoid the problem, I used the jq command like the following to remove the definitions property.
* api-spec-converter -f openapi_3 -t swagger_2 https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.atlassian.com%2Fcloud%2Fjira%2Fplatform%2Fswagger-v3.v3.json&data=02%7C01%7C%7Cd948e8c5d3be4a9fccd508d7cc02e2eb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637202185070100778&sdata=%2B6aIkISMQvhTxp3Ij7T9Yn%2FYRq80Ly%2FyWgggxc5RXgo%3D&reserved=0> | jq 'del(.definitions)' > swagger-jira-v2.json
* node-red-nodegen swagger-jira-v2.json
Could you try this command?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnode-red%2Fnode-red-nodegen%2Fissues%2F105%23issuecomment-601156227&data=02%7C01%7C%7Cd948e8c5d3be4a9fccd508d7cc02e2eb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637202185070110777&sdata=JkEmbW04Wu7wVVTfNPXMvDmVLR1RzVxnHj%2Floa3tduM%3D&reserved=0>, or unsubscribe<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADBZQWG2GTYVIOMKNDACE3DRIIHITANCNFSM4LCS3WJQ&data=02%7C01%7C%7Cd948e8c5d3be4a9fccd508d7cc02e2eb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637202185070110777&sdata=Tunci6DKr28HbgmsAqG%2BlGGh2h3BJ60bPfIMF2l3gaw%3D&reserved=0>.
kazuhitoyokoi commented
@jdesai61 Thank you for your feedback. I will close this issue.