Unexpected "id", "type", "name" in extraction files

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

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
57/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
azure, typescript
領域
backend, cli

研究方向

Start with the extraction and artifact-format documentation referenced in the issue, then trace how extraction serializes APIM resources to JSON. Check whether the CLI supports excluding managed fields or whether extraction always writes them. Done means the behavior is explained or the JSON output can omit id, type, and name as requested.

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

描述

type:question
Question

From here: https://github.com/Azure/apiops-cli/blob/main/docs/reference/artifact-format.md

APIM-managed fields (like id, type, name) are not stored — they're reconstructed at publish time

Can you explain why the JSON files created by extraction have "id", "type", "name" in them? "type" and "name" are unnecessary, and "id" is environment specific. An example from a named value file namedValueInformation.json:

{ "id": "/subscriptions/d0d2d3bd-2eca-495a-b5a3-c510c051b66a/resourceGroups/rg-ourservices-dev-001/providers/Microsoft.ApiManagement/service/apim001/namedValues/My-Centre-Subscription-Rate-Limit-Calls", "type": "Microsoft.ApiManagement/service/namedValues", "name": "My-Centre-Subscription-Rate-Limit-Calls", "properties": { "displayName": "My-Centre-Subscription-Rate-Limit-Calls", "value": "10", "tags": [ "my-centre-tag" ], "secret": false } }

I would expect id, name and type to be absent like so:

{ "properties": { "displayName": "My-Centre-Subscription-Rate-Limit-Calls", "value": "10", "tags": [ "my-centre-tag" ], "secret": false } }

Am I missing something, is there a way I can exclude these properties? They're everywhere, I don't want the noise nor do I want to have to include them in our override files.

Thanks!

Context

Using v1.0.5

PS> apiops extract --resource-group rg-ourservices-dev-001 `
>> --service-name apim001 `
>> --output .\extract `
>> --subscription-id d0d2d3bd-2eca-495a-b5a3-c510c051b66a `
>> --format json
主要語言
TypeScript
星號
44
分支
14
PR 合併指標
30 天內沒有已合併 PR

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

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

Azure/apiops-cli 的其他 Issue

查看 Azure/apiops-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

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

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