Generates OpenAPI 3.x specification from Google Discovery documents.
This script performs the following steps:
- Gets the root discovery document for all Google APIs
- Gets each respective service discovery document from the root discovery document (can be filtered to only fetch
preferred
service versions) - Converts each service discovery document to an OpenAPI 3.x specification, written as a
yaml
file to theopenapi3
folder
The resultant OpenAPI service specifications can the be used with @stackql/openapi-doc-util to generate StackQL Google provider definitions.
NOTE: Requires Python 3.9 or above
python3.9 google_discovery_to_openapi.py
Run the following subsequent commands to generate tags for each operation in the generated OpenAPI service specifications.
python3.9 tag_operations.py