npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zapier/spectral-api-ruleset

v1.4.0

Published

Spectral ruleset for Zapier API Guidelines.

Downloads

3,088

Maintainers

tims256tims256philip.ng-zapierphilip.ng-zapierzapetczapetcchaodonghuchaodonghujc.coto-zapierjc.coto-zapierandrew.gosnell-zapierandrew.gosnell-zapierdjeebusdjeebusemma-haysemma-haysmichaelannmichaelannnickaccuardizapiernickaccuardizapierjdaudierjdaudierjoaopimenteljoaopimentelryanmrubinryanmrubinter0ter0rghazalirghazalirsiemensrsiemenscasshill13casshill13eliangeliangnoahmangernoahmangerkola-erkola-ercodebycalebcodebycalebcalebpetersoncalebpetersonjordyvdjordyvdvictoravasiloaeivictoravasiloaeilukecjohnsonlukecjohnsonzapier-engineeringzapier-engineeringstevemolitorstevemolitorjdealjdealbryanhelmigbryanhelmigbcookseybcookseyrobgoldingrobgoldingpwhammanpwhammanamber.diehl-zapieramber.diehl-zapierpercy_at_zapierpercy_at_zapierraul.negronraul.negronomar.razaomar.razalijennilijennikatestamzapkatestamzapfokkezbfokkezbzoeykim-zapierzoeykim-zapierjhk2020jhk2020nik.danilov-zapiernik.danilov-zapiermichal.wysocki-zapiermichal.wysocki-zapierjonathan.harrell-zapierjonathan.harrell-zapierharrison.jackson-zapierharrison.jackson-zapierdilan-zapierdilan-zapiersandy.brydon-zapiersandy.brydon-zapieremily.harris-zapieremily.harris-zapiersam.plantsam.plantmatthew.kiernander-zapiermatthew.kiernander-zapiermichaelgilleymichaelgilleycorbin.schwartz-zapiercorbin.schwartz-zapiermluksomluksomikekucheramikekucherajoannejoanneandrew.kordampalos-zapierandrew.kordampalos-zapierjasonkotenkojasonkotenkoezerwxezerwxnate.moore-zapiernate.moore-zapierjuanvjuanvibrahem.zayedibrahem.zayedjosuezapjosuezapmuyiwa.olurinmuyiwa.olurinjamesacarrjamesacarrmikeknoopmikeknoopjosh.newmanjosh.newmanparsenzparsenzlarrytlarrytrhubbardrhubbardtomasz.piechota-zapiertomasz.piechota-zapierjacobsowlesjacobsowlesservice-account-appsecservice-account-appsecmary.rising-zapiermary.rising-zapierjacebrowningjacebrowningnolan.little-zapiernolan.little-zapierstacietaylorcimastacietaylorcimaerrorificerrorificnkroeker_zapnkroeker_zaphitchcockwillhitchcockwillrenaekathleenrenaekathleenchelsea.weberchelsea.weberreganstarrzapierreganstarrzapiercyberwitchcyberwitchveebersveebersthomirthomirshalgrimshalgrimseason.huangseason.huangchris.vanderkolk.zapierchris.vanderkolk.zapiernickm0501nickm0501erin.williams-zapiererin.williams-zapierkayceekayceeowarijowarijbrian.corbinbrian.corbindarko.ronic.zapierdarko.ronic.zapierkredlearkredlearnumichuunumichuujustin.zapierjustin.zapierchelschubbchelschubbskylershawskylershawmaggie.cody-zapiermaggie.cody-zapierdaniel-frazierdaniel-frazierandya-zapierandya-zapierianscoianscowill.wigginswill.wigginsrondiegerondiegeannaulyanovaannaulyanovabskaurudbskaurudkaitrin.coxkaitrin.coxjeansimonjeansimonchasehambychasehambyrocioarrocioarmilkrammilkrammburnimburnipeterbritnellpeterbritnellguivasconcelos-zapierguivasconcelos-zapiercarolinezapiercarolinezapierchris.lee-zapierchris.lee-zapieremmaielleemmaiellejeanetteujeanetteubbohenbbohensugatmahantisugatmahantinicole.thomasnicole.thomasagscalaagscalajordanraleighjordanraleighkamalsingh.narukakamalsingh.narukarobertsclrobertsclron.swanson-zapiertestron.swanson-zapiertestdayne-taittdayne-taittwavebeemwavebeemlaurenmbeattylaurenmbeattyankush_zapierankush_zapierihor.horakihor.horakmaxwellgbrownmaxwellgbrownhanz.corteshanz.cortesalejandro-lagosalejandro-lagostom.leung-zapiertom.leung-zapierrobert.lewisrobert.lewislizzyzaplizzyzapblakekblakekcolemacleancolemacleanabhi-kapoorabhi-kapoorrchinermanrchinermansdelosrios95sdelosrios95mattplachtermattplachterdavid.zapierdavid.zapierjasehackmanjasehackmanjoseph-corona-zapierjoseph-corona-zapiermirrenzapmirrenzappedro.louro-zapierpedro.louro-zapierbrandon.parker-zapierbrandon.parker-zapiermagweavermagweaverpoterekmpoterekmgreg-zapiergreg-zapierloveena.vattenkyloveena.vattenkymsholtymsholtyplorryplorryjoel.taddeijoel.taddeistandielplsstandielplserikamontanierikamontanifgrafafgrafaaparkinaparkinadampieadampieilari.scheininilari.scheininannader-zapierannader-zapierlev.glicklev.glickdennis.kailikia-zapierdennis.kailikia-zapieramickael-zapamickael-zapkalenwesselkalenwesselali.tycast-zapierali.tycast-zapiertkcrannytkcrannykat.nestorkat.nestormatthewwaltersmatthewwaltersjeanny.syjeanny.syxavierh-zapierxavierh-zapiersethettersethetterjames.hong-zapierjames.hong-zapiermiklossimonmiklossimonservice-account-renovateservice-account-renovatecortega_zpcortega_zpjelani.jackson-zapierjelani.jackson-zapierariella-zapierariella-zapierwernertcwernertcyohana-heringeryohana-heringergabebravogabebravojdotceejdotceebrandon.myers.zapierbrandon.myers.zapierandyzapierandyzapierben.clapp.zapierben.clapp.zapierrebecca.davis.zapierrebecca.davis.zapiertiffanietiffaniedavidwin-zapdavidwin-zapmason.geloso-zapiermason.geloso-zapiervaleriia.shpinervaleriia.shpinerzac.jones-zapierzac.jones-zapiermanasseh_zapiermanasseh_zapierlisa.orrlisa.orraaclarker-zapaaclarker-zapfernando.velascosalazarfernando.velascosalazarnormanroanormanroarecamiliorecamiliodaniel.vagg-zapierdaniel.vagg-zapierisidro.hernandez-zapierisidro.hernandez-zapieralec.hinh-zapieralec.hinh-zapierkaushibkaushibscott.woodend-zapierscott.woodend-zapierahsanhassanahsanhassanhgascoignehgascoignecody.landrycody.landryschlickmannschlickmannjacquelynmccrayjacquelynmccraykatesowleskatesowleswojciech.matuszewski-zapierwojciech.matuszewski-zapierana.krivokapic-zapierana.krivokapic-zapieralex.blackalex.blackdanielheidornzapdanielheidornzapraquel.zapierraquel.zapiersarahstorysarahstorymatthew.hockenbury-zapiermatthew.hockenbury-zapierjonathan.wise-zapierjonathan.wise-zapierdewayne-zapierdewayne-zapiertupelo8tupelo8ankit.gordhandas-zapierankit.gordhandas-zapiereumie.jhong-zapiereumie.jhong-zapierchrys.swingler-zapierchrys.swingler-zapiermahsa.khoshab-zapiermahsa.khoshab-zapieranna.hadnagy-zapieranna.hadnagy-zapierjake.talgard-zapierjake.talgard-zapierbenjamin.kempe-zapierbenjamin.kempe-zapierrahul.es-zapierrahul.es-zapierdavid.graves-zapierdavid.graves-zapierryan.vennell-zapierryan.vennell-zapierbrian.wendt-zapierbrian.wendt-zapierchristophe.coutzoukis-zapierchristophe.coutzoukis-zapierzackary.higgins-zapierzackary.higgins-zapierbryce.seagervandyk-zapierbryce.seagervandyk-zapierrafal.wilinski-zapierrafal.wilinski-zapierkit.burgess-zapierkit.burgess-zapiervitor.balocco-zapiervitor.balocco-zapiernicole.hardson-hurley-zapiernicole.hardson-hurley-zapierzapier-interfaceszapier-interfacesiris.huang-zapieriris.huang-zapierbrody-zapierbrody-zapieraaron.kosel-zapieraaron.kosel-zapierdiomerdiomercameron.barnes-zapiercameron.barnes-zapiersarah.hernandez-zapiersarah.hernandez-zapierdavid.jardine-zapierdavid.jardine-zapierryan.detzel-zapierryan.detzel-zapierjacob.blakely-zapierjacob.blakely-zapierkasey.cowley-zapierkasey.cowley-zapierjessica.winters-zapierjessica.winters-zapierlisa.zapierlisa.zapierben.rugg-zapierben.rugg-zapieraispurostrangepixelsaispurostrangepixelsmyless91myless91abraham.duran-zapierabraham.duran-zapieraleks.ozolins-zapieraleks.ozolins-zapiertreesrule14treesrule14heather.osborn-zapierheather.osborn-zapiernicholas.civili-zapiernicholas.civili-zapieraubry.stewart-zapieraubry.stewart-zapierjake.moghtader-zapierjake.moghtader-zapierkristen.keller-zapierkristen.keller-zapierryan.laxson-zapierryan.laxson-zapiershanan.holm-zapiershanan.holm-zapiertal.peretz-zapiertal.peretz-zapierblzapierblzapieromar.delossantos-zapieromar.delossantos-zapierted.schmidt-zapierted.schmidt-zapierosarhomiyeke.iyere-zapierosarhomiyeke.iyere-zapiervj.clasgens-zapiervj.clasgens-zapiernitish.upadhyay-zapiernitish.upadhyay-zapiercarlos.bazana-zapiercarlos.bazana-zapiermike.lambert-zapiermike.lambert-zapiercatherine.murray-zapiercatherine.murray-zapierabdullah.umar-zapierabdullah.umar-zapierlaura.giles-zapierlaura.giles-zapierdiego.rodriguez.vzqdiego.rodriguez.vzqhusaina.wardhawala-zapierhusaina.wardhawala-zapierrohit.tripathi-zapierrohit.tripathi-zapierken.ng-zapierken.ng-zapierlukas.toma-zapierlukas.toma-zapiermarina.handmarina.handvivian.lau-zapiervivian.lau-zapierdan.middleton-zapierdan.middleton-zapierjames.miltenberger-zapierjames.miltenberger-zapiercharan.mahesan-zapiercharan.mahesan-zapierolajide.ayinla-zapierolajide.ayinla-zapierjoe.smith-zapierjoe.smith-zapiercameron.phillips-zapiercameron.phillips-zapiersara.gomez-zapiersara.gomez-zapiermichael.gill-zapiermichael.gill-zapierismail.latona-zapierismail.latona-zapierjayson.kadlecek-zapierjayson.kadlecek-zapiertazrafiqtazrafiqservice-account-catalogservice-account-catalogashley.isles-zapierashley.isles-zapierryan.dunnewold-zapierryan.dunnewold-zapierrval-zapierrval-zapierjenna.macdonald-zapierjenna.macdonald-zapiersharvari.desai-zapiersharvari.desai-zapierdaniel.shepard-zapierdaniel.shepard-zapierlstensagerlstensagerkunal.mahajan-zapierkunal.mahajan-zapierben.mcadams-zapierben.mcadams-zapierjason.brandt-zapierjason.brandt-zapiermark.auburn-zapiermark.auburn-zapierjames-zapierjames-zapier

Keywords

Readme


Ownership

#team-staff-engineering owns the API Design Guidelines and these spectral rules that help teams align with them.

MRs are always welcome!

Features

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

Installation

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

For some reason, installing the CLI globally and running spectral lint or npx spectral lint always fails to find the package. Adding the CLI as a local dependency and then running pnpm exec spectral lint does work.

Usage

CLI

There are a few ways you can use this ruleset in your projects.

You can load the ruleset in a few different ways with Spectral.

They support direct http access, via NPM, and via the local file system.

If you'd like to extend the ruleset and and even more specific rules for your API service, you can create a local spectral.yaml that extends the ruleset:

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

Then run:

spectral lint your-schema.yaml --ruleset .spectral.yaml

or

pnpm exec spectral lint your-schema.yaml --ruleset .spectral.yaml

or

spectral lint your-schema.yaml --ruleset https://unpkg.com/@zapier/spectral-api-ruleset@{VERSION}/.spectral.yaml

depending on whether you installed the CLI locally or globally.

See the Spectral CLI docs for more details.

CI

Use a GitLab job like the following:

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

For non-TypeScript projects, you can use the spectral docker image to avoid installing additional dependencies.

openapi:lint:
  stage: test
  image:
    name: stoplight/spectral:6.11.0
    entrypoint: [""]
  script:
    - spectral lint openapi.yaml
  only:
    - merge_requests

See Continuous Integration docs and our own openapi:lint guideance in the Engineering Index for more details.

Development

Setup

  1. Install dependencies:
pnpm install
  1. Run tests:
pnpm test
  1. Build the package:
pnpm run build
  1. Validate the package:
pnpm run validate

Adding Rules

You can add rules to .spectral.yaml. See the Rules docs for details.

  • Provide the correct severity (error for minimal OpenAPI standard compliance, warn for "shoulds" for existing and new APIs, info for "where we want NEW APIs to be").
  • Provide a clear description, as well as a documentationUrl that points to the relevant guide or guide section.
  • Provide a message, which in most cases should just be {{error}}.
  • Prefer Core Functions over Custom Functions.
  • Include unit test(s) in tests/spectral.test.ts for all new rules.

Testing

This project uses Vitest for testing. To run the tests:

pnpm test

Publishing

GitLab CI will automatically publish the package to NPM when a merge request is merged into the main branch. Be sure to update the package version in package.json accordingly before merging.