Expand description
§ghl-models
Rust data models (DTOs) for the GoHighLevel API, generated from HighLevel’s official OpenAPI specifications.
Both API versions are covered: v2 (the current stable API, Version: 2021-07-28) and v3 (Version: v3). Every API module is behind a cargo
feature so you compile only the models you use — enabling everything means
thousands of structs.
[dependencies]
ghl-models = { version = "0.1", features = ["contacts", "invoices"] }§How these types are generated
- Fields the spec marks
requiredare non-Option; the rest areOption<T>that skip serialization whenNone, so partial updates work. - Arrays are
Vec<T>with#[serde(default)]— an absent list reads as empty. - String enums are
Stringwith the allowed values in the doc comment. GoHighLevel introduces new values without notice, and a closed Rust enum would turn that into a deserialization failure. - Anonymous nested objects and multi-branch compositions are
serde_json::Value. - Unknown fields in responses are ignored, never rejected, so upstream additions can’t break your build.
Regenerate with xtask/generate_models.py after HighLevel updates its specs.
Not affiliated with HighLevel Inc.