Skip to content

Provide parsing functions from strings in WASM bindings #1317

Open
@john-h-kastner-aws

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis issue requets a substantial new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions