Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zapier/spectral-api-ruleset

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zapier/spectral-api-ruleset

Node package with Spectral ruleset for Zapier API Guidelines.

  • 0.0.0
  • npm
  • Socket score

Version published
Weekly downloads
575
decreased by-27.12%
Maintainers
0
Weekly downloads
 
Created
Source

@zapier/spectral-api-ruleset

Node package for linting API schemas using Spectral.

OwnershipFeaturesInstallationUsageDevelopment


Ownership

TBD

Features

Provides a Spectral linting ruleset to lint API schemas against Zapier's API Design Guidelines.

Installation

yarn add -D @stoplight/spectral-cli
yarn add -D @zapier/spectral-api-ruleset

For some reason, installing the CLI global and running spectral lint always fails to find the package. Adding the CLI as local dependency and then running either yarn spectral lint or even npx spectral lint does work.

Usage

CLI

Create a local spectral.yaml that extends the ruleset provided by the package:

extends:
  - '@zapier/spectral-api-ruleset'

Then run:

yarn spectral lint your-schema.yaml

See the Spectral CLI docs for more details.

CI

Use a Gitlab job like the following

lint:schema:
  stage: validate
  before_script:
    - mkdir spectral
  script:
    - yarn spectral lint your-schema.yaml -o spectral/junit.xml -f junit
  artifacts:
    when: always
    paths:
      - spectral
    reports:
      junit: spectral/junit.xml

See Continuous Integration docs for more details.

Development

See CONTRIBUTING, also for information on how we use @changesets/cli to version and publish.

Adding Rules

You can add rules to spectral.js. See the Alternative JS Ruleset Format docs for details.

We're using the JS format so that the package ruleset can also be used in JavaScript.

  • Try to use the Core Functions to avoid custom functions.
  • Include a unit test for any custom functions you add to functions/.
  • Update test-schema.yaml to meet all rules (run yarn lint:schema to verify).

FAQs

Package last updated on 20 Oct 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc