-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Category
Cedar validation features/changes
Describe the feature you'd like to request
Allowing things like this
namespace Foo {
entity Bar;
}
< some other declarations ... >
namespace Foo {
entity Pancakes;
}
One motivation for this is so that concatenating valid schema fragments together produces a valid schema fragment in more cases (i.e., even when both fragments declare (different) items in the same namespace). Today, you can declare (different) items in the same namespace in different fragments, but not in the same fragment.
We cannot allow reopening namespace in the same fragment in the JSON schema syntax, because the JSON schema structure is a map from namespace name to declarations, so it would be a duplicate key in the JSON map. However, there's no reason we can't allow it in the human-readable syntax.
#1060 leaves a TODO pointing out one place that will need a code change for this.
Describe alternatives you've considered
Disallowing reopening a namespace in the same fragment, as a matter of policy. Or even more strongly, disallowing reopening a namespace in a different fragment (contrary to current behavior). However, it's not clear why we shouldn't allow this.
This is not a breaking change, but we could decide that it requires an RFC and not just this issue.
Additional context
No response
Is this something that you'd be interested in working on?
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change