FlatteningError while working with remote "$ref" in typeConfiguration
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci il problema con lo schema mostrato ed esegui cfn generate, quindi esamina i log e il JSON di configurazione generato in remote/schema0 e remote/schema1. Il lavoro è completato quando un $ref remoto all’interno di typeConfiguration viene appiattito senza FlatteningError e la configurazione generata contiene un riferimento valido.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am working on a set of custom resource types that share two pieces of configuration over all planned types:
- The Environment property
- The EnvironmentMapping typeConfiguration
To limit the amount of duplicate JSON definitions, I took a page out of the teams book and created a bucket where I placed my remote definitions. And uploaded the shared definitions in that bucket.
Resulting in a definition JSON like follows:
{
"$schema": "https://schema.cloudformation.us-east-1.amazonaws.com/provider.definition.schema.v1.json#",
"properties": {
"Title": {
"description": "Title/Name of the folder.",
"type": "string"
},
"Environment": {
"$ref": "https://s3.eu-west-1.amazonaws.com/my.fake.schemas.bucket/environment.def.v0.json"
}
},
...
"typeConfiguration": {
"additionalProperties": false,
"properties": {
"EnvironmentMapping":{
"description": "A list of environment definitions detailing which secret is bound to which host.",
"type":"array",
"insertionOrder": false,
"items": {
"$ref": "https://s3.eu-west-1.amazonaws.com/my.fake.schemas.bucket/environment-config.def.v0.json"
}
}
},
"required": ["EnvironmentConfiguration"]
}
}
It works for the Environment property. That by itself and cfn generate finishes without problem. But when I add the reference to the typeConfiguration, cfn generate will produce the following error:
rpdk.core.jsonutils.utils.FlatteningError: Invalid ref: ('remote', 'schema1')
When perusing through the logs, I do see both schema's being picked up and verified. Both written to remote/schema0 and remote/schema1. And files are generated, but the config JSON looks as follows:
{
"additionalProperties": false,
"properties": {
"EnvironmentConfiguration": {
"type": "array",
"insertionOrder": false,
"items": {
"$ref": "#/remote/schema1"
}
}
},
"required": [
"EnvironmentConfiguration"
],
"definitions": {},
"typeName": "ORG::App::Folder"
}
I tried a few things:
- I swapped both
$ref-s: Flattening error. Resulting generated code did reflect the swapped configuration. - I added an extra object layer to the config definition json: Flattening error.
- Move external property into the definitions block: Works, generation successful. But it defeats the effort of keeping the amount of copied schema low.
I might dive into the code and see how both blocks are rendered and how they differ. But it is late for me, at the time of writing this issue, and maybe someone will see an obvious mistake I missed.
Thanks in advance.
- Lingua principale
- Python
- Stelle
- 336
- Fork
- 173
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws-cloudformation/cloudformation-cli
-
docs: `--use-docker` and `--no-docker` options of `cfn submit` are missing from the documentationAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
aws-cloudformation/cloudformation-cli#1117 · 1 commento · 6 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
aws-cloudformation/cloudformation-cli#1115 · 1 commento · 9 reazioni ·
Tutte le issue di aws-cloudformation/cloudformation-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Netcracker/qubership-ai-packages#266 ·
I maintainer di solito rispondono entro 1 giorno
-
PROCESSED_DATA_FOLDER: strip whitespace and treat empty as unsetForse già presa @TorecLuik l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
NL-BioImaging/BIOMERO.importer#63 ·
I maintainer di solito rispondono entro 1 giorno
-
MLX training-complete chat/merge suggestions omit --backend mlxForse già presa @vaputa l’ha presa oggi. Apertaneeds-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
MakazhanAlpamys/Soup#2913 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:security effort:S priority:P3 status:needs-triage type:chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
randomparity/kdive#3657 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aws/mcp-proxy-for-aws#476 ·
I maintainer di solito rispondono entro 1 giorno