
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@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
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.

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

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.