Sorting
SortOrder
Section titled “SortOrder”The order or direction to sort results by.
| Value | Description | 
|---|---|
| asc | Ascending order (e.g., low to high or A to Z) | 
| desc | Descending order (e.g., high to low or Z to A) | 
Formats
Section titled “Formats”A JSON example of this model.
"asc"The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: SortOrder.yamltype: stringenum:  - asc  - descThe TypeSpec code for this model.
enum SortOrder {  asc,  desc,}The Python code for this model.
class SortOrder(str, Enum):    """Sort order enumeration."""
    ASC = "asc"    DESC = "desc"Changelog
Section titled “Changelog”| Version | Changes | 
|---|---|
| 0.1.0 |  
  |  
SortQueryParams
Section titled “SortQueryParams”Query parameters for sorting. These parameters should be used on GET routes that support sorting.
| Parameter | Type | Description | 
|---|---|---|
| sortBy | unknown | The field to sort by, should be an enum for individual routes | 
| customSortBy | string | An implementation-defined sort key | 
| sortOrder | SortOrder | The order to sort by | 
Formats
Section titled “Formats”A JSON example of this model.
{  "sortBy": "lastModifiedAt",  "customSortBy": "customField",  "sortOrder": "asc"}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: SortQueryParams.yamltype: objectproperties:  sortBy:    examples:      - lastModifiedAt    description: The field to sort by  customSortBy:    type: string    examples:      - customField    description: Implementation-defined sort key  sortOrder:    $ref: SortOrder.yaml    examples:      - asc    description: The order to sort byrequired:  - sortByunevaluatedProperties:  not: {}description: Query parameters for sortingThe TypeSpec code for this model.
/** Query parameters for sorting */model SortQueryParams {  /** The field to sort by */  @query  @example("lastModifiedAt")  sortBy: unknown;
  /** Implementation-defined sort key */  @query  @example("customField")  customSortBy?: string;
  /** The order to sort by */  @query  @example(SortOrder.asc)  sortOrder?: SortOrder;}The Python code for this model.
class SortQueryParams(SortBase):    """Query parameters for sorting."""
    sort_order: Optional[SortOrder] = Field(        default=None,        alias="sortOrder",        description="The order to sort by",        examples=[SortOrder.ASC],    )Changelog
Section titled “Changelog”| Version | Changes | 
|---|---|
| 0.1.0 |  
  |  
SortBodyParams
Section titled “SortBodyParams”Body parameters for sorting. These parameters should be used on POST and PUT routes that support sorting.
| Parameter | Type | Description | 
|---|---|---|
| sortBy | unknown | The field to sort by, should be an enum for individual routes | 
| customSortBy | string | An implementation-defined sort key | 
| sortOrder | SortOrder | The order to sort by | 
Formats
Section titled “Formats”A JSON example of this model.
{  "sortBy": "lastModifiedAt",  "customSortBy": "customField",  "sortOrder": "asc"}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: SortBodyParams.yamltype: objectproperties:  sortBy:    examples:      - lastModifiedAt    description: The field to sort by  customSortBy:    type: string    examples:      - customField    description: Implementation-defined sort key  sortOrder:    $ref: SortOrder.yaml    examples:      - asc    description: The order to sort byrequired:  - sortBydescription: Sorting parameters included in the request bodyThe TypeSpec code for this model.
/** Sorting parameters included in the request body */model SortBodyParams {  /** The field to sort by */  @example("lastModifiedAt")  sortBy: unknown;
  /** Implementation-defined sort key */  @example("customField")  customSortBy?: string;
  /** The order to sort by */  @example(SortOrder.asc)  sortOrder?: SortOrder;}The Python code for this model.
class SortBodyParams(SortBase):    """Sorting parameters included in the request body."""
    sort_order: Optional[SortOrder] = Field(        default=None,        alias="sortOrder",        description="The order to sort by",        examples=[SortOrder.ASC],    )Changelog
Section titled “Changelog”| Version | Changes | 
|---|---|
| 0.1.0 |  
  |  
SortedResultsInfo
Section titled “SortedResultsInfo”Information about the sort order of the items returned. This model should be included in responses that support sorting.
| Parameter | Type | Description | 
|---|---|---|
| sortBy | string | The field to sort by | 
| customSortBy | string | An implementation-defined sort key | 
| sortOrder | SortOrder | The order to sort by | 
| errors | Array<string> | The errors that occurred during sorting | 
Formats
Section titled “Formats”A JSON example of this model.
{  "sortBy": "lastModifiedAt",  "sortOrder": "asc",  "customSortBy": "customField",  "errors": [    "Sample string value"  ]}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: SortedResultsInfo.yamltype: objectproperties:  sortBy:    type: string    examples:      - lastModifiedAt    description: The field results are sorted by, or "custom" if an implementation-defined sort key is used  customSortBy:    type: string    examples:      - customField    description: Implementation-defined sort key used to sort the results, if applicable  sortOrder:    $ref: SortOrder.yaml    examples:      - asc    description: The order in which the results are sorted, e.g. ascending or descending  errors:    type: array    items:      type: string    description: Non-fatal errors that occurred during sortingrequired:  - sortBy  - sortOrderunevaluatedProperties:  not: {}description: Information about the sort order of the items returnedThe TypeSpec code for this model.
/** Information about the sort order of the items returned */model SortedResultsInfo {  /** The field results are sorted by, or "custom" if an implementation-defined sort key is used */  @example("lastModifiedAt")  sortBy: string;
  /** Implementation-defined sort key used to sort the results, if applicable */  @example("customField")  customSortBy?: string;
  /** The order in which the results are sorted, e.g. ascending or descending */  @example(SortOrder.asc)  sortOrder: SortOrder;
  /** Non-fatal errors that occurred during sorting */  errors?: string[];}The Python code for this model.
class SortedResultsInfo(SortBase):    """Sorting information for search results."""
    sort_order: str = Field(        ...,        alias="sortOrder",        description="The order in which the results are sorted",    )    errors: Optional[list[str]] = Field(        default_factory=lambda: [],        description="Non-fatal errors that occurred during sorting",        json_schema_extra={"items": {"type": "string"}},    )Changelog
Section titled “Changelog”| Version | Changes | 
|---|---|
| 0.1.0 |  
  |