Skip to content

Ignore incomplete values when exporting to json #441

Answered by cueckoo
cueckoo asked this question in General
Discussion options

You must be logged in to vote

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 concrete
  • field!: 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…

Replies: 1 comment 3 replies

Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
3 replies
@cueckoo
Comment options

cueckoo Jul 3, 2021
Collaborator Author

@cueckoo
Comment options

cueckoo Jul 3, 2021
Collaborator Author

@cueckoo
Comment options

cueckoo Jul 3, 2021
Collaborator Author

Answer selected by cueckoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant