Skip to content

Conversation

@raethlo
Copy link

@raethlo raethlo commented Feb 2, 2026

Summary

  • Implements programmatic OpenAPI 3.0 spec generator that derives documentation from existing type definitions
  • Adds parameter metadata for all 31 query parameters with descriptions, examples, and validation constraints
  • Adds response schemas for VerboseResult, ErrorResponse, and all nested types (Cookie, XHRRequestData, etc.)
  • Generates openapi.json as part of the build process
  • Documents compatibility with ScrapingBee, ScrapingAnt, and ScraperAPI parameters
  • Fixes js_scenario schema to match actual implementation format (action as key, param as value)

Implementation Details

  • src/openapi/parameter-metadata.ts: Metadata for each query parameter (descriptions, examples, validation)
  • src/openapi/response-schemas.ts: OpenAPI schemas derived from types.ts
  • src/openapi/types.ts: TypeScript interfaces for OpenAPI objects
  • scripts/generate-openapi.ts: Generator script that produces the complete spec
  • openapi.json: Generated OpenAPI 3.0.3 specification (auto-generated on build)

Test Plan

  • Run npm run generate:openapi to verify generator works
  • Verify openapi.json is created with correct structure
  • Test API with curl commands to validate documented behavior
  • Confirm js_scenario format matches actual implementation
  • Run npm run build to verify integration with build process

🤖 Generated with Claude Code

raethlo and others added 6 commits February 2, 2026 11:32
- Create programmatic OpenAPI spec generator that derives documentation from existing type definitions
- Add parameter metadata for all 31 query parameters with descriptions, examples, and validation constraints
- Add response schemas for VerboseResult, ErrorResponse, and nested types
- Generate openapi.json as part of build process
- Document compatibility with ScrapingBee, ScrapingAnt, and ScraperAPI parameters
- Fix js_scenario schema to match actual implementation format (action as key, param as value)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
npm automatically adds node_modules/.bin to PATH when running scripts, so npx is not needed for locally installed packages.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prevents API tools from pre-populating boolean parameters that default
to false. Keeps meaningful defaults like render_js=true, timeout=140000.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only url remains required, all other parameters are optional with no
defaults. This prevents API tools from pre-populating any fields.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant