Skip to content

Conversation

@fede-kamel
Copy link

Fix test setup documentation - missing OpenAPI spec instructions

Problem

The current contributing documentation has a broken workflow that leaves developers stuck:

# Current docs say to run this, but openapi.yml doesn't exist:
npx prism mock path/to/your/openapi.yml

Issues:

  • ❌ References openapi.yml file that doesn't exist in the repo
  • ❌ Provides vague placeholder path path/to/your/openapi.yml
  • ❌ Missing critical setup steps to obtain the OpenAPI specification
  • ❌ Developers get "file not found" errors when following instructions

Solution

Add complete, executable instructions that actually work:

Before (broken):

# you will need npm installed
$ npx prism mock path/to/your/openapi.yml

After (fixed):

# 1. Download OpenAPI spec from .stats.yml (use latest valid openapi_spec_url)
curl -o openapi.yml [URL_FROM_STATS_YML]

# 2. Copy to main project directory
cp openapi.yml path/to/anthropic-sdk-python/

# 3. Start mock server
npx prism mock openapi.yml

# 4. Run tests
./scripts/test

Changes Made

  • Added missing download step for OpenAPI specification
  • Provided concrete commands instead of placeholder paths
  • Made workflow executable from start to finish
  • Added context explaining prerequisites and troubleshooting

Testing

  • Verified .stats.yml contains openapi_spec_url
  • Tested download and setup process
  • Confirmed mock server starts successfully
  • Validated tests run against mock server

Impact

  • New contributors can now follow the documentation without getting stuck
  • Reduces support burden from "documentation doesn't work" issues
  • Improves developer experience with clear, step-by-step guidance

Type: Documentation fix
Breaking: No
Fixes: Missing OpenAPI spec setup instructions

@fede-kamel fede-kamel requested a review from a team as a code owner July 4, 2025 14:57
docs:Improve the contributing.md for testing purposes
@fede-kamel
Copy link
Author

PR Updated - Rebased onto Latest Main

I've rebased this PR onto the latest main branch (100 commits forward). The documentation improvements are still relevant as the issue with the broken OpenAPI spec instructions remains in the current documentation.

Summary of Changes

This PR fixes the broken test setup documentation by providing complete, step-by-step instructions for:

  1. ✅ Downloading the OpenAPI specification from .stats.yml
  2. ✅ Setting up the Prism mock server correctly
  3. ✅ Running tests successfully

Current Issue in Main Branch

The existing docs still have the placeholder that doesn't work:

$ npx prism mock path/to/your/openapi.yml  # ❌ File doesn't exist

This PR provides clear, executable instructions that new contributors can actually follow.


Requesting review from:
@karpetrosyan @RobertCraigie @anthropics/sdk

Would appreciate feedback on these documentation improvements to help new contributors set up their test environment successfully. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants