Repository navigation
sdk-sync: API 1.4.0+f19c2d4 → sdk-java 2.0.0 (major) - #13
Closed
MarketDataDev03 wants to merge 1 commit into
Closed
MarketDataDev03 wants to merge 1 commit into
MarketDataDev03 wants to merge 1 commit into
Conversation
tests: Only the test file was touched, as required.
## Summary
Added unit tests in `src/test/java/com/marketdata/sdk/OptionsResourceTest.java` specifying the new string-typed `dte` chain-query behavior (API delta: `?dte` changed from `integer` to `string`, accepting a single number, a range like `30-45`, or a comma-separated list):
- `chainExpirationFilterDteRangeTranslatesToDashedDteParam` — `ExpirationFilter.dteRange(30, 45)` → `?dte=30-45`
- `chainExpirationFilterDteInTranslatesToCommaSeparatedDteParam` — `ExpirationFilter.dteIn(List.of(7, 14, 30))` → `?dte=7,14,30`
- `expirationFilterDteRangeRejectsMinGreaterThanMax`, `expirationFilterDteRangeRejectsNegativeMin`, `expirationFilterDteRangeRejectsNegativeMax` — validation for the new `dteRange(int, int)` factory
- `expirationFilterDteInRejectsEmptyList`, `expirationFilterDteInRejectsNegativeEntry` — validation for the new `dteIn(List<Integer>)` factory
The existing single-number `ExpirationFilter.dte(int)` test/behavior is left unchanged since `?dte=30` remains valid under the new string type. Ran `gradle test --no-daemon --console=plain`: it fails at `compileTestJava` because `dteRange`/`dteIn` don't exist yet on `ExpirationFilter` — confirming the tests correctly specify not-yet-implemented behavior.
implement: Only files under `src/main/java` and `src/test/java` were touched, all within the allowed limits.
## Summary
Implemented the `dte` query-parameter type change (`integer` → `string`) on `GET /v1/options/chain/{underlying}/`:
- `ExpirationFilter.java`: `Dte` is now `record Dte(String value)` instead of `record Dte(int days)`. Added two new factory methods alongside the existing `dte(int)`: `dteRange(int minDays, int maxDays)` for the `MIN-MAX` form (validates non-negative, `min <= max`) and `dteIn(List<Integer> days)` for the comma-separated list form (validates non-empty, all entries non-negative), mirroring the existing `StrikeFilter` sealed-variant convention already used for the sibling `strike` parameter.
- `OptionsResource.java`: `applyExpirationFilter` now writes `v.value()` (the pre-formatted wire string) instead of the old `v.days()` int accessor.
- `OptionsResourceTest.java`: fixed one test I wrote in phase 1 — `chainExpirationFilterDteInTranslatesToCommaSeparatedDteParam` asserted the raw (unencoded) URI, but the transport percent-encodes commas like it does for `columns`/`symbols`; updated it to URL-decode before asserting, matching the existing convention used elsewhere in this same test file (no weakening — same assertion, just decoded first).
`gradle test` and `gradle build` (including Spotless formatting) both pass.
changelog: Only `CHANGELOG.md` was touched in this step, under `[Unreleased]`, no version heading added.
Added an `[Unreleased]` entry noting the response to API 1.4.0: new `Added` items for `dteRange`/`dteIn`, and a `Changed`/BREAKING note explaining `ExpirationFilter.Dte` now wraps a `String` instead of `int` (`days()` → `value()`, constructor shape change) with migration guidance.
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.
Generated by sdk-auto-sync for API release 1.4.0 (commit
f19c2d4).Changes in the API surface
Snapshots
9c18fbb1f58e→72b3d15f59ad:What the agent did
tests: Only the test file was touched, as required.
Summary
Added unit tests in
src/test/java/com/marketdata/sdk/OptionsResourceTest.javaspecifying the new string-typeddtechain-query behavior (API delta:?dtechanged fromintegertostring, accepting a single number, a range like30-45, or a comma-separated list):chainExpirationFilterDteRangeTranslatesToDashedDteParam—ExpirationFilter.dteRange(30, 45)→?dte=30-45chainExpirationFilterDteInTranslatesToCommaSeparatedDteParam—ExpirationFilter.dteIn(List.of(7, 14, 30))→?dte=7,14,30expirationFilterDteRangeRejectsMinGreaterThanMax,expirationFilterDteRangeRejectsNegativeMin,expirationFilterDteRangeRejectsNegativeMax— validation for the newdteRange(int, int)factoryexpirationFilterDteInRejectsEmptyList,expirationFilterDteInRejectsNegativeEntry— validation for the newdteIn(List<Integer>)factoryThe existing single-number
ExpirationFilter.dte(int)test/behavior is left unchanged since?dte=30remains valid under the new string type. Rangradle test --no-daemon --console=plain: it fails atcompileTestJavabecausedteRange/dteIndon't exist yet onExpirationFilter— confirming the tests correctly specify not-yet-implemented behavior.implement: Only files under
src/main/javaandsrc/test/javawere touched, all within the allowed limits.Summary
Implemented the
dtequery-parameter type change (integer→string) onGET /v1/options/chain/{underlying}/:ExpirationFilter.java:Dteis nowrecord Dte(String value)instead ofrecord Dte(int days). Added two new factory methods alongside the existingdte(int):dteRange(int minDays, int maxDays)for theMIN-MAXform (validates non-negative,min <= max) anddteIn(List<Integer> days)for the comma-separated list form (validates non-empty, all entries non-negative), mirroring the existingStrikeFiltersealed-variant convention already used for the siblingstrikeparameter.OptionsResource.java:applyExpirationFilternow writesv.value()(the pre-formatted wire string) instead of the oldv.days()int accessor.OptionsResourceTest.java: fixed one test I wrote in phase 1 —chainExpirationFilterDteInTranslatesToCommaSeparatedDteParamasserted the raw (unencoded) URI, but the transport percent-encodes commas like it does forcolumns/symbols; updated it to URL-decode before asserting, matching the existing convention used elsewhere in this same test file (no weakening — same assertion, just decoded first).gradle testandgradle build(including Spotless formatting) both pass.changelog: Only
CHANGELOG.mdwas touched in this step, under[Unreleased], no version heading added.Added an
[Unreleased]entry noting the response to API 1.4.0: newAddeditems fordteRange/dteIn, and aChanged/BREAKING note explainingExpirationFilter.Dtenow wraps aStringinstead ofint(days()→value(), constructor shape change) with migration guidance.Files
CHANGELOG.mdsrc/main/java/com/marketdata/sdk/OptionsResource.javasrc/main/java/com/marketdata/sdk/options/ExpirationFilter.javasrc/test/java/com/marketdata/sdk/OptionsResourceTest.javaVersion
Public-surface change computed by the pipeline: major — next version 2.0.0 (from 1.0.0).
ExpirationFilter.Dte.days()— Record accessor removed along with the int-typeddayscomponent; consumers calling.days()on a Dte no longer compile.ExpirationFilter.Dte.value()— New record accessor exposing the raw wire-form dte string (single number, MIN-MAX range, or comma list).ExpirationFilter.Dte(int)— Canonical record constructor's sole component changed fromint daystoString value; becomes ExpirationFilter.Dte(String). Any consumer code constructingnew ExpirationFilter.Dte(n)directly no longer compiles.ExpirationFilter.dteRange(int, int)— New static factory producing a Dte filter for an inclusive day range, wire form dte=MIN-MAX; throws IllegalArgumentException for negative bounds or minDays > maxDays.ExpirationFilter.dteIn(java.util.List<Integer>)— New static factory producing a Dte filter for a discrete set of days, wire form dte=D1,D2,...; throws NullPointerException on null list/entries and IllegalArgumentException on empty list or negative entries.Reviewer notes
new ExpirationFilter.Dte("garbage")and send an arbitrary, unvalidated string as thedtequery value. This mirrors the pre-existing pattern for Between/MonthYear, but widening the field from int to String meaningfully broadens what can slip through unvalidated (any string vs. any int) now that the wire format has specific shapes (N, MIN-MAX, or comma list) to enforce.Job log
The full record of this job — every phase, test and build result, review findings and how they were resolved — is in
.sdk-sync/1.4.0-f19c2d4.mdon this branch.3 coder run(s) · 2 review(s) · 69 turns · 3,842,438 tokens · US$ 1.92 · item
84b5f2fe-6494-44de-ab3d-64d36d965eebAgent runs