Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide parsing functions from strings in WASM bindings #1317

Open
2 tasks
john-h-kastner-aws opened this issue Nov 12, 2024 · 0 comments
Open
2 tasks

Provide parsing functions from strings in WASM bindings #1317

john-h-kastner-aws opened this issue Nov 12, 2024 · 0 comments
Labels
feature-request This issue requets a substantial new feature

Comments

@john-h-kastner-aws
Copy link
Contributor

john-h-kastner-aws commented Nov 12, 2024

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

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
@john-h-kastner-aws john-h-kastner-aws added pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. feature-request This issue requets a substantial new feature and removed pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requets a substantial new feature
Projects
None yet
Development

No branches or pull requests

1 participant