Skip to content

cue vet on empty file #3362

Answered by mvdan
hjet asked this question in Q&A
Aug 8, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The testscript below represents what you describe above:

exec cue vet schema.cue data.json -d '#Config'

-- schema.cue --
#Config: {
	num: int
}
-- data.json --

Luckily, I also discovered this bug recently while investigating a different issue, and the bug got resolved in master in https://review.gerrithub.io/c/cue-lang/cue/+/1198874 - this fix is included in the latest release candidate. In short, we used to parse .json files as if they were .jsonl, and an empty .json file was then incorrectly decoded as a stream of zero values - which cue vet treated as a no-op.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hjet
Comment options

Answer selected by hjet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants