Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

RAML - Swagger url support in converter. #3

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open

RAML - Swagger url support in converter. #3

wants to merge 59 commits into from

Conversation

unicornio8
Copy link

@unicornio8 unicornio8 commented Jan 10, 2017

  • Adding support with url conversion from RAML to Swagger for console app.
  • Taking examples from api-guru conversions hosted in guthub for testing.

const converter = new specConverter.Converter(from, to)
converter.convertFile(file, {validate: validate}).then(result =>
converter.convertFile(file, options).then(result =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change only intends to add support for a url in the command line right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, yes if you pass URL get the conversion from RAML

let baseURI = 'https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/';
let baseDir = __dirname + '/../data/apis-guru/raml';
let testFiles = fs.readdirSync(baseDir);
let testUrls = [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is prepared but this isn't testing any url. Or i'm missing something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, test the examples in RAML10 from the same github repository.
I check in travis, but i get "errors" only in files with big size that i suppose is for memory or timeout.

You can check here:

https://travis-ci.org/unicornio8/oas-raml-converter

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from raml (URL) to swagger: apis-guru
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/18f.gov0.1swagger.raml (280ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/apis.guru2.0swagger.raml (239ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/apitransformer.com1.0swagger.raml (156ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/audiosear.ch1.0.0swagger.raml (1408ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-analysisservices2016-05-16swagger.raml (604ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-apimanagement-apimdeployment2016-07-07swagger.raml (1335ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-apimanagement-apimmanagement2016-07-07swagger.raml (5936ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-authorization2015-07-01swagger.raml (1251ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-batch2015-12-01swagger.raml (1205ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-cdn2015-06-01swagger.raml (1823ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-cdn2016-04-02swagger.raml (1732ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-cdn2016-10-02swagger.raml (1914ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-cognitiveservices2016-02-01-previewswagger.raml (746ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-commerce2015-06-01-previewswagger.raml (727ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-compute-containerService2015-11-01-previewswagger.raml (646ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-compute-containerService2016-03-30swagger.raml (684ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-compute-containerService2016-09-30swagger.raml (816ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-compute2015-06-15swagger.raml (3720ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-compute2016-03-30swagger.raml (4242ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-containerregistry2016-06-27-previewswagger.raml (642ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-devtestlabs2015-05-21-previewswagger.raml (4296ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-devtestlabs2016-05-15swagger.raml (3962ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-dns2015-05-04-previewswagger.raml (846ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-dns2016-04-01swagger.raml (1108ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-documentdb2015-04-08swagger.raml (850ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-eventhub2015-08-01swagger.raml (1157ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-insights2015-04-01swagger.raml (903ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-insights2015-07-01swagger.raml (521ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-insights2016-03-01swagger.raml (406ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-intune2015-01-14-previewswagger.raml (2037ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-iothub2016-02-03swagger.raml (1637ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-keyvault2015-06-01swagger.raml (811ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-logic2015-02-01-previewswagger.raml (2106ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-logic2015-08-01-previewswagger.raml (3898ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-logic2016-06-01swagger.raml (2261ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-machinelearning-commitmentPlans2016-05-01-previewswagger.raml (933ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-machinelearning-webservices2016-05-01-previewswagger.raml (1322ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-mediaservices2015-10-01swagger.raml (823ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-mobileengagement2014-12-01swagger.raml (3093ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-network2015-05-01-previewswagger.raml (4998ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-network2015-06-15swagger.raml (5547ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-network2016-03-30swagger.raml (5782ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-network2016-06-01swagger.raml (6528ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-network2016-09-01swagger.raml (7143ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-notificationhubs2014-09-01swagger.raml (1571ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-notificationhubs2016-03-01swagger.raml (1601ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-powerbiembedded2016-01-29swagger.raml (886ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-recoveryservices2016-06-01swagger.raml (461ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-recoveryservicesbackup2016-06-01swagger.raml (3076ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-redis2015-08-01swagger.raml (643ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-redis2016-04-01swagger.raml (984ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-scheduler2014-08-01-previewswagger.raml (1856ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-scheduler2016-01-01swagger.raml (1790ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-scheduler2016-03-01swagger.raml (1612ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-search2015-02-28swagger.raml (954ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-search2015-08-19swagger.raml (1173ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-servermanagement2015-07-01-previewswagger.raml (1462ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-servermanagement2016-07-01-previewswagger.raml (1845ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-servicebus2015-08-01swagger.raml (1839ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-sql2014-04-01swagger.raml (3359ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-storage2015-05-01-previewswagger.raml (847ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-storage2015-06-15swagger.raml (870ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-storage2016-01-01swagger.raml (1361ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-trafficmanager2015-11-01swagger.raml (776ms)
✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-web2015-08-01-previewswagger.raml (987ms)

  1. Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.comarm-web2015-08-01swagger.raml
    ✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.cominsights2014-04-01swagger.raml (189ms)
    ✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.cominsights2015-04-01swagger.raml (572ms)
    ✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.cominsights2016-03-01swagger.raml (370ms)
    ✓ Test URL RAML: https://raw.githubusercontent.com/mulesoft/oas-raml-converter/master/test/data/apis-guru/raml/azure.cominsights2016-09-01swagger.raml (339ms)

Copy link

@agustinlg agustinlg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please provide more info for the reason of this changes? Thanks a lot

@unicornio8
Copy link
Author

Hi, Do you need more information?, Is possible to integrate it?

Gaston Lodieu and others added 29 commits February 1, 2017 01:06
…n converting to paths. no fix, only test files
@unicornio8
Copy link
Author

Merge with pending changes, please validate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants