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

[Schema Inaccuracy] In SearchContacts, pagination.per_page is not defined. #98

Closed
yacinehmito opened this issue Aug 7, 2023 · 2 comments

Comments

@yacinehmito
Copy link

yacinehmito commented Aug 7, 2023

Schema Inaccuracy

There is an inconsistency between the schema of SearchContacts and what is documented in the API docs:

API docs documentation states that the pagination.per_page is to be provided in the request body to specify the number of items to return.

However, both v2.9 and Unstable do not include this property, and instead define pagination.page.
See the following lines (for v2.9):

  • search_request:
    description: Search using Intercoms Search APIs.
    type: object
    title: Search data
    properties:
    query:
    oneOf:
    - "$ref": "#/components/schemas/single_filter_search_request"
    title: Single filter search request
    - "$ref": "#/components/schemas/multiple_filter_search_request"
    title: multiple filter search request
    pagination:
    "$ref": "#/components/schemas/starting_after_paging"
  • starting_after_paging:
    title: StartingAfterPaging
    type: object
    nullable: true
    properties:
    page:
    type: integer
    example: 2
    starting_after:
    type: string
    example: 1HaSB+xrOyyMXAkS/c1RteCL7BzOzTvYjmjakgTergIH31eoe2v4/sbLsJWP\nIncfQLD3ouPkZlCwJ86F\n

I tested real API calls with both pagination.per_page and pagination.page and the former is the one that works as expected; the latter has no effect.

⚠️ The component starting_after_paging, which is relied on for pagination of SearchContacts ' request body, also appear here:

"$ref": "#/components/schemas/starting_after_paging"

This reference expects pagination.page and not pagination.per_page as it is a reference of the next page.

The two must be decoupled.

Expected

We would expect to have pagination.per_page instead of pagination.page in the OpenAPI spec.

Reproduction Steps

N/A.

@yacinehmito yacinehmito changed the title [Schema Inaccuracy] In _SearchContacts_, pagination.per_page is not defined. [Schema Inaccuracy] In SearchContacts, pagination.per_page is not defined. Aug 7, 2023
@yacinehmito
Copy link
Author

Additionally: it would be great to document in the schema the maximum value for per_page. I found out that it is 150.

@Eclairemoy
Copy link
Contributor

this has now been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants