-
Originally opened by @shykes in cuelang/cue#441 I would like to export the concrete parts of a value as Json, without triggering an error on incomplete parts. Any incomplete values in the tree should simply be ignored. Currently I think I remember that an earlier version of Am I missing something obvious? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Original reply by @mpvl in cuelang/cue#441 (comment) As far as I remember, non-concrete values were always forbidden in JSON. But this does seem reasonable. In fact, this touches upon a proposal I've been trying to get more feedback on :), one of the few remaining proposals for a backwards-incompatible language change: Introduce
This addresses several issues:
With the current proposal, the use of This would be mostly compatible with the old semantics, but makes |
Beta Was this translation helpful? Give feedback.
Original reply by @mpvl in cuelang/cue#441 (comment)
As far as I remember, non-concrete values were always forbidden in JSON.
But this does seem reasonable.
In fact, this touches upon a proposal I've been trying to get more feedback on :), one of the few remaining proposals for a backwards-incompatible language change:
Introduce
!
as a field marker, and introduce the following rules, w.r.t. exporting:field: int
: export only if concretefield!: int
: optional, but needs to be explicitly declared for a complete schema to be valid.field?: 1
: always optional, don't export, even if concrete.This addresses several issues:
It is currently not possible to require a field to be explicitly de…