Skip to content

flipdishbytes/spectral-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flipdish Spectral Rules

This repo contains the custom Spectral ruleset used for Flipdish OpenAPI validation.

✅ Rules Included

  • Required descriptions and summaries
  • Only production servers (api.flipdish.co)
  • Error object validation (⚠️ Currently disabled due to issues when running it)
  • Pagination schema checks
  • camelCase paths
  • Valid contact email
  • Approved status codes
  • Tag sorting

🔧 Usage in CI/CD

GitHub Actions

- name: Download Flipdish Spectral Rules
  run: curl -O https://raw.githubusercontent.com/flipdishbytes/spectral-rules/main/.spectral.yaml

- name: Lint OpenAPI Spec
  run: spectral lint openapi.yaml --ruleset .spectral.yaml

CLI

curl -O https://raw.githubusercontent.com/flipdishbytes/spectral-rules/main/.spectral.yaml
spectral lint openapi.yaml --ruleset .spectral.yaml

🔄 Extending and Overriding Rules

This ruleset can be extended or overridden in your project by creating a local .spectral.yaml file that extends this one. For example:

extends: https://raw.githubusercontent.com/flipdishbytes/spectral-rules/main/.spectral.yaml

rules:
  # Override an existing rule
  operation-summary:
    severity: warn  # Change severity from error to warn

  # Add a new rule
  my-custom-rule:
    description: "My custom rule"
    severity: error
    given: "$.paths[*][*]"
    then:
      field: summary
      function: pattern
      functionOptions:
        match: "^[A-Z]"

For more details on extending rulesets, see the Spectral documentation.

About

Custom spectral ruleset for Flipdish, according to API Design Guide

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors