Repository navigation
fix: document date alignment rules and add INVALID_ARGUMENT error for misaligned dates - #107
Merged
Merged
Conversation
heliu0
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
Closes #94.
The API description required
startDate/endDateto align to day or hour boundaries depending onfrequency, but nothing documented an error for misaligned values. The onlyOUT_OF_RANGEexample coveredendDatebeforestartDate, which is a different condition.Changes made:
info.descriptionnow explicitly documents that misalignedstartDate/endDatevalues result in400 INVALID_ARGUMENTGENERIC_400_INVALID_ARGUMENT_ALIGNMENTexample to theGeneric400responsestartDate/endDatefor bothDAYandHOURfrequenciesWhich issue(s) this PR fixes:
Fixes #94
Special notes for reviewers:
Following the review comment on this issue, we used
INVALID_ARGUMENTrather thanOUT_OF_RANGEfor the misalignment case. Per the CAMARA API Design Guide's Syntax Exceptions table,OUT_OF_RANGEis scoped to "a given field has a pre-defined range or an invalid filter criteria combination is requested". A date value that is not aligned to the frequency's day/hour boundary is a format error on a query parameter, which maps toINVALID_ARGUMENT("Generic Syntax Exception", explicitly covering query params).The existing
_03_out_of_range_scenariois left unchanged, as it correctly covers a genuineOUT_OF_RANGEcase (endDatebeforestartDate).Changelog input