From 05bcea40adc12c9f0bbff0edd33f99e12bb87ec3 Mon Sep 17 00:00:00 2001 From: jagan Date: Thu, 21 Nov 2024 09:21:55 -0600 Subject: [PATCH] custom rule to require a description for every schema --- .github/workflows/ci.yml | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- ruleset.json | 12 +++++++++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3aa26ac..e33dd1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.x, 21.x] + node-version: [20.x, 22.x, 23.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} @@ -35,7 +35,7 @@ jobs: name: Branch Build strategy: matrix: - node-version: [20.x, 21.x] + node-version: [20.x, 22.x, 23.x] steps: - uses: actions/checkout@v4 with: diff --git a/package-lock.json b/package-lock.json index 18716b3..7c9198f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@checkdigit/spectral-config", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@checkdigit/spectral-config", - "version": "2.1.0", + "version": "2.1.1", "license": "UNLICENSED", "devDependencies": { "@checkdigit/prettier-config": "^5.3.0" diff --git a/package.json b/package.json index b21b389..c41a4e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@checkdigit/spectral-config", - "version": "2.1.0", + "version": "2.1.1", "description": "Check Digit Spectral Config", "main": "ruleset.json", "private": false, diff --git a/ruleset.json b/ruleset.json index 88bf5c7..7f0fbd3 100644 --- a/ruleset.json +++ b/ruleset.json @@ -36,6 +36,16 @@ "oas2-operation-security-defined": "error", "oas2-schema": "error", "oas2-unused-definition": "error", - "oas2-valid-media-example": "error" + "oas2-valid-media-example": "error", + "schema-description": { + "description": "All schemas must have a description.", + "message": "Schema is missing description.", + "severity": "error", + "given": "$.components.schemas.*", + "then": { + "field": "description", + "function": "truthy" + } + } } }