Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Jan 28, 2026

Summary

Updates the OpenAPI codegen script to support per-module API version and branch configuration, enabling:

  • db_control and db_data to use the 2026-01.alpha spec from the jhamon/fts branch
  • inference, oauth, and admin to remain on the 2025-10 stable spec

Problem

The Full-Text Search (FTS) feature requires new API endpoints and models that are only available in the alpha API spec. The existing codegen script only supports a single API version for all modules, making it impossible to incrementally adopt the alpha API.

Solution

Refactored build-oas.sh to:

  1. Use functions (get_module_version, get_module_branch) for per-module configuration
  2. Support different API versions per module (2026-01.alpha for FTS modules, 2025-10 for others)
  3. Track processed branches to avoid redundant builds
  4. Update api_version.py to use the db_data version (for gRPC compatibility)

API Version Configuration

Module API Version Branch
db_control 2026-01.alpha jhamon/fts
db_data 2026-01.alpha jhamon/fts
inference 2025-10 jhamon/fts
oauth 2025-10 jhamon/fts
admin 2025-10 jhamon/fts

Breaking Changes

The alpha API has a fundamentally different structure:

  • Old (2025-10): Uses spec with ServerlessSpec, PodSpec, ByocSpec
  • New (alpha): Uses deployment with ServerlessDeployment, PodDeployment, ByocDeployment and a schema field

The existing SDK code references models that don't exist in the alpha spec. This is expected - subsequent tickets (SDK-101 through SDK-115) will add compatibility layers and update the SDK to work with the new API structure.

New Models in Alpha Spec

db_control:

  • Deployment, ServerlessDeployment, PodDeployment, ByocDeployment
  • Schema, SchemaFields

db_data:

  • Document, DocumentSearchRequest, DocumentSearchResponse
  • DocumentUpsertRequest, DocumentUpsertResponse
  • TextQuery, VectorQuery, ScoreByQuery

Testing

  • Verified API_VERSION constants are correct in each module's __init__.py
  • Mypy and unit tests fail due to SDK code referencing old models (expected, will be fixed in SDK-101+)

Related

  • Linear: SDK-99
  • Next steps: SDK-101 (Schema field type classes) through SDK-115 (Documentation)

Note

Introduces per-module OpenAPI versioning and regenerates clients to adopt the alpha spec where needed.

  • Refactors codegen/build-oas.sh to use per-module versions (db_control/db_data -> 2026-01.alpha, others remain 2025-10), checkout apis on jhamon/fts, verify each version once, and write pinecone/openapi_support/api_version.py using the db_data version; makes underscore-fix step conditional
  • Regenerates OpenAPI clients: db_control moves to 2026-01.alpha (new schema/deployment/read_capacity structures; adds ByocDeployment; updates models like BackupModel, ConfigureIndexRequest, CreateIndexForModelRequest; updates method docs and default X-Pinecone-Api-Version); admin clients get minor typing cleanup (remove cast/unused imports)
  • CI: in .github/workflows/on-pr.yaml, skip linting and unit-tests when PR base is fts

Written by Cursor Bugbot for commit 6a28437. This will update automatically on new commits. Configure here.

Update the codegen script (build-oas.sh) to support per-module API
version and branch configuration. This enables generating db_control
and db_data clients from the alpha API spec (2026-01.alpha) while
keeping inference, oauth, and admin on the stable spec (2025-10).

Key changes:
- Refactor build-oas.sh to use functions for version/branch lookup
- Generate db_control and db_data from 2026-01.alpha spec
- Generate inference, oauth, admin from 2025-10 spec
- Update api_version.py to use alpha version for gRPC compatibility
- Add conditional file checks for underscore manipulation

The alpha API introduces a new schema-based index creation model with
"deployment" and "schema" fields replacing the legacy "spec" approach.
This is a breaking change from the stable API - subsequent SDK updates
(SDK-101 through SDK-115) will add compatibility layers.

Resolves SDK-99
The alpha API has breaking changes from the stable API structure.
Linting and unit tests will fail until SDK compatibility work
(SDK-104 through SDK-107) is complete.

This matches the existing behavior for integration tests which
are already skipped for fts-targeted PRs.

See SDK-116 for re-enabling tests after compatibility work.
@jhamon jhamon marked this pull request as ready for review January 28, 2026 16:18
@jhamon jhamon added enhancement New feature or request python Pull requests that update Python code labels Jan 28, 2026
Address Bugbot feedback:
- Remove redundant current_apis_branch tracking (processed_branches
  already handles deduplication in the main loop)
- Replace get_module_branch() function with APIS_BRANCH constant
  since all modules currently use the same branch
Since all modules use the same APIS_BRANCH constant, move the
checkout_and_build_apis call before the module loop and remove
the unnecessary processed_branches tracking.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

from __future__ import annotations

from typing import TYPE_CHECKING, Any, Dict, cast
from typing import TYPE_CHECKING
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused TYPE_CHECKING import in generated API files

Low Severity

The TYPE_CHECKING constant is imported from typing but is never used in these files. There is no if TYPE_CHECKING: block anywhere in the file - TYPE_CHECKING only appears in the import statement itself. This affects api_keys_api.py, organizations_api.py, projects_api.py, manage_indexes_api.py, and bulk_operations_api.py. The PR changed the import from from typing import TYPE_CHECKING, Any, Dict, cast to from typing import TYPE_CHECKING, removing cast usage but leaving the unused TYPE_CHECKING.

Additional Locations (2)

Fix in Cursor Fix in Web

@jhamon jhamon merged commit 1209ebe into fts Jan 28, 2026
7 checks passed
@jhamon jhamon deleted the jhamon/sdk-99-generate-openapi-client-for-2026-01alpha-api branch January 28, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant