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

Aperta
#340 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
57/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
azure, typescript
Ambito
backend, cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
44
Fork
14
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/apiops-cli

Tutte le issue di Azure/apiops-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.