GSA / GSA/data.gov

/api/keywords parameter validation does not enforce documented min/max for size

Open
#5,902 0 comments 0 reactions 0 assignees View on GitHub
API
Dominant language
Python
Stars
1.1k
Forks
200
Avg merge
4h 56m
Merged PRs (30d)
5

Description

## Description
The `size` parameter on `/api/keywords` does not enforce the documented valid range of 1-1000.

## Steps to Reproduce
GET https://catalog.data.gov/api/keywords?size=0 (returns 1 result, not 0 or an error)
GET https://catalog.data.gov/api/keywords?size=1001 (returns 1000 results silently)

## Expected Behavior
Per the OpenAPI spec, valid range is 1-1000. Values outside this range should return HTTP 422.

## Actual Behavior
- `size=0` returns 1 result. Response `size` field shows `1`, not `0`.
- `size=1001` returns 1000 results with no indication the value was out of range.

## Notes
Confirmed April 27, 2026. If silent clamping is intentional, the behavior should be documented.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.