WithPagination adds REST API pagination parameters to a tool. https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api
(schema *jsonschema.Schema)
| 325 | // WithPagination adds REST API pagination parameters to a tool. |
| 326 | // https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api |
| 327 | func WithPagination(schema *jsonschema.Schema) *jsonschema.Schema { |
| 328 | schema.Properties["page"] = &jsonschema.Schema{ |
| 329 | Type: "number", |
| 330 | Description: "Page number for pagination (min 1)", |
| 331 | Minimum: jsonschema.Ptr(1.0), |
| 332 | } |
| 333 | |
| 334 | schema.Properties["perPage"] = &jsonschema.Schema{ |
| 335 | Type: "number", |
| 336 | Description: "Results per page for pagination (min 1, max 100)", |
| 337 | Minimum: jsonschema.Ptr(1.0), |
| 338 | Maximum: jsonschema.Ptr(100.0), |
| 339 | } |
| 340 | |
| 341 | return schema |
| 342 | } |
| 343 | |
| 344 | // WithUnifiedPagination adds REST API pagination parameters to a tool. |
| 345 | // GraphQL tools will use this and convert page/perPage to GraphQL cursor parameters internally. |
no outgoing calls
no test coverage detected