Skip to content

fix: preserve empty slices in OmitEmpty for schema validation#873

Merged
ndeloof merged 1 commit into
compose-spec:mainfrom
glours:fix-cache-to-empty-array
May 18, 2026
Merged

fix: preserve empty slices in OmitEmpty for schema validation#873
ndeloof merged 1 commit into
compose-spec:mainfrom
glours:fix-cache-to-empty-array

Conversation

@glours

@glours glours commented May 18, 2026

Copy link
Copy Markdown
Collaborator

OmitEmpty returned a nil slice for empty []any{} inputs, which then serialised as null during schema.Validate's JSON round-trip and broke validation for empty YAML lists (e.g. cache_to: []).

Fixes docker/buildx#3849

OmitEmpty returned a nil slice for empty []any{} inputs, which then
serialised as `null` during schema.Validate's JSON round-trip and
broke validation for empty YAML lists (e.g. `cache_to: []`).

Fixes docker/buildx#3849

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours glours requested a review from ndeloof as a code owner May 18, 2026 13:26
@glours glours self-assigned this May 18, 2026
@ndeloof ndeloof merged commit c9079e9 into compose-spec:main May 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v0.34] buildx bake fails with "cache_to must be a array" when cache_to is an empty []

2 participants