The extend form of the --build arg to generate only supports a strict json structure and doesn't follow the compose spec.
To Reproduce
With the sample score file:
score-compose init
score-compose generate --build `'hello-world={"context":".","args":["thing"]}'` score.yaml
json: cannot unmarshal array into Go struct field BuildConfig.args of type types.MappingWithEquals
Describe the bug
The extend form of the
--build
arg togenerate
only supports a strict json structure and doesn't follow the compose spec.To Reproduce
With the sample score file:
But it should succeed since the compose docs indicate that an array is allowed here (https://docs.docker.com/compose/compose-file/build/#args).
The work around is to use
'hello-world={"context":".","args":{"thing":null}}'
.Expected behavior
No error.
Additional context
The fix should be to replace the json unmarshal call with a call to the compose or mapstructure loaders instead.