USACE / USACE/cwms-data-api

Deprecate the "timezone" query parameter for v2 and newer end-points

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

Nobody has claimed this yet.

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

Description

As described in https://github.com/USACE/cwms-data-api/issues/556#issuecomment-1984710644 the "timezone" parameter is a little bit weird when used in JSONv2 and XMLv2. It basically only used as a way for the user to specify a default timezone to be used if the user didn't include timezone info in their "begin" and "end" strings.

It makes it so the user could specify
begin = 2022-01-06T00:00:00
end = 2022-01-06T12:00:00
timezone = UTC
or
begin = 2022-01-06T00:00:00
end = 2022-01-06T12:00:00
timezone = America/Los_Angeles

I think the V2 end-points sort of inherited this behavior. But its too helpful.

The V1 end-points also passed timezone into the pl/sql and the pl/sql promised to return values in the specified timezone.

The V2 end-points return data in UTC. Maybe V2 isn't always UTC but I can't think of when it isn't and if it isn't we need to document that better.

Instead of continuing to "inherit" the old behavior (in my opinion) we should force the clients to give us better inputs (timestamps with tz) and throw errors if the inputs seem weird.

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 with the v2 endpoint entry points and the discussion in issue 556, then trace how timezone, begin, and end are validated and how response timezones are defined. Done means the v2 behavior is decided and implemented consistently: timezone is deprecated or rejected, timezone-bearing timestamps are required where appropriate, and any UTC behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.