Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Exception when serializing type: obj option #6

@yuqiu42

Description

@yuqiu42

Sample code

        let l = ["a", (Some (1 :> obj))]
        printfn "json: %s" (l |> Map.ofList |> Json.serialize)

Exception:

Unhandled Exception: System.Exception: Unknown type: Type=Object
   at Vertigo.Json.Internals.NonOption$cont@204(JsonConfig config, Object value, Type t, Unit unitVar)
   at Vertigo.Json.Internals.Serialize.NonOption(JsonConfig config, Type t, Object value, JsonProperty attr)
   at Vertigo.Json.Internals.Serialize.Option(JsonConfig config, Type t, Object o, JsonProperty attr)
   at [email protected](Object o)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)
   at Vertigo.Json.Internals.Serialize.Map(JsonConfig config, IEnumerable kvps)
   at Vertigo.Json.Json.serialize(Object objekt)

Metadata

Metadata

Assignees

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