Closed amammes closed 6 years ago
it isn't expanded?
I'm not sure what you're showing
shouldn't
schemas: { geoCoordinates: [Object] },
detail the properties of geoCoordinates (latitude, longitude)?
Where do you get that output?
It might just not display it and says [Object]
because it's an object
I get that output on the windows cmd when I run the following script:
var converter = require('oas-raml-converter');
var ramlToOas = new converter.Converter(converter.Formats.RAML, converter.Formats.OAS30);
var options = {
validate: true, // Parse both input and output to check that its a valid document
validateImport: true, // Only validate input
validateExport: true, // Only validate output
format: 'yaml' // Output format: json (default for OAS) or yaml (default for RAML)
};
ramlToOas.convertFile('broken4.raml', options).then(function(raml) {
console.log(raml); // raml is raml yaml string
})
.catch(function(err) {
console.error(err);
});
I realize it's an object. The issue is that the object properties do not appear anywhere. This happens to all my types, they are just converted to Object without any detail.
Just FYI, OS is Windows 10 Pro 64 bit, Nodejs version 9.7.0. oas-raml-converter version oas-raml-converter@1.1.28. Is my node version too new?
can you put JSON.stringify(raml, void 0, 2)
in the console.log statement?
That seemed to have done it. I took that js from the examples. Thanks
{
"openapi": "3.0.0",
"info": {
"title": "oas-raml-converter does not process this correctly",
"version": "undefined"
},
"servers": [
{
"url": "http://api.samplehost.com/"
}
],
"paths": {
"/geoCoordinates": {
"get": {
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/geoCoordinates"
}
}
}
}
},
"operationId": "GET_geoCoordinates"
}
}
},
"components": {
"schemas": {
"geoCoordinates": {
"properties": {
"latitude": {
"minimum": -90,
"maximum": 90,
"format": "double",
"description": "Latitude (degree range -90 to +90) with positive values for N latitude and negative for S latitude.",
"type": "number"
},
"longitude": {
"minimum": -180,
"maximum": 180,
"format": "double",
"description": "Longitude (degree range -180 to +180) positive values for E of the prime meridian, and negative values W longitude.",
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
}
},
"responses": {},
"parameters": {},
"examples": {},
"requestBodies": {},
"headers": {},
"securitySchemes": {},
"links": {},
"callbacks": {}
}
}
Conversion to OAS3 shows this:
What's up with this geoCoordinates: [Object]? Why isn't the type expanded?