Azure / Azure/apiops-cli

Add dedicated OData API support (extract & publish)

未关闭
#124 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Enhancement P2
主要语言
TypeScript
星标
26
派生
9
平均合并
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

贡献指南

打开贡献指南

调研方向

从 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 摘要。