Skip to main content

Quickstart

import { getOpenApiObject } from '@quik/openapi';

const spec = getOpenApiObject();

getOpenApiObject() returns a cached document and auto-populates the cache the first time it is called (it is also refreshed once automatically in onBeforeBoot).

Notes

  • @quik/openapi registers the IQApiDocs feature during module setup(); the generated document is retrieved elsewhere in the framework via getApiDocs() from @quik/core (e.g. getApiDocs().getApiJson({ mode: 'swagger-ui' }) for a Swagger UI compatible projection).
  • Call cacheOpenAPIObject() to force-refresh the cached document after registering new hooks or routes at runtime.
  • Extend the generated document with OpenAPIHooks (components, paths, tags, security, webhooks parser hooks) rather than mutating the cached object directly.