Skip to content

Deserialization works in program but fails in interactive #25

Open
@jgardella

Description

@jgardella

I've found a strange issue where deserialization of a type works fine in my program, but fails when I run the same serialization in interactive. In interactive I get the following exception:

Couldn't parse config, error=JSON Path: . Failed to serialize, must be one of following types: record, map, array, list, tuple, union. Type is: Configuration.

I haven't been able to create a minimal example of the issue, but I've made a branch on the affected project to demonstrate the issue here.

To see the issue:

  1. Place a debug breakpoint here. This is where we try to parse the Configuration type.
  2. Run the Lint project test. This will try to lint the provided project, eventually hitting the parseConfig breakpoint above, when it tries to parse the default configuration file. It should succeed.
  3. Run the FSharp.Json.Error.fsx file in interactive debug. You should get the exception above, when it tries to parse the same default configuration.

Through this I was able to confirm that the two functions seem to be receiving the same input.

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