Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Nov 17, 2025

Improve Admin API Documentation

Summary

This PR comprehensively reviews and updates all docstrings in the Admin class and its child resource classes (ProjectResource, ApiKeyResource, OrganizationResource) to ensure they follow RST formatting standards and include comprehensive code-block usage examples. All docstrings now have proper whitespace formatting around code blocks to ensure Sphinx renders them correctly.

Problem

The Admin API documentation had several issues:

  • Some methods were missing code-block usage examples
  • Alias methods (get, describe) lacked examples showing how to use them
  • Code blocks were missing empty lines after them, which can cause Sphinx rendering issues
  • Some examples had syntax errors (missing commas)
  • The __init__ method lacked usage examples showing different initialization patterns

Solution

  • Added comprehensive examples: All methods now include code-block examples demonstrating different ways to use each function
  • Fixed formatting: Added empty lines after all code blocks to ensure proper Sphinx rendering
  • Enhanced alias methods: Added examples to get() and describe() methods in all resource classes
  • Fixed syntax errors: Corrected missing comma in project creation example
  • Improved initialization docs: Added examples showing environment variable usage, explicit credentials, and additional headers

User-Facing Impact

Users will now have:

  • Better discoverability: Clear examples for every Admin API method, including aliases
  • Multiple usage patterns: Examples showing different ways to accomplish the same task (e.g., using project_id vs name)
  • Properly rendered docs: Code blocks will render correctly in Sphinx-generated documentation
  • Complete coverage: No methods are left without examples, making the API easier to learn and use

Usage Examples

Before

# Alias methods had no examples
admin.project.get(project_id="...")  # No documentation example

After

# Now includes comprehensive examples
admin.project.get(project_id="42ca341d-43bf-47cb-9f27-e645dbfabea6")
# Shows both project_id and name usage patterns

Initialization Examples

# Environment variables
admin = Admin()  # Reads from PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET

# Explicit credentials
admin = Admin(
    client_id="your-client-id",
    client_secret="your-client-secret"
)

# With additional headers
admin = Admin(
    client_id="your-client-id",
    client_secret="your-client-secret",
    additional_headers={"X-Custom-Header": "value"}
)

Breaking Changes

None. This is a documentation-only change that does not affect any API functionality or behavior.

@jhamon jhamon force-pushed the 2025-11-17-5ixs-d0JFH branch from cf2fd11 to bf4c0af Compare November 17, 2025 16:43
@jhamon jhamon marked this pull request as ready for review November 17, 2025 17:06
@jhamon jhamon merged commit cec5c5a into release-candidate/2025-10 Nov 17, 2025
27 checks passed
@jhamon jhamon deleted the 2025-11-17-5ixs-d0JFH branch November 17, 2025 17:06
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