diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-04-18 08:09:02 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-10-15 09:05:27 +0200 |
commit | b691b1c5760333e728ca3ddbea856410af05008f (patch) | |
tree | 2dd84cc46da94fff447be861d3d3b87e558486c7 /mod/mod-ci-github-gh.cxx | |
parent | 8945d6c3aa8695d8ad50d4d15041dea6f2c01ba7 (diff) |
Fixes
Diffstat (limited to 'mod/mod-ci-github-gh.cxx')
-rw-r--r-- | mod/mod-ci-github-gh.cxx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx index dc1447f..28f21f7 100644 --- a/mod/mod-ci-github-gh.cxx +++ b/mod/mod-ci-github-gh.cxx @@ -133,23 +133,14 @@ namespace brep { p.next_expect (event::begin_object); - bool ni (false), nm (false), st (false); - - while (p.next_expect (event::name, event::end_object)) - { - auto c = [&p] (bool& v, const char* s) - { - return p.name () == s ? (v = true) : false; - }; - - if (c (ni, "id")) node_id = p.next_expect_string (); - else if (c (nm, "name")) name = p.next_expect_string (); - else if (c (st, "status")) status = p.next_expect_string (); - } + // We always ask for this exact set of fields to be returned in GraphQL + // requests. + // + node_id = p.next_expect_member_string ("id"); + name = p.next_expect_member_string ("name"); + status = p.next_expect_member_string ("status"); - if (!ni) missing_member (p, "gh_check_run", "id"); - if (!nm) missing_member (p, "gh_check_run", "name"); - if (!st) missing_member (p, "gh_check_run", "status"); + p.next_expect (event::end_object); } ostream& |