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

handle examples with nested properties pagination #1237

Merged
merged 1 commit into from
May 16, 2024
Merged

handle examples with nested properties pagination #1237

merged 1 commit into from
May 16, 2024

Conversation

w00kie
Copy link
Contributor

@w00kie w00kie commented May 14, 2024

Referring to #1236, I've made the build_listed_example_value function travel recursively down the schema properties to generate a paginate example.

This should enable examples to work in case of custom pagination classes that have nested properties, such as one like this:

{
  "pagination": {
    "limit": 100,
    "offset": 300,
    "total": 123,
    "next": "/accounts/?offset=400&limit=100",
    "previous": "/accounts/?offset=200&limit=100"
  },
  "data": [
    {"field": 123}
  ]
}

@tfranzel
Copy link
Owner

good catch! thanks for the excellent PR!

@tfranzel tfranzel merged commit 2501bfd into tfranzel:master May 16, 2024
31 checks passed
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

Successfully merging this pull request may close these issues.

2 participants