Skip to content

[WIP] Apply TypeSpec customizations for APIView feedback#3

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/address-apiview-feedback
Closed

[WIP] Apply TypeSpec customizations for APIView feedback#3
Copilot wants to merge 3 commits intomainfrom
copilot/address-apiview-feedback

Conversation

Copy link

Copilot AI commented Feb 5, 2026

APIView Feedback for azure-cosmos (Python)

APIView URL: https://spa.apiview.dev/review/c1c8a8095ae24413aa1bb1705a7c7b77?activeApiRevisionId=aa280dcff3c74b3cb2c3e0902c109359

APIView Feedback Status

LineNo Addressed? Summary
3354 ⚠️ No - Not Applicable TypeSpec customizations cannot be applied because azure-cosmos does not have a TypeSpec specification. Issue must be addressed through Python code customizations in azure-sdk-for-python repo using _patch.py files per the Python Customization Guide.

Complete Analysis

  • Investigated azure-rest-api-specs repository thoroughly
  • Confirmed no TypeSpec specification exists for azure-cosmos
  • Verified existing cosmos-db specifications only cover ARM and Tables APIs
  • Consulted TypeSpec customization documentation
  • Identified proper solution path per Microsoft guidelines
  • Documented comprehensive findings and recommendations

Key Findings

  1. No TypeSpec Specification: The azure-cosmos Python SDK does not have a TypeSpec definition in azure-rest-api-specs

    • Searched all 3,006 TypeSpec files in the repository
    • Only found cosmos-db/resource-manager (ARM) and cosmos-db/data-plane/Tables specifications
    • Neither generates the azure-cosmos NoSQL API package
  2. TypeSpec Customizations Not Applicable:

    • TypeSpec client customizations require an existing TypeSpec specification
    • Without main.tsp and tspconfig.yaml, decorators like @@alternateType cannot be used
    • Per TypeSpec customization guide, language-specific customizations should be used instead

Recommended Solution

Immediate Action: Address in azure-sdk-for-python repository using Python-specific customizations:

  • Method: Use _patch.py files to modify exception classes
  • Location: azure-sdk-for-python/sdk/cosmos/azure-cosmos/
  • Change: Ensure headers property is typed as Dict[str, str] or dict[str, str]
  • Reference: Python Customization Guide

Future Option: If Cosmos DB adopts TypeSpec, create specification at /specification/cosmos-db/data-plane/CosmosDB/ and apply client customizations via client.tsp

Documentation

Full analysis with code examples and detailed recommendations in APIVIEW_FEEDBACK_ANALYSIS.md

Original prompt

This section details on the original issue you should resolve

<issue_title>Address APIView feedback for azure-cosmos (Python)</issue_title>
<issue_description>Apply TypeSpec client customizations to address APIView feedback comments.

Current Task

Package Name: azure-cosmos
Language: Python
APIView URL: https://spa.apiview.dev/review/c1c8a8095ae24413aa1bb1705a7c7b77?activeApiRevisionId=aa280dcff3c74b3cb2c3e0902c109359

Feedback to Address

APIView Comments (1 unresolved)

LineNo Element LineText CommentText
3354 azure.cosmos.exceptions.CosmosAccessConditionFailedError class azure.cosmos.exceptions.CosmosAccessConditionFailedError(CosmosHttpResponseError): Use native dict for headers to ensure consistency with other endpoints, as addressed in PR swathipil/azure-rest-api-specs#43341.

Constraints

Output Requirements

  • If a Commit SHA is provided, use it as the base for your changes

  • Include the APIView URL in PR description

  • PR description MUST include a markdown table in EXACTLY this format (do not change column names):

    LineNo Addressed? Summary
    Brief description of changes (or "No action needed" if feedback says keep as-is)
    ⚠️ Reason not addressed (unclear info, TypeSpec limitation, needs SDK code customization)
  • Note: If a review comment CANNOT be addressed, explanation comments MUST NOT be added to the client.tsp file.
    ONLY explain in the "Summary" column why it could not be addressed.

  • Include SDK code customization guidance: https://github.com/Azure/autorest.python/blob/main/docs/customizations.md


Auto-generated by feedback customizations tool
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 5, 2026 17:35
…not applicable

Co-authored-by: swathipil <76007337+swathipil@users.noreply.github.com>
…peSpec spec

Co-authored-by: swathipil <76007337+swathipil@users.noreply.github.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.

Address APIView feedback for azure-cosmos (Python)

2 participants