Table: openapi_info - Query OpenAPI Information using SQL
OpenAPI is a specification for machine-readable interface files for describing, producing, consuming, and visualizing RESTful web services. The OpenAPI Information resource provides details about the OpenAPI specification, including its version, title, description, and terms of service. This information is useful for understanding the specifics of the RESTful web service described by the OpenAPI specification.
Table Usage Guide
The openapi_info
table provides insights into the OpenAPI specification of a RESTful web service. As a software developer or a DevOps engineer, explore specification-specific details through this table, including the version, title, description, and terms of service of the OpenAPI specification. Utilize it to uncover information about the specification, such as its title and description, and the version and terms of service associated with it.
Examples
Basic info
Explore the general information of an OpenAPI specification to gain insights into its title, description, version, contact details, and paths. This can be useful for understanding the overall structure and details of the API at a glance.
select title, description, version, contact, pathfrom openapi_info;
select title, description, version, contact, pathfrom openapi_info;
Get the maintainer's contact information
Explore the contact information of the maintainer to ensure effective communication and collaboration. This could be particularly beneficial for troubleshooting, seeking clarifications, or discussing potential enhancements.
select title, version, contact ->> 'name' as maintainer_name, contact ->> 'email' as maintainer_email, pathfrom openapi_info;
select title, version, json_extract(contact, '$.name') as maintainer_name, json_extract(contact, '$.email') as maintainer_email, pathfrom openapi_info;
List API specifications not using any license
Explore which API specifications are not currently using any license. This can help identify potential compliance issues or areas where licensing needs to be updated or added.
select title, version, contact ->> 'name' as maintainer_name, contact ->> 'email' as maintainer_email, pathfrom openapi_infowhere license is null;
select title, version, json_extract(contact, '$.name') as maintainer_name, json_extract(contact, '$.email') as maintainer_email, pathfrom openapi_infowhere license is null;
Schema for openapi_info
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
contact | jsonb | The contact information for the exposed API. | |
description | text | A description of the API. | |
license | jsonb | The license information for the exposed API. | |
path | text | = | Path to the file. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
specification_version | text | The version of the OpenAPI specification. | |
terms_of_service | text | A URL to the Terms of Service for the API. | |
title | text | The title of the API. | |
version | text | The version of the OpenAPI document. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- openapi
You can pass the configuration to the command with the --config
argument:
steampipe_export_openapi --config '<your_config>' openapi_info