GSA / GSA/data.gov

Harvest-API: `order_by` with invalid field name silently returns default ordering

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

Description

**Description**
Passing an invalid field name to order_by on any list endpoint returns HTTP 200 with results in default order rather than a validation error.

**Steps to Reproduce**
GET https://harvest.data.gov/harvest_sources/?order_by=notafield

**Expected Behavior**
HTTP 422 error.

**Actual Behavior**
HTTP 200 with results in default order, no indication the parameter was invalid.

**Notes**
Confidence: MEDIUM -- may be intentional permissive behavior. Need to confirm. If intentional, this becomes a documentation issue.

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.