Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

semantic-release-openapi

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-release-openapi

A Semantic Release plugin to update versions in OpenAPI / Swagger specification files

latest
Source
npmnpm
Version
2.3.3
Version published
Weekly downloads
829
-20.82%
Maintainers
1
Weekly downloads
 
Created
Source

semantic-release-openapi

npm npm types license prettier standard npm downloads dependencies
Maintainability Test Coverage test OpenSSF Scorecard Socket snyk

A Semantic Release plugin to update versions in OpenAPI / Swagger specification files.

StepDescription
verifyConditionsVerify existence of the apiSpecFiles config option, that it resolves to at least one valid .json, .yml, or .yaml file, and that it does not resolve to any other file types.
prepareUpdate the info.version field in all matching apiSpecFiles.

Installation

This module is distributed via npm and should be installed as one of your project's devDependencies:

npm install --save-dev semantic-release-openapi

Usage

Configure the plugin wherever you have your semantic-release configuration.

Configuration

This plugin has one configuration option which must be supplied.

OptionDescription
apiSpecFilesAn array of OpenAPI / Swagger specification file paths.
Glob patterns (e.g. '*.yaml') are supported.

All matching files must have a .json, .yaml, or .yml extension.

[!TIP]

Semantic Release will not commit changes to your OpenAPI spec files unless you add the same files in assets for the @semantic-release/git plugin. See the examples below.

Examples

The following examples assume you've put your semantic-release configuration in your package.json file.

Basic Example

{
  "release": {
    "plugins": [
      [
        "semantic-release-openapi",
        {
          "apiSpecFiles": ["openapi.yaml", "src/swagger-*.json"]
        }
      ],
      [
        "@semantic-release/git",
        {
          "assets": ["package.json", "openapi.yaml", "src/swagger-*.json"]
        }
      ]
    ]
  }
}

Extended Example

{
  "release": {
    "branches": ["main"],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/github",
        {
          "assets": [
            {
              "path": "src/openapi.yml",
              "label": "Open API Spec"
            }
          ]
        }
      ],
      "@semantic-release/npm",
      [
        "semantic-release-openapi",
        {
          "apiSpecFiles": ["src/openapi.yml"]
        }
      ],
      [
        "@semantic-release/git",
        {
          "assets": ["package.json", "src/openapi.yml"]
        }
      ]
    ]
  }
}

Keywords

api

FAQs

Package last updated on 20 May 2026

Did you know?

Socket

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.

Install

Related posts