aws-cloudformation / aws-cloudformation/cloudformation-cli-typescript-plugin
Resource model break when specifying an array with unique: true
- Lenguaje dominante
- TypeScript
- Estrellas
- 46
- Forks
- 18
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I've noticed when specifying an array with unique: true translates the model into a Set instead of an Array (makes sense)
but then when passing an actual array as example input, the resource provider fails. Consider for example:
```
"Tags": {
"type": "array",
"maxItems": 50,
"uniqueItems": true,
"insertionOrder": false,
"description": "An array of key-value pairs to apply to this resource.",
"items": {
"$ref": "#/definitions/Tag"
}
},
```
with input:
```
"Tags": [{
"Key": "name",
"Value": "value"
}]
```
gives error
`"message": "Error: Error: Unsupported type: object [Tag] for tags (Error)",`
Removing the `uniqueItems` fixes the issue and the main thing I notice is that in the generated code the type changes from a Set to an Array
Guía de contribución
Línea de trabajo
Reproduce el fallo con el esquema mostrado y la entrada de ejemplo; después, inspecciona el modelo TypeScript generado y la ruta de resource-provider en busca de arrays con uniqueItems habilitado. Compara el comportamiento al eliminar uniqueItems; se considera terminado cuando se acepta el array de ejemplo de objetos Tag y la unicidad sigue representándose correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- aws, typescript
- Área
- backend-api-design, cloud
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100