diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index d7a6b07..a641daf 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -5,6 +5,7 @@ on: branches: [main] paths: - 'asm/openapi.yaml' + - 'sat/openapi.yaml' - 'docs/**' - '.github/workflows/deploy-docs.yml' workflow_dispatch: @@ -33,6 +34,7 @@ jobs: mkdir -p _site cp docs/index.html _site/index.html cp asm/openapi.yaml _site/asm-openapi.yaml + cp sat/openapi.yaml _site/sat-openapi.yaml - name: Setup Pages uses: actions/configure-pages@v5 diff --git a/.github/workflows/validate-openapi.yml b/.github/workflows/validate-openapi.yml index 2d1da76..aff3346 100644 --- a/.github/workflows/validate-openapi.yml +++ b/.github/workflows/validate-openapi.yml @@ -5,10 +5,14 @@ on: paths: - '*/openapi.yaml' - '*/openapi.json' + - '.spectral.yaml' + - '.github/workflows/validate-openapi.yml' pull_request: paths: - '*/openapi.yaml' - '*/openapi.json' + - '.spectral.yaml' + - '.github/workflows/validate-openapi.yml' jobs: spectral: @@ -25,10 +29,15 @@ jobs: - name: Install Spectral run: npm install -g @stoplight/spectral-cli@6.16.0 + # `spectral:oas` is the built-in ruleset, but it must be referenced via + # a ruleset file's `extends` (see .spectral.yaml) — passing it directly + # as `--ruleset spectral:oas` is not valid in spectral-cli 6.x and fails + # with "Could not read ruleset". Error-severity findings gate the build; + # warnings are advisory (matches the hailbytes-sat repo's lint policy). - name: Lint ASM OpenAPI spec if: ${{ hashFiles('asm/openapi.yaml') != '' }} - run: spectral lint asm/openapi.yaml --ruleset spectral:oas --fail-severity warn + run: spectral lint asm/openapi.yaml --ruleset .spectral.yaml --fail-severity error - name: Lint SAT OpenAPI spec if: ${{ hashFiles('sat/openapi.yaml') != '' }} - run: spectral lint sat/openapi.yaml --ruleset spectral:oas --fail-severity warn + run: spectral lint sat/openapi.yaml --ruleset .spectral.yaml --fail-severity error diff --git a/.spectral.yaml b/.spectral.yaml new file mode 100644 index 0000000..5396358 --- /dev/null +++ b/.spectral.yaml @@ -0,0 +1,13 @@ +# Spectral ruleset for the HailBytes API documentation specs. +# +# Extends the built-in OpenAPI ruleset. Note that `--ruleset spectral:oas` +# is NOT a valid CLI reference in spectral-cli 6.x — the built-in ruleset +# must be referenced from a ruleset file via `extends`, which is what this +# file provides. The validate-openapi.yml workflow points at this file. +# +# Gating philosophy mirrors the hailbytes-sat repo: error-severity findings +# block; warnings are advisory. This lets the specs stay faithful to the +# real APIs — e.g. the SAT API genuinely uses trailing-slash paths +# (`/campaigns/`), which trips the advisory `path-keys-no-trailing-slash` +# rule but is correct. +extends: ["spectral:oas"] diff --git a/README.md b/README.md index 74e24fa..5feb8bc 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This repository contains the complete API reference, OpenAPI 3.1 specifications, | Path | Description | |------|-------------| | `asm/openapi.yaml` | OpenAPI 3.1 spec for the ASM REST API | -| `sat/openapi.yaml` | OpenAPI 3.1 spec for the SAT REST API *(coming soon)* | +| `sat/openapi.yaml` | OpenAPI 3.0 spec for the SAT REST API | | `mcp/` | MCP server definitions for ASM and SAT tool integrations *(coming soon)* | | `guides/` | Integration guides (SIEM, ticketing, MSSP multi-tenant) *(coming soon)* | | `sdk/` | SDK examples (Python, Go, TypeScript) *(coming soon)* | diff --git a/asm/openapi.yaml b/asm/openapi.yaml index 228f34f..af46c80 100644 --- a/asm/openapi.yaml +++ b/asm/openapi.yaml @@ -347,6 +347,7 @@ paths: get: operationId: listTags summary: List tags + description: Returns all organizational tags defined in the tenant. tags: [Tags] responses: '200': @@ -365,6 +366,7 @@ paths: post: operationId: createTag summary: Create tag + description: Creates a new organizational tag that can be applied to assets. tags: [Tags] requestBody: required: true diff --git a/docs/index.html b/docs/index.html index a41407e..66ce922 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,18 +4,73 @@