Coder Social home page Coder Social logo

Comments (6)

ForsakenHarmony avatar ForsakenHarmony commented on July 28, 2024 1

can you put JSON.stringify(raml, void 0, 2) in the console.log statement?

from oas-raml-converter.

amammes avatar amammes commented on July 28, 2024 1

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": {}
  }
}

from oas-raml-converter.

ForsakenHarmony avatar ForsakenHarmony commented on July 28, 2024

it isn't expanded?

I'm not sure what you're showing

from oas-raml-converter.

amammes avatar amammes commented on July 28, 2024

shouldn't

schemas: { geoCoordinates: [Object] },

detail the properties of geoCoordinates (latitude, longitude)?

from oas-raml-converter.

ForsakenHarmony avatar ForsakenHarmony commented on July 28, 2024

Where do you get that output?

It might just not display it and says [Object] because it's an object

from oas-raml-converter.

amammes avatar amammes commented on July 28, 2024

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 [email protected]. Is my node version too new?

from oas-raml-converter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.