Closed jhorbulyk closed 6 years ago
I would like to know when this issue can be closed? Thanks.
Fixed in https://github.com/elasticio/odata2openapi/pull/26 and published in v 1.3.0
@jhorbulyk I still get the same issue: missing $ref with latest. Any options should I set up so that I can get $ref?
@yygott Are you able to share the metadata document that is causing you troubles? I don't observe this as the case with the TripPin metadata I linked to.
@jhorbulyk I use the model.ts in the example odata-v4-server-mongodb as my model and below is my code to convert the model. I got same issue (see below after code) when working with swagger as using my own model.
app.use( '/api-docs/metadatatojson', (req: any, res: any) => { const options: Options = { host: req.headers.host, basePath: '/content/v1', } const doc = TestServer.$metadata().document() parse( doc ) .then( ( service ) => convert(service.entitySets, options, service.version), ) .then( ( swagger ) => res.json( swagger ), ) }) The errors are like: Resolver error at paths./Products.get.responses.200.schema.properties.value.items.properties.Details.$ref Could not resolve reference because of: Could not resolve pointer: /definitions/pa.content.Details does not exist in document
However, if I save the output of TestServer.$metadata().document() into a file and use odata-openapi tool "transform.js -dp -o=2.0" to convert, I get the expected json output. This output works with swagger UI.
Is it my source code (above) issue or some dependencies issues to cause this?
I use the model.ts in the example odata-v4-server-mongodb as my model
I can't find what you are referring to. Can you post a link?
Can you create a gist with the metadata XML?
Consider the metadata/TripPinServiceRW/$metadata) from OData's TripPin sample service/TripPinServiceRW/$metadata). It contains the
Location
entity type which is as followsObserve that there is this definition, there is an
City
property which is an entity type defined elsewhere in the metadata. I would expect the JSONSchema for theLocation
to look like:Instead, we are provided