Numeric filters
NumberComparisonFilter
Section titled “NumberComparisonFilter”Filters by comparing a field to a numeric value.
| Property | Type | Description |
|---|---|---|
| operator | ComparisonOperators | The operator to apply to the filter value |
| value | numeric | The value to use for the filter operation |
Formats
Section titled “Formats”A JSON example of this model.
{ "operator": "gt", "value": 1000}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: NumberComparisonFilter.yamltype: objectproperties: operator: $ref: ComparisonOperators.yaml description: The comparison operator to apply to the filter value value: type: number examples: - 1000 description: The value to use for the filter operationrequired: - operator - valueunevaluatedProperties: not: {}description: Filters by comparing a field to a numeric valueThe TypeSpec code for this model.
/** Filters by comparing a field to a numeric value */model NumberComparisonFilter { /** The comparison operator to apply to the filter value */ operator: ComparisonOperators;
/** The value to use for the filter operation */ @example(1000) value: numeric;}The Python code for this model.
class NumberComparisonFilter(CommonGrantsBaseModel): """Filter that matches numbers against a specific value."""
operator: ComparisonOperator = Field( ..., description="The comparison operator to apply to the filter value", ) value: Union[int, float] = Field( ..., description="The numeric value to compare against" )The TypeScript code for this model.
export const NumberComparisonFilterSchema = z.object({ operator: ComparisonOperatorsEnum, value: z.number(),});Changelog
Section titled “Changelog”| Version | Changes |
|---|---|
| 0.1.0 |
|
NumberRangeFilter
Section titled “NumberRangeFilter”Filters by comparing a field to a range of numeric values.
Filter schema
Section titled “Filter schema”| Property | Type | Description |
|---|---|---|
| operator | RangeOperators | The operator to apply to the filter value |
| value | range object | The value to use for the filter operation |
Range object
Section titled “Range object”| Property | Type | Description |
|---|---|---|
| min | numeric | The minimum numeric value for this range |
| max | numeric | The maximum numeric value for this range |
Formats
Section titled “Formats”A JSON example of this model.
{ "operator": "between", "value": { "min": 1000, "max": 10000 }}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: NumberRangeFilter.yamltype: objectproperties: operator: $ref: RangeOperators.yaml description: The operator to apply to the filter value value: type: object properties: min: type: number max: type: number required: - min - max unevaluatedProperties: not: {} examples: - min: 1000 max: 10000 description: The value to use for the filter operationrequired: - operator - valueunevaluatedProperties: not: {}description: Filters by comparing a field to a numeric rangeThe TypeSpec code for this model.
/** Filters by comparing a field to a numeric range */model NumberRangeFilter { /** The operator to apply to the filter value */ operator: RangeOperators;
/** The value to use for the filter operation */ @example(#{ min: 1000, max: 10000 }) value: { min: numeric; max: numeric; };}The Python code for this model.
class NumberRangeFilter(CommonGrantsBaseModel): """Filter that matches numbers within a specified range."""
operator: RangeOperator = Field( ..., description="The operator to apply to the filter value", ) value: NumberRange = Field(..., description="The numeric range value")
@field_validator("operator", mode="before") @classmethod def validate_operator(cls, v): """Convert string to enum if needed.""" if isinstance(v, str): return RangeOperator(v) return vThe TypeScript code for this model.
export const NumberRangeFilterSchema = z.object({ operator: RangeOperatorsEnum, value: z.object({ min: z.number(), max: z.number(), }),});Changelog
Section titled “Changelog”| Version | Changes |
|---|---|
| 0.1.0 |
|
NumberArrayFilter
Section titled “NumberArrayFilter”Filters by comparing a field to an array of numeric values.
| Property | Type | Description |
|---|---|---|
| operator | ArrayOperators | The operator to apply to the filter value |
| value | Array<numeric> | The value to use for the filter operation |
Formats
Section titled “Formats”A JSON example of this model.
{ "operator": "in", "value": [ 1000, 2000, 3000 ]}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: NumberArrayFilter.yamltype: objectproperties: operator: $ref: ArrayOperators.yaml description: The operator to apply to the filter value value: type: array items: type: number examples: - - 1000 - 2000 - 3000 description: The value to use for the filter operationrequired: - operator - valueunevaluatedProperties: not: {}description: Filters by comparing a field to an array of numeric valuesThe TypeSpec code for this model.
/** Filters by comparing a field to an array of numeric values */model NumberArrayFilter { /** The operator to apply to the filter value */ operator: ArrayOperators;
/** The value to use for the filter operation */ @example(#[1000, 2000, 3000]) value: Array<numeric>;}The Python code for this model.
class NumberArrayFilter(CommonGrantsBaseModel): """Filter that matches against an array of numeric values."""
operator: ArrayOperator = Field( ..., description="The operator to apply to the filter value", ) value: list[Union[int, float]] = Field( ..., description="The array of numeric values" )
@field_validator("operator", mode="before") @classmethod def validate_operator(cls, v): """Convert string to enum if needed.""" if isinstance(v, str): return ArrayOperator(v) return vThe TypeScript code for this model.
export const NumberArrayFilterSchema = z.object({ operator: ArrayOperatorsEnum, value: z.array(z.number()),});Changelog
Section titled “Changelog”| Version | Changes |
|---|---|
| 0.1.0 |
|