USACE / USACE/cwms-data-api

Basins Endpoint Broken

Open
#637 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

automation-tests
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

Automation Testing for CWMSjs - /Basins

Attempting the /cwms-data/basins endpoint from various means gives no results.

Presuming at least LRH has basins in there database I would expect to get something back.

Using Swagger / CURL default value for LRH returns

(Mimetype is set to pg+json?)

curl -X 'GET' \
  'https://cwms-data.usace.army.mil/cwms-data/basins?office=LRH' \
  -H 'accept: application/vnd.named+pg+json'

Using a normal mimetype (application/json) gives

curl -X 'GET' \
   'https://cwms-data.usace.army.mil/cwms-data/basins?office=LRH' \
   -H 'accept: application/json'

image
An empty string.
I would not expect there to be a version 2, but I tried it. But it also returns the empty string.

It is the same for other districts.

If the basins endpoint is not complete should we consider moving it out of PROD?

EDIT:
If this is an issue with districts not having data in the tables the endpoint looks at, can we consider adding the POST method to start getting data in without needing to use the SQL directly?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the /cwms-data/basins?office=LRH requests with both application/vnd.named+pg+json and application/json, then trace the basins endpoint to the data it queries. No implementation files or tests are named; done means determining why valid districts return empty results and adding coverage or documenting the production decision, including whether POST support is in scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.