feat(clients): integrate plan 18: API catalog for 83 Google services, key table, detail error envelope, docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 16:01:51 +01:00
co-authored by Claude Sonnet 5.5
parent 78426d1ba5
commit 997b06bc60
10 changed files with 416 additions and 30 deletions
+10
View File
@@ -56,6 +56,16 @@ ApiError error_from_response(const std::string& vendor,
message = err->as_string();
} else if (doc.is_object()) {
std::string m = text_of(doc.find("message"));
// FastAPI-style envelope: {"detail":"text"} or {"detail":[{"msg":"text"}]}.
if (m.empty()) {
const Json* d = doc.find("detail");
if (d && d->is_array() && !d->as_array().empty()) {
const Json& first = d->as_array().front();
m = first.is_object() ? text_of(first.find("msg")) : text_of(&first);
} else {
m = text_of(d);
}
}
if (!m.empty()) message = m;
std::string t = text_of(doc.find("type"));
if (t.empty()) t = text_of(doc.find("code"));