
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@contractkit/plugin-openapi
Advanced tools
ContractKit plugin that generates an OpenAPI 3.0 YAML specification from .ck contract and operation files.
pnpm add @contractkit/contractkit-plugin-openapi
{
"plugins": {
"@contractkit/contractkit-plugin-openapi": {
"output": "openapi.yaml",
"info": {
"title": "Acme API",
"version": "1.0.0",
"description": "Public API for Acme services"
},
"servers": [
{ "url": "https://api.acme.com", "description": "Production" },
{ "url": "https://api.staging.acme.com", "description": "Staging" }
],
"security": [{ "bearerAuth": [] }],
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}
}
| Option | Type | Default | Description |
|---|---|---|---|
baseDir | string | rootDir | Base directory for the output file |
output | string | "openapi.yaml" | Output file path |
info.title | string | — | API title in the info block |
info.version | string | — | API version in the info block |
info.description | string | — | API description in the info block |
servers | array | — | List of server objects (url, optional description) |
security | array | — | Global security requirements (e.g. [{ "bearerAuth": [] }]) |
securitySchemes | object | — | Security scheme definitions added to components.securitySchemes |
type | Required fields | Description |
|---|---|---|
"http" | scheme ("bearer" or "basic"), optional bearerFormat | HTTP auth (Bearer JWT, Basic, etc.) |
"apiKey" | name, in ("header" or "query") | API key passed in a header or query param |
"oauth2" | — | OAuth 2.0 |
"openIdConnect" | — | OpenID Connect |
The plugin writes a single YAML file. All contract declarations become entries in components/schemas. All operation declarations become paths with their HTTP verbs, request bodies, parameters, and response schemas.
Operations marked internal are omitted from the generated spec by default. Set includeInternal: true in the plugin config to include them (e.g. for an internal-use API spec).
import { createOpenApiPlugin } from '@contractkit/contractkit-plugin-openapi';
const plugin = createOpenApiPlugin({
output: 'dist/openapi.yaml',
info: { title: 'My API', version: '2.0.0' },
servers: [{ url: 'https://api.example.com' }],
});
FAQs
ContractKit built-in plugin: OpenAPI 3.0 YAML generation
The npm package @contractkit/plugin-openapi receives a total of 35 weekly downloads. As such, @contractkit/plugin-openapi popularity was classified as not popular.
We found that @contractkit/plugin-openapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.