-
Originally opened by @owulveryck in cuelang/cue#1028 Hello, I am brand new to cue. I'd like to use it to define a template and a set of constraints for data schema. Here is a quick summary of what I am trying to achieve: My tests package event
// Definition of the envelop
#Envelop: {
subject: =~"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" // a uuid
source: =~"^net.mycompany.+"
type: =~"^net.mycompany.+:[cud]" // c : create u : update d : delete
dataContentType: string
}
#Data: {}
#Event: {
envelop: #Envelop
data: #Data
} I made a sample data producer and the directory tree looks like this:
And the
Now to the questions:
(it works if I replace the
I guess that I may have misunderstood an underlying concept of the language. Thank you for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Original reply by @PierreR in cuelang/cue#1028 (comment) Don't you need to prefix the call to #event with the event namespace (last segment of the import string) ? |
Beta Was this translation helpful? Give feedback.
-
Original reply by @owulveryck in cuelang/cue#1028 (comment) First self-answer, the
|
Beta Was this translation helpful? Give feedback.
-
Original reply by @owulveryck in cuelang/cue#1028 (comment) Here is a working example:
and the schema for the producer:
And a sample data:
|
Beta Was this translation helpful? Give feedback.
Original reply by @owulveryck in cuelang/cue#1028 (comment)
Here is a working example:
and the schema for the producer:
And a …