bolt
bolt copied to clipboard
Unexpected behavior mixing path and type definitions
With the following spec
type User {
...
eventLog: Event[];
}
type Event {
type: String;
id: String;
}
path /users/{uid} is User {
...
/eventLog/{eventId} is Event {
create() { isOwner(uid) }
}
}
I get an invalid compiled result:
...
"eventLog": {
"$eventId": {
".validate": "newData.hasChildren(['type', 'id'])",
"type": {
".validate": "newData.isString()"
},
"id": {
".validate": "newData.isString()"
},
"$other": {
".validate": "false"
},
".write": "data.val() == null && (auth != null && $uid == auth.uid)"
},
"$key1": {
".validate": "newData.hasChildren(['type', 'id'])",
"type": {
".validate": "newData.isString()"
},
"id": {
".validate": "newData.isString()"
},
"$other": {
".validate": "false"
}
}
}...
I may be doing something wrong (please advise if there is a better way), but thought it's worth bringing up anyway because if Firebase throws out the rule the compiler should also complain.
Yes - see issue #58
Cool, thanks.