stackql / google-discovery-to-openapi

Convert Google discovery API documents to fully compliant OpenAPI3 specifications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google Discovery to OpenAPI 3.x Converter

Generates OpenAPI 3.x specification from Google Discovery documents.

OpenAPI 3 Specifications for Google Cloud APIs can be found at stackql/stackql-provider-registry

Overview

This script performs the following steps:

  1. Gets the root discovery document for all Google APIs
  2. Gets each respective service discovery document from the root discovery document (can be filtered to only fetch preferred service versions)
  3. Converts each service discovery document to an OpenAPI 3.x specification, written as a yaml file to the openapi folder

The resultant OpenAPI service specifications can the be used with stackql/openapisaurus to generate StackQL Google provider definitions.

Usage

NOTE: Requires Node.js 14.x or higher

Mac/Linux:

npm install
bin/google-discovery-to-openapi.mjs generate googleapis.com

Windows/PowerShell:

npm install
node .\bin\google-discovery-to-openapi.mjs generate

About

Convert Google discovery API documents to fully compliant OpenAPI3 specifications


Languages

Language:JavaScript 100.0%