Skip to content

Threat Intelligence Beta: OpenAPI spec, interactive reference, Postman#22

Merged
ejntaylor merged 13 commits into
mainfrom
openapi-threat-intel-beta
Apr 23, 2026
Merged

Threat Intelligence Beta: OpenAPI spec, interactive reference, Postman#22
ejntaylor merged 13 commits into
mainfrom
openapi-threat-intel-beta

Conversation

@ejntaylor
Copy link
Copy Markdown
Contributor

Summary

  • Adds an OpenAPI 3.1 spec for the new Threat Intelligence API — Beta, rendered as an interactive reference via starlight-openapi and served at /schemas/threat-intel-beta.yaml for import into Postman/Insomnia/Bruno/Hoppscotch, SDK generation, and LLM assistants.
  • Generates a ready-to-import Postman collection from the spec on every build (public/schemas/threat-intel-beta.postman_collection.json, gitignored) and adds a Run in Postman button + tooling guide to the Beta narrative page.
  • Consolidates the sidebar: the old "API solutions" + "API reference" split is merged into a single API solutions group, with Beta (narrative + reference) nested as one expandable item at the bottom of Threat Intelligence API, flagged with a New badge.

What changed

Area Change
Spec public/schemas/threat-intel-beta.yaml (OpenAPI 3.1) — single source of truth
Tooling openapi-to-postmanv2 generates the Postman collection at build-time via a small Astro integration in astro.config.mjs
Reference pages starlight-openapi@^0.22.1 renders operation pages at /api-reference/threat-intelligence-beta/...
Narrative page beta.md slimmed from 440 → 150 lines (endpoint tables/shapes now come from the spec); new sections for Postman/Insomnia/Bruno/Hoppscotch import, Claude Code usage, and SDK generation
Sidebar "API solutions" converted from autogenerate to manual items so the OpenAPI-generated sidebar groups can sit inline with the Markdown pages. Beta narrative + reference grouped under a single expandable "Beta tier API [New]" item

Tradeoffs the reviewer should weigh

  • Pinned plugin version. starlight-openapi@0.22.1 is the latest version compatible with the repo's Starlight 0.34.3 / Astro 5.9. Upgrading to 0.23+ requires bumping Starlight to ≥0.38 and Astro to ≥6 — out of scope for this PR.
  • Manual sidebar list. "API solutions" no longer autogenerates. New Markdown pages in its subfolders require an explicit entry in astro.config.mjs. Reasonable for the current 6 pages / 2 APIs; we can revisit if more APIs land.
  • Spec stability. While the API is Beta, the YAML will change without versioning. The tooling section of beta.md tells integrators to pin a commit if they need stability.

Test plan

  • npm run build completes cleanly; 177 pages built
  • Sidebar: API solutions → Threat Intelligence API → Beta tier API shows New badge and expands into Guide + Reference (Vulnerabilities / Products / Batch)
  • /api-solutions/threat-intelligence-api/beta/ renders the Run in Postman button and tooling guide
  • /api-reference/threat-intelligence-beta/ and its operation pages render with full descriptions (auth, pagination, errors, per-tag guides)
  • After deploy: https://docs.patchstack.com/schemas/threat-intel-beta.yaml and …/schemas/threat-intel-beta.postman_collection.json return 200
  • After deploy: Run in Postman button successfully imports the collection into a Postman workspace

🤖 Generated with Claude Code

ejntaylor and others added 7 commits April 22, 2026 11:36
…ference

Removes the per-endpoint tables, request bodies, field reference, and response
shapes from beta.md now that they're generated from the OpenAPI spec. Keeps
the narrative that belongs on a prose page: auth, platforms, pagination
strategy, error codes, testing recipes, and v2 migration notes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tag landing pages (e.g. /operations/tags/vulnerabilities/) and the overview
were rendering only the one-line blurb for each tag. Expand the info,
tags[].description, and the thinner operation descriptions so each
generated page has usable content: auth, platforms, pagination strategies,
errors, related pages, and per-tag endpoint guides with deep links.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pins starlight-openapi ^0.22.1 (latest version compatible with
Starlight 0.34 / Astro 5.9; 0.23+ requires Starlight ≥0.38). Renders the
Threat Intelligence Beta YAML under /api-reference/threat-intelligence-beta/
and adds an "API reference" sidebar group populated by openAPISidebarGroups.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Move schemas/threat-intel-beta.yaml into public/ so it's served at
  https://docs.patchstack.com/schemas/threat-intel-beta.yaml.
- Add a small Astro integration that runs openapi-to-postmanv2 at
  config:setup, writing public/schemas/threat-intel-beta.postman_collection.json
  on every build. The generated collection is gitignored — the OpenAPI
  YAML stays the single source of truth.
- Expand beta.md with a "Use with Postman / Insomnia / Bruno / Hoppscotch"
  section including a Run in Postman button, a Claude Code / LLM
  assistants section, and openapi-generator snippets for SDK generation.

Only the Threat Intelligence Beta API is wired up for now. Additional
APIs can drop a YAML into public/schemas/ and add an entry to the
postmanCollections array and starlightOpenAPI config.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Merge the standalone "API reference" top-level sidebar group into
  "API solutions" → "Threat Intelligence API", immediately below the
  Beta narrative. Users now have a single entry point to find
  anything API-related; the narrative and interactive reference sit
  side-by-side under the same parent.
- Convert "API solutions" from autogenerate to a manual items list
  so the generated OpenAPI pages (openAPISidebarGroups) can be
  interleaved with the .md files.
- Pin Beta to the top of the Threat Intelligence group via
  sidebar.order: 0 and add a "New" tip badge so it's discoverable.
- Rename the OpenAPI reference label from "Threat Intelligence API
  (Beta)" to "Interactive reference (Beta)" to avoid redundancy with
  the parent group name.

Trade-off: new pages dropped into API solutions subfolders no longer
auto-appear in the sidebar — astro.config.mjs needs a manual entry.
Acceptable for the current 6 pages across 2 APIs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The manual items list dropped the index.mdx entry that autogenerate was
picking up. Add { slug: 'api-solutions' } at the top so the Introduction
page appears before App API and Threat Intelligence API, preserving the
original order.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move the Beta entries to the bottom of the Threat Intelligence API
group and nest them under a single expandable "Beta tier API" group
(with the "New" badge on the group itself). The narrative is now
labelled "Guide" and the OpenAPI-generated pages are labelled
"Reference" — both together inside the Beta parent, so everything
Beta is one click and one glance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for deluxe-meerkat-8daf24 ready!

Name Link
🔨 Latest commit 9859066
🔍 Latest deploy log https://app.netlify.com/projects/deluxe-meerkat-8daf24/deploys/69e9b7af0724c5000827fa80
😎 Deploy Preview https://deploy-preview-22--deluxe-meerkat-8daf24.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

ejntaylor and others added 3 commits April 22, 2026 12:06
Strip `id` and `_postman_id` UUIDs from the generated collection (both
optional in Collection v2.1 — Postman assigns new ones on import) and
add example values to schemas where openapi-to-postmanv2 was otherwise
synthesising random data (OffsetPagination, CursorPagination,
ProductType/Name/Version path params). Two consecutive builds now
produce byte-identical output.

Commit the collection so it's reachable via GitHub raw URL the moment
this PR merges, instead of waiting on a docs.patchstack.com deploy.
Build-time regeneration stays in place so the JSON can never drift
from the YAML.

Update the Run in Postman button to use the GitHub raw URL on main and
add a direct-download fallback link for testing locally and on deploy
previews — Postman's cloud cannot fetch a localhost: URL, which was
producing the "blank Run in Postman modal" symptom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The "Run in Postman" button relied on the deprecated
`app.getpostman.com/run-collection/?collection=<url>` endpoint, which no
longer accepts raw collection URLs — it only works with collections
published to Postman's Public API Network and referenced by UID. The
button silently did nothing when clicked.

Replacing it with a plain download link plus a `File → Import → Link`
instruction is honest about the flow and actually works today. Can be
re-added later if/when the collection is published to Postman.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread src/content/docs/API solutions/Threat Intelligence API/beta.md Outdated
ejntaylor and others added 3 commits April 23, 2026 06:50
Per Mario's review on PR #22: the app.getpostman.com/run-collection/?collection=<url>
endpoint was deprecated. Postman now only accepts published collections
referenced by UID through the Public API Network — raw JSON URLs fail
silently, which is what produced the blank-modal symptom.

Replace the button with the honest flow: download + File → Import → Link.
Can be re-added later without a breaking change if someone publishes the
collection to Postman.

Co-Authored-By: Mario Tarosso <mariojgt2@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rename the sidebar group and page title from "Beta tier API" to
"Beta API" — Beta isn't an access tier alongside Standard / Extended,
it's a new generation of the API. The "tier" naming invited the wrong
mental model.

Add a "Which API should I use?" comparison table to Overview and
clearly flag Beta as available to selected partners working directly
with Patchstack only. Update the Beta guide intro and Overview's Beta
blurb to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Starlight applies .large (heavier weight + larger size) to sidebar
group labels. In a sub-group where Beta API sits next to leaf items
(Standard tier API, Extended tier API, API properties) the bold
treatment made Beta look visually promoted, even though its "New"
badge already carries the emphasis.

Scope the override via :has() so it only fires on group labels that
carry a badge — today that's Beta API, and any future badged group
will get the same treatment automatically without affecting plain
groups like App API or Threat Intelligence API.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ejntaylor ejntaylor merged commit cb280ef into main Apr 23, 2026
4 checks passed
@ejntaylor ejntaylor deleted the openapi-threat-intel-beta branch April 23, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants