Skip to content

Feature: Weighted default / Idiomatic way of changing the default #2140

@ghostsquad

Description

@ghostsquad

Is your feature request related to a problem? Please describe.

I'm building an opinion-based layer system, and I'd like to use things like "foo" | *"bar" (think about how the "if null then X" is the behavior of many fields), but allowing someone else to come along and say, actually, I prefer that foo be the default instead if the user doesn't specify something different.

Describe the solution you'd like

Either an explanation of how to accomplish this, or syntax to allow for a weight-based preference to default values.

Describe alternatives you've considered

N/A - I'm still learning CUE, coming from Jsonnet experience. Trying to figure out how to accomplish this common use-case.

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions