Comments (6)
Hi @imWildCat,
Could you try running the tool via
$ npx odata-openapi3 ./ms-api.xml
This works fine on my machine with the latest ms-graph-v1.0.edmx:
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 13/06/2023 17:30 2181042 ms-graph-v1.0.edmx
-a--- 13/06/2023 17:30 148161187 ms-graph-v1.0.openapi3.json
Thanks in advance!
from odata-openapi.
Thanks for the reply, @ralfhandl !
➜ Edge_Downloads npx odata-openapi3 ./metadata.xml
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/odata-openapi3 - Not found
npm ERR! 404
npm ERR! 404 'odata-openapi3@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in: /Users/[user]/.npm/_logs/2023-06-13T17_38_53_009Z-debug-0.log
➜ Edge_Downloads npm install -g odata-openapi
added 6 packages in 569ms
1 package is looking for funding
run `npm fund` for details
➜ Edge_Downloads npx odata-openapi3 ./metadata.xml
./metadata.openapi3.json
/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/edm.js:120
element = element.find(
^
TypeError: Cannot read properties of undefined (reading 'find')
at module.exports.EDM.#processAnnotations (/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/edm.js:120:27)
at module.exports.EDM.#processSchemas (/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/edm.js:101:31)
at module.exports.EDM.addDocument (/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/edm.js:32:25)
at Object.module.exports.csdl2openapi (/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/csdl2openapi.js:69:9)
at convert (/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/cli.js:89:23)
at Object.<anonymous> (/Users/[user]/.nvm/versions/node/v16.17.1/lib/node_modules/odata-openapi/lib/cli.js:68:3)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
➜ Edge_Downloads
from odata-openapi.
@imWildCat please try in a package where you've already installed odata-openapi
, for example
mkdir foo
cd foo
npm init -yes
npm install odata-openapi
npx odata-openapi3 -h
That should list the usage options.
Or without installing the package, use
npx --package odata-openapi odata-openapi3 -h
from odata-openapi.
Thanks!
Still similar issue:
➜ f npm init -yes
npm install odata-openapi
npx odata-openapi3 -h
Wrote to /Users/[user]/Downloads/Edge_Downloads/f/package.json:
{
"name": "f",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
added 6 packages, and audited 7 packages in 520ms
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
Usage: odata-openapi3 <options> <source file>
Options:
--basePath base path (default: /service-root)
-d, --diagram include YUML diagram
-h, --help show this info
--host host (default: localhost)
-o, --openapi-version 3.0.0 to 3.0.3 or 3.1.0 (default: 3.0.2)
-p, --pretty pretty-print JSON result
--scheme scheme (default: http)
-t, --target target file (default: source file basename + .openapi3.json)
--skipBatchPath skips the generation of the $batch path, (default: false)
--title default title if none is annotated
--description default description if none is annotated
➜ f ls
metadata.xml node_modules package-lock.json package.json
➜ f npx odata-openapi3 ./metadata.xml
➜ f cat package.json
{
"name": "f",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"odata-openapi": "^0.23.0"
}
}
➜ f npx odata-openapi3 ./metadata.xml
./metadata.openapi3.json
/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:120
element = element.find(
^
TypeError: Cannot read properties of undefined (reading 'find')
at module.exports.EDM.#processAnnotations (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:120:27)
at module.exports.EDM.#processSchemas (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:101:31)
at module.exports.EDM.addDocument (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:32:25)
at Object.module.exports.csdl2openapi (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/csdl2openapi.js:69:9)
at convert (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/cli.js:89:23)
at Object.<anonymous> (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/cli.js:68:3)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
➜ f
I also tried node.js 18:
➜ f nvm use 18
Now using node v18.10.0 (npm v8.19.2)
➜ f npx odata-openapi3 ./metadata.xml
./metadata.openapi3.json
/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:120
element = element.find(
^
TypeError: Cannot read properties of undefined (reading 'find')
at #processAnnotations (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:120:27)
at #processSchemas (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:101:31)
at module.exports.EDM.addDocument (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/edm.js:32:25)
at module.exports.csdl2openapi (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/csdl2openapi.js:69:9)
at convert (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/cli.js:89:23)
at Object.<anonymous> (/Users/[user]/Downloads/Edge_Downloads/f/node_modules/odata-openapi/lib/cli.js:68:3)
at Module._compile (node:internal/modules/cjs/loader:1149:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1203:10)
at Module.load (node:internal/modules/cjs/loader:1027:32)
at Module._load (node:internal/modules/cjs/loader:868:12)
Node.js v18.10.0
from odata-openapi.
Bug is fixed with [email protected]
.
Thanks for finding this!
from odata-openapi.
@ralfhandl thank you so much!
from odata-openapi.
Related Issues (20)
- Specific OData XML file cannot be converted, only .tmp file is created HOT 2
- Error: spawnSync java ENOENT HOT 3
- Unexpected Token Error HOT 3
- Edm.Int64 PrimitiveType translated to anyOf["string", "integer"] HOT 2
- Support for /$count operation HOT 4
- Openapi specification only documents DELETE and PATCH for single entity URLs HOT 6
- SAP R3 FunctionImport: Documentation Tag in Parameter fails the generation HOT 4
- Property sap:label is not handled HOT 2
- <Key> in Schema creates errors HOT 1
- FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory HOT 5
- More than two annotation target path segments HOT 5
- Unexpected node HOT 4
- Error in Conversion .edmx to OpenAPI format HOT 1
- documentation item HOT 2
- Could it be possible to generate for a part of the odataModel ? HOT 31
- Support annotation Core.ComputedDefaultValue
- TypeError: model.element(...).find is not a function HOT 4
- Missing cli feature: Add $metadata operation and root HOT 4
- Covert XMl to open api failes HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odata-openapi.