GSA / GSA/data.gov

Fix Harvest API: /harvest_record_errors can't accept `harvest_source_id` parameter

Open
#5,809 1 comment 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

We use an omnibus JSON query builder method for the `/harvest_record_errors` API endpoint. The omnibus method claims that it accepts `harvest_source_id` but that doesn't work for `/harvest_record_errors` which doesn't have a `harvest_source_id` field in the database.

## How to reproduce

1. Call https://harvest.data.gov/harvest_record_errors/?harvest_source_id=35d79097-243c-414d-b67e-d8484397abc6

## Expected behavior

An error message that the query parameter isn't recognized for that method.

## Actual behavior

Ugh, an HTML error page to a JSON API call with just a single sentence on the web page that doesn't say anything about what actually went wrong.

Image

## Sketch

We need to fix both the API behavior to return a sensible error message if someone tries this AND the OpenAPI documentation which implies that this should work.

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.