Skip to content

read(jsonstring) in docs raises error #59

@jtrakk

Description

@jtrakk

https://juliadata.github.io/StructTypes.jl/stable/#StructTypes.AbstractType uses read on a json string

car = StructTypes.read("""
{
    "type": "car",
    "make": "Mercedes-Benz",
    "model": "S500",
    "seatingCapacity": 5,
    "topSpeed": 250.1
}""", Vehicle)

but I think read only works on filenames.

julia> # example from StructTypes deserialization
       car = StructTypes.read("""
       {
           "type": "car",
           "make": "Mercedes-Benz",
           "model": "S500",
           "seatingCapacity": 5,
           "topSpeed": 250.1
       }""", Vehicle)
ERROR: SystemError: opening file "{\n    \"type\": \"car\",\n    \"make\": \"Mercedes-Benz\",\n    \"model\": \"S500\",\n    \"seatingCapacity\": 5,\n    \"topSpeed\": 250.1\n}": No such file or directory

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