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

Abierto
#340 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
57/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
azure, typescript
Área
backend, cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
TypeScript
Estrellas
44
Forks
14
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/apiops-cli

Todos los issues de Azure/apiops-cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.