Skip to content

Script for converting Google Discovery format into OpenAPI (swagger) 2.0

License

Notifications You must be signed in to change notification settings

transposit/google-discovery-to-swagger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-discovery-to-swagger

Script for converting Google Discovery format into Swagger 2.0

Usage

$ npm install
$ node src/main.js [SERVICE_NAME] [VERSION] > file.yml

The script will automatically try to use the following urls to get the API discovery file:

https://${service}.googleapis.com/$discovery/rest?version=${version}
https://www.googleapis.com/discovery/v1/apis/${service}/${version}/rest

If VERSION is not specified the script will try versions 1-5.

Examples:

node src/main.js clouddebugger > raw_gcp_stackdriver_debugger.yml
node src/main.js container > raw_gcp_container_engine.yml
node src/main.js vision > raw_gcp_cloud_vision.yml
node src/main.js logging > raw_gcp_stackdriver_logging.yml
node src/main.js monitoring > raw_gcp_stackdriver_monitoring.yml
node src/main.js compute > raw_gcp_compute_engine.yml
node src/main.js datastore > raw_gcp_cloud_datastore.yml
node src/main.js cloudprofiler > raw_gcp_stackdriver_profiler.yml
node src/main.js cloudtrace > raw_gcp_stackdriver_trace.yml
node src/main.js language > raw_gcp_cloud_natural_language.yml
node src/main.js pubsub > raw_gcp_cloud_pubsub.yml
node src/main.js bigquery > raw_gcp_bigquery.yml
node src/main.js storage > raw_gcp_cloud_storage.yml 
node src/main.js clouderrorreporting v1beta1 > raw_gcp_stackdriver_errors.yml

You can see in the last example we have to specify the version because it's not just a number.

Credits

Ivan Goncharov

License

MIT

About

Script for converting Google Discovery format into OpenAPI (swagger) 2.0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%