Open khieta opened 9 months ago
I think we want a formatter like the Cedar policy formatter. That being said, I think there is a lot of room for improvement.
Removed the "papercut" label since the easy issues were addressed by #780 (and the issue text has been updated to reflect this). Remaining issues are best addressed by a standalone formatter, rather than the Display
trait.
An item that #780 missed relates to multiple namespaces
namespace NS2 {
}namespace NS1 {
}
was generated from
{
"NS1": {
"entityTypes": {},
"actions": {}
},
"NS2": {
"entityTypes": {},
"actions": {}
}
}
Thanks for pointing that out @hakanson (and sorry for the delayed reply!!) I added this fix to #1160, which will be released as part of 4.0.
Category
Other
Describe the feature you'd like to request
The current
Display
trait for Cedar schemas sometimes produces ugly output (see example below). I think we should build a formatter for schemas, akin to the formatter we have for policies.Some ideas for improving:
__cedar
prefix if not needed.Example
Here is the CLI output of converting the this JSON schema to the new syntax:
Here is the (manually) prettified form:
Describe alternatives you've considered
No response
Additional context
No response
Is this something that you'd be interested in working on?