elasticio / odata2openapi

OData to OpenAPI Converter
https://www.elastic.io
MIT License
33 stars 23 forks source link

How to get this to work with https://graph.microsoft.com/beta/$metadata (V4 vs V1) #6

Closed chauey closed 6 years ago

chauey commented 7 years ago

I got an error trying to convert the microsoft graph metatdata.

Error: TypeError: Cannot read property 'map' of undefined at parseEntityType (http://localhost:3001/main.bundle.js:34425:43) at parseEntitySet (http://localhost:3001/main.bundle.js:34419:21) at http://localhost:3001/main.bundle.js:34411:20 at Array.map (native) at parseEntitySets (http://localhost:3001/main.bundle.js:34407:41)...

I noticed https://graph.microsoft.com/beta/$metadata has version 4.0 vs 1.0 by the example.

http://services.odata.org/V3/Northwind/Northwind.svc/$metadata Thanks!
chauey commented 7 years ago

I put in a PR for this here: https://github.com/akorchev/odata2openapi/pull/7 Some "EntityType" nodes do not have "Properties" nodes and caused this problem

akorchev commented 6 years ago

We've made some changes recently that allow better handling of the MSGraph schema.