cue-lang / docs-and-content

A place to discuss, plan, and track documentation on cuelang.org
6 stars 1 forks source link

howto: disallow a specific field name #58

Closed jpluscplusm closed 9 months ago

jpluscplusm commented 9 months ago

From Slack: https://cuelang.slack.com/archives/C012UU8B72M/p1707917281549819

How would you disallow a specific field name in CUE? (I know that it's obviously better to have an allowlist of fields and then close the struct, I am just wondering) Would this work? metadata: ["name"]: _|_

jpluscplusm commented 9 months ago

https://cuelang.org/cl/1176893

jpluscplusm commented 9 months ago

Closed via https://github.com/cue-lang/cuelang.org/commit/c306f991d205ba05796c83132ff9a3b876b2c1cd