Skip to content

Problem validating JSON-LD @ nodes like @id #691

Answered by cueckoo
cueckoo asked this question in Q&A
Discussion options

You must be logged in to vote

Original reply by @mpvl in cuelang/cue#691 (comment)

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:

"@id"!: string   // must have an @id value node (PROPOSAL)

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 be…

Replies: 1 comment 2 replies

Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
2 replies
@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
Category
Q&A
Labels
None yet
1 participant