mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-10 07:49:36 +00:00
Use field instead of Json.at for top level key
This commit is contained in:
parent
0edb08fb30
commit
1d1945933b
@ -67,7 +67,7 @@ alertGroupDecoder =
|
|||||||
|
|
||||||
decodeBlocks : Json.Decoder (List Block)
|
decodeBlocks : Json.Decoder (List Block)
|
||||||
decodeBlocks =
|
decodeBlocks =
|
||||||
Json.maybe (Json.at [ "blocks" ] (Json.list blockDecoder))
|
Json.maybe (field "blocks" (Json.list blockDecoder))
|
||||||
|> andThen (unwrapWithDefault [])
|
|> andThen (unwrapWithDefault [])
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ alertDecoder =
|
|||||||
|
|
||||||
decodeSilenced : Decoder Bool
|
decodeSilenced : Decoder Bool
|
||||||
decodeSilenced =
|
decodeSilenced =
|
||||||
Json.maybe (Json.at [ "silenced" ] Json.int)
|
Json.maybe (field "silenced" Json.int)
|
||||||
|> andThen
|
|> andThen
|
||||||
(\val ->
|
(\val ->
|
||||||
case val of
|
case val of
|
||||||
|
Loading…
Reference in New Issue
Block a user