Skip to main content

DEPRECATED_FIELDS

Constant DEPRECATED_FIELDS 

Source
pub const DEPRECATED_FIELDS: &[(&str, &str)];
Expand description

Schema fields the OpenAPI spec marks deprecated: true, as (RustStructName, specFieldName) pairs. Covers both response-side and request-side schemas.

These fields are removed from the struct entirely unless the deprecated-fields Cargo feature is enabled — each one carries a #[cfg(feature = "deprecated-fields")] marker in crate::models. By default the field does not exist, so:

  • On response structs, referencing it is a compile error and it never appears in serialized output; deserializing a payload that still contains it just ignores the extra key.
  • On request structs, callers cannot set it and skip_serializing_if keeps it off the wire entirely.

The list is kept sorted so is_deprecated_field can use binary_search and snapshot diffs stay readable.

Regenerate from the snapshot with:

python3 scripts/regenerate-deprecated-fields.py

The script derives struct names from spec schema names alone, so a schema modeled as both a request and a response type needs the {Name}Response entry added by hand after regenerating (e.g. ClickPipeScalingResponse). The analyzer expects the pair once per Rust type the schema maps to, so a dropped response-variant entry fails the drift check rather than passing silently.

The shared OpenAPI analyzer reports drift if this list differs from the spec or if a field here lacks the #[cfg(feature = "deprecated-fields")] marker in models.rs (or vice versa).