Skip to content

Add wrapper functions for JSON Built-in functions in package space #5447

@OceanOak

Description

@OceanOak

We want to add Json package functions to wrap the existing built-in functions jsonSerialize and jsonParse

Example:

let serialize<'a> (a: 'a) : String =
  Builtin.jsonSerialize<'a> a

When executing the test Stdlib.Json.serialize<Int64> 0L = "0" we encounter the following error:

Unsupported type in JSON: 'a. Some types are not supported in Json serialization, and cannot be used as arguments to Builtin.jsonParse or Builtin.jsonSerialize

The built-in function is called with the generic type 'a instead of the actual type (e.g. Int64) that was passed in the package function.

Goal: ensure the actual type is properly passed to the built-in function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions