-
Thanks @mpvl for pointing me here.. I've new to cue so still having trouble understanding the following. Running:
I feel stupid asking.. but I simply have not been able to find how to declare that @id must be present. The inputs are testing.cue
minimal.json
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You did the right thing. The error that you are getting means that there was no concrete value and thus a required field is missing, thereby implying a required field is missing. We are seriously contemplating adding a
making it explicit that a field is required. This should make the corresponding error message also clearer. One benefit is that required fields are typically rarer in API, so The transition would be fairly straightforward, as |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#691. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
You did the right thing. The error that you are getting means that there was no concrete value and thus a required field is missing, thereby implying a required field is missing.
We are seriously contemplating adding a
!
marker for fields so you could write:making it explicit that a field is required. This should make the corresponding error message also clearer. One benefit is that required fields are typically rarer in API, so
!
should not have to be used too much. In addition, it results in a somewhat better model that was we currently have with?
. For one, we would have better error messages. :)The transition would be fairl…