mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-16 01:18:39 +00:00
Work around Gitea's malformed responses again (#371)
This commit is contained in:
@@ -202,15 +202,10 @@ and ObjectTypeDefinition =
|
|||||||
match node.["example"] with
|
match node.["example"] with
|
||||||
| null -> None
|
| null -> None
|
||||||
| :? JsonObject as o -> Some o
|
| :? JsonObject as o -> Some o
|
||||||
| :? JsonValue as s ->
|
| _ ->
|
||||||
// Gitea returns a stringified JSON object here, which from my limited reading is
|
// Gitea returns a stringified and malformed JSON object here.
|
||||||
// against the spec.
|
// Don't throw; just omit.
|
||||||
match JsonNode.Parse (s.GetValue<string> ()) with
|
None
|
||||||
| null ->
|
|
||||||
// JSON null value; :shrug:
|
|
||||||
None
|
|
||||||
| n -> n.AsObject () |> Some
|
|
||||||
| _ -> failwith "expected `example` key to be a JSON object"
|
|
||||||
|
|
||||||
let required = asArrOpt'<string> node "required"
|
let required = asArrOpt'<string> node "required"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user