Boolean filters
BooleanComparisonFilter
Section titled “BooleanComparisonFilter”A filter that applies a comparison to a boolean value.
| Property | Type | Description |
|---|---|---|
| operator | EquivalenceOperators | The operator to apply to the filter value |
| value | boolean | The value to use for the filter operation |
Formats
Section titled “Formats”A JSON example of this model.
{ "operator": "eq", "value": true}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: BooleanComparisonFilter.yamltype: objectproperties: operator: $ref: EquivalenceOperators.yaml description: The operator to apply to the filter value value: type: boolean examples: - true description: The value to use for the filter operationrequired: - operator - valueunevaluatedProperties: not: {}description: A filter that applies a comparison to a boolean valueThe TypeSpec code for this model.
/** A filter that applies a comparison to a boolean value */@Versioning.added(CommonGrants.Versions.v0_4)model BooleanComparisonFilter { /** The operator to apply to the filter value */ operator: EquivalenceOperators;
/** The value to use for the filter operation */ @example(true) value: boolean;}The Python code for this model.
class BooleanComparisonFilter(CommonGrantsBaseModel): """Filter that matches a boolean value for equality (eq | neq).
Strict boolean: 1/0 and "true"/"false" are rejected, matching the Zod ``z.boolean()`` semantics of the TS SDK's ``BooleanComparisonFilterSchema``. """
operator: EquivalenceOperator = Field( ..., description="The operator to apply to the filter value", ) value: StrictBool = Field(..., description="The boolean value to compare against")
@field_validator("operator", mode="before") @classmethod def validate_operator(cls, v): """Convert string to enum if needed.""" if isinstance(v, str): return EquivalenceOperator(v) return vThe TypeScript code for this model.
export const BooleanComparisonFilterSchema = z.object({ operator: EquivalenceOperatorsEnum, value: z.boolean(),});Changelog
Section titled “Changelog”| Version | Changes | Schema |
|---|---|---|
| 0.4.0 |
| BooleanComparisonFilter.yaml |