Skip to content

Commit 0e81dc7

Browse files
authored
Merge pull request #483 from docker/correct-output-schema-definition
Correct output schema definition for the target block
2 parents 0678267 + 8ee0af9 commit 0e81dc7

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
All notable changes to the Docker Language Server will be documented in this file.
44

5+
## [Unreleased]
6+
7+
### Fixed
8+
9+
- Bake
10+
- correct the schema for the `output` attribute of the `target` block so that the list can also contain objects instead of only strings ([#77](https://github.com/docker/docker-language-server/issues/77))
11+
512
## [0.20.0] - 2025-10-14
613

14+
### Added
15+
716
- Compose
817
- update schema to the latest version
918

internal/bake/hcl/parser/schema.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,31 @@ var BakeSchema = &schema.BodySchema{
198198
},
199199
"output": {
200200
IsOptional: true,
201-
Constraint: schema.List{Elem: schema.AnyExpression{OfType: cty.String}},
201+
Constraint: schema.OneOf{
202+
schema.List{Elem: schema.AnyExpression{OfType: cty.String}},
203+
schema.List{Elem: schema.Object{
204+
Attributes: schema.ObjectAttributes{
205+
"type": &schema.AttributeSchema{
206+
Constraint: schema.OneOf{
207+
schema.LiteralValue{Value: cty.StringVal("local")},
208+
schema.LiteralValue{Value: cty.StringVal("tar")},
209+
schema.LiteralValue{Value: cty.StringVal("oci")},
210+
schema.LiteralValue{Value: cty.StringVal("docker")},
211+
schema.LiteralValue{Value: cty.StringVal("image")},
212+
schema.LiteralValue{Value: cty.StringVal("registry")},
213+
},
214+
},
215+
"attrs": &schema.AttributeSchema{
216+
IsOptional: true,
217+
Constraint: schema.Map{Elem: schema.LiteralType{Type: cty.String}},
218+
},
219+
"dest": &schema.AttributeSchema{
220+
IsOptional: true,
221+
Constraint: schema.LiteralType{Type: cty.String},
222+
},
223+
},
224+
}},
225+
},
202226
},
203227
"platforms": {
204228
IsOptional: true,

0 commit comments

Comments
 (0)