USACE / USACE/cwms-data-api

Allow aliases for the locations endpoints

Open
#1,037 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Allow the usage of aliases for the location/location by ID endpoints, not just the primary keys

For example if I know the shefid of a project, (Handbook 5), i should be able to query the location by ID endpoint and get back the same metadata as if I used the primary key:

curl -X 'GET' \
  'https://cwms-data.usace.army.mil/cwms-data/locations/CATO?office=SWT' \
  -H 'accept: application/json;version=2'

Returns as you would expect but if I try:

curl -X 'GET' \
  'https://cwms-data.usace.army.mil/cwms-data/locations/CTOO2?office=SWT' \
  -H 'accept: application/json;version=2'

I get a 404

See #1036 for what the response could look like

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 locating the locations-by-ID endpoint and compare its handling of primary keys with the alias example in the issue. Read #1036 for the expected response shape, then verify that both CATO and the alias CTOO2 return the same metadata for office SWT instead of a 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.