drf-spectacular
drf-spectacular copied to clipboard
handle examples with nested properties pagination
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}
]
}