Skip to content

Commit

Permalink
🎨 Update order_by description and default value. Include in schema
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Aug 29, 2024
1 parent bcbb9e2 commit 111bd7d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions aries_cloudagent/messaging/models/paginated_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ class PaginatedQuerySchema(OpenAPISchema):
)
order_by = fields.Str(
required=False,
load_default=None,
dump_only=True, # Hide from schema by making it dump-only
load_only=True, # Ensure it can still be loaded/validated
validate=OneOf(["id"]), # Example of possible fields
metadata={"description": "Order results in descending order if true"},
error_messages={"validator_failed": "Ordering only support for column `id`"},
load_default="id",
validate=OneOf(["id"]), # only one possible column supported in askar
metadata={
"description": (
'The column to order results by. Only "id" is currently supported.'
)
},
error_messages={"validator_failed": '`order_by` only supports column "id"'},
)
descending = fields.Bool(
required=False,
Expand Down

0 comments on commit 111bd7d

Please sign in to comment.