Skip to content
Hoplite
Theme

Begin typing to search this site.

OpenAPI output

Hoplite derives OpenAPI operation entries from the application’s flattened resource tree. Operation :name and :summary metadata improve the generated description.

["/hello"
{:get {:name :hello
:summary "Return a greeting"
:handler #'hello}}]

In development mode, an application defaults to exposing its OpenAPI document at /openapi.json.

Set a path in the application definition when the interface should be exposed deliberately:

(h/app {:name "api"
:openapi {:path "/openapi.json"}
:resources [...]})

Generated files are written under .hoplite/openapi/<app-name>.json during the build.