Description
Category
Other
Describe the feature you'd like to request
The parsing functions for our JSON-based data formats in the WASM api accept JavaScript objects rather than accepting and parsing string. This makes sense if the caller is programmatically constructing the objects, but it doesn't work well when the object is being read from some text input (e.g., if implementing an editor for schema files and entity data). The caller must first parse the text into a JavaScript object, but this loses source location information, so serde_json
cannot include source information in its parse error.
For example, you might see an error like failed to parse schema in JSON format: missing field `type` at line 26 column 11
when parsing a schema at the CLI, but the WASM interface would only return failed to parse schema in JSON format: missing field `type`
.
It also prevents a special-case error message we've added to advise the user when the provide a schema in the wrong format.
We should add these functions to the wasm API
cedar/cedar-policy/src/ffi/check_parse.rs
Line 90 in ce0bd0c
cedar/cedar-policy/src/ffi/check_parse.rs
Line 132 in ce0bd0c
cedar/cedar-policy/src/ffi/check_parse.rs
Line 181 in ce0bd0c
Describe alternatives you've considered
.
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
Activity