Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Ignore incomplete values when exporting to json #441

Answered by mpvl
shykes asked this question in General
Discussion options

You must be logged in to vote

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 declared for lists and structs. A user may want to decl…

Replies: 2 comments 3 replies

Comment options

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

@mpvl
Comment options

@seh
Comment options

Answer selected by shykes
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants