Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the results property to "true" in the paginated results schema #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions schemas/pagination-result.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ $id: “urn:elation:schemas:pagination-result”
title: PaginationResult
type: object
properties:
results:
type: object
# Functionally, PaginatedResult should be a generic PaginatedResult<T> where results is of
# type T[]. But json-schema doesn't support this out of the box, and getting tools to
# understand that is even harder. It's expected that any usage of this schema will be
# via extension (using the allOf keyword), and overriding the results property.
# true effectively acts as an any, which extenders can further constrain while keeping validation correct.
results: true
current_page_num:
description: The current page number based on the given limit and offset.
type: integer
Expand Down