USACE / USACE/cwms-data-api

[Bug]: Water Supply Accounting catalog endpoint not respecting default row limit

Open Beginner friendly
#1,920 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

When querying the water supply contract accounting catalog endpoint, the default row limit is 0. This is documented as being equivalent to no limit, but testing shows that no results are returned unless a value greater than 0 is provided.

https://github.com/USACE/cwms-data-api/blob/92c63e61cb9f02ed3331b3555d090a4c6ae0c636/cwms-data-api/src/main/java/cwms/cda/api/watersupply/AccountingCatalogController.java#L119

Expected behavior

I would expect no row limit when the default value of 0 is used.

To Reproduce
  1. GET from the accounting endpoint with no row limit parameter specified.
  2. Receive no accounting records
  3. Repeat step 1, specifying a row limit of 100
  4. Receive accounting records
Priority

Medium

Logs/Incident Identifier

No response

CURL Commands

CDA Version

latest-dev

Additional context

No response

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 at cwms-data-api/src/main/java/cwms/cda/api/watersupply/AccountingCatalogController.java around line 119 and reproduce the accounting catalog request without a row-limit parameter. Compare it with the same request using a limit of 100; done means the default value of 0 returns accounting records rather than an empty response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.