Azure / Azure/apiops-cli

Add dedicated OData API support (extract & publish)

未關閉
#124 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Enhancement P2
主要語言
TypeScript
星號
29
分支
10
平均合併
1 天 3 小時
30 天內合併 PR
20

描述

## Summary

apiops-cli currently handles OData APIs via the generic OpenAPI fallback path, which does not capture OData-specific artifacts. This issue tracks adding first-class OData support to both the extractor and publisher.

## Background

Azure API Management added OData API support, but tooling across the ecosystem has lagged behind (see [Azure/apiops#419](https://github.com/Azure/apiops/issues/419)). Users report that entity sets and functions are lost when extracting/publishing OData APIs.

## Current behavior

- **Extractor** (`api-extractor.ts`): No special-case handling for `odata` API type — it falls through to the generic `openapi-link` export, which misses OData-specific resources.
- **Publisher** (`api-publisher.ts`): Recognizes `odata` as a valid `apiType` string but has no OData-specific import format or schema handling.
- **APIM Client** (`apim-client.ts`): `getExportFormat()` returns `'openapi-link'` for OData via the `default` case — no dedicated export format.

## What needs to change

1. **Extract**: Add OData-specific handling in `api-extractor.ts` to export CSDL schemas, entity sets, and functions via the appropriate APIM export format.
2. **APIM Client**: Add an `'odata'` case to `getExportFormat()` returning the correct APIM export format for OData APIs (investigate whether APIM supports a dedicated OData/CSDL export link).
3. **Publish**: Add OData-specific import format handling in `getImportFormat()` so that CSDL schemas and entity sets are correctly imported on publish.
4. **Tests**: Add unit/integration tests covering OData extract and publish flows.

## Related

- [Azure/apiops#419](https://github.com/Azure/apiops/issues/419) — original feature request in the apiops toolkit repo

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 api-extractor.ts、api-publisher.ts 和 apim-client.ts 開始,追蹤現有的 apiType 處理以及 getExportFormat()/getImportFormat() 路徑。檢查 APIM API 格式文件或現有用戶端行為,以確認 OData/CSDL 匯出和匯入格式。完成的標準是 OData 實體集和函式能夠在 extract 和 publish 後保留,並且有涵蓋這兩條流程的單元測試或整合測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, typescript
領域
api, cli
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。