You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest stable release?
Yes.
What did you do?
! exec cue vet x.cue
stdout 'description: field not allowed'
-- x.cue --
data: {
type: "object"
properties: grandparentAuthor: {
type: "ref"
ref: "something"
description: "When parent is a reply to another post, this is the author of that post."
}
} & #LexType
#LexType: #LexArray | #LexObject | #LexRef
#LexObject: {
type!: "object"
description?: string
properties!: [string]: #LexType
}
#LexRef: string | {
type!: "ref"
ref!: string
}
#LexArray: {
type!: "array"
}
What did you expect to see?
A passing test. The error is caused by the fact that #LexRef doesn't allow the field "description" that's present in the data, but the error message doesn't mention anything about that as a possible cause.
What did you see instead?
> ! exec cue vet x.cue
[stderr]
data: 3 errors in empty disjunction:
data: conflicting values string and {type:"object",properties:{grandparentAuthor:{type:"ref",ref:"something",description:"When parent is a reply to another post, this is the author of that post."}}} (mismatched types string and struct):
./x.cue:2:7
./x.cue:19:10
data.type: conflicting values "array" and "object":
./x.cue:3:8
./x.cue:9:5
./x.cue:11:11
./x.cue:25:9
data.type: conflicting values "ref" and "object":
./x.cue:3:8
./x.cue:9:5
./x.cue:11:36
./x.cue:20:9
[exit status 1]
> stdout 'description: field not allowed'
FAIL: /tmp/z.txtar:2: no match for `description: field not allowed` found in stdout
ISTM that a much better job could be done by detecting the type discriminator field and including only errors for the arm of the disjunction with the corresponding field. But even so, the error should at least mention the fact that description isn't allowed by #LexRef.
The text was updated successfully, but these errors were encountered:
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes.
What did you do?
What did you expect to see?
A passing test. The error is caused by the fact that
#LexRef
doesn't allow the field "description" that's present in the data, but the error message doesn't mention anything about that as a possible cause.What did you see instead?
ISTM that a much better job could be done by detecting the
type
discriminator field and including only errors for the arm of the disjunction with the corresponding field. But even so, the error should at least mention the fact thatdescription
isn't allowed by#LexRef
.The text was updated successfully, but these errors were encountered: