Kong Spec Expose

Third Party
Related Documentation
Incompatible with
konnect
Third Party: This plugin is developed, tested, and maintained by Optum.

The Kong Spec Expose plugin lets you expose an OpenAPI Spec (OAS), Swagger, or other specification of auth-protected upstream services fronted using Kong Gateway.

How it works

API providers need a means of exposing the specifications of their services while maintaining authentication on the service itself. The Kong Spec Expose plugin solves this problem by doing the following:

  1. The plugin enables a Kong Admin to specify the endpoint of their API specification.
  2. The plugin validates that the proxy request is a GET method, and will validate the proxy request ends with /specz. If these two requirements are met, the endpoint returns the specification of the upstream service with Content-Type header identical to what the upstream service exposes.

Install the Kong Spec Expose plugin

You can install the Kong Spec Expose plugin via LuaRocks. A Lua plugin is distributed in .rock format, which is a self-contained package that can be installed locally or from a remote server.

  1. Install the Kong Spec Expose plugin:

    luarocks install kong-spec-expose
    
  2. Update your loaded plugins list in Kong Gateway.

    In your kong.conf, append kong-spec-expose to the plugins field. Make sure the field isn’t commented out.

    plugins = bundled,kong-spec-expose
    
  3. Restart Kong Gateway:

    kong restart
    
Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!