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.

Kong Spec Expose
Third PartyRelated Documentation
Incompatible with
konnect
Third Party: This plugin is developed, tested, and maintained by Optum.
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:
- The plugin enables a Kong Admin to specify the endpoint of their API specification.
- 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.
-
Install the Kong Spec Expose plugin:
luarocks install kong-spec-expose
-
Update your loaded plugins list in Kong Gateway.
In your
kong.conf
, appendkong-spec-expose
to theplugins
field. Make sure the field isn’t commented out.plugins = bundled,kong-spec-expose
-
Restart Kong Gateway:
kong restart