Repository navigation
sdk-sync: API 1.4.0+f19c2d4 → sdk-java 2.0.0 (major) - #5
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: The build fails as required, with a compilation error on the not-yet-implemented `ExpirationFilter.dteRange(int, int)` symbol — confirming the tests are correctly specifying new behaviour ahead of implementation.
## Summary
Added three unit tests to `src/test/java/com/marketdata/sdk/OptionsResourceTest.java` specifying the new behaviour for the `dte` query parameter's `integer` → `string` type change on `GET /v1/options/chain/{underlying}/`, mirroring the existing `?strike=` range convention (`StrikeFilter.range`):
- `chainExpirationFilterDteRangeTranslatesToDashedDteParam` — `ExpirationFilter.dteRange(30, 45)` must translate to `?dte=30-45` on the wire.
- `expirationFilterDteRangeRejectsMinGreaterThanMax` — `dteRange(45, 30)` must throw `IllegalArgumentException` ("min must be <= max").
- `expirationFilterDteRangeRejectsNegativeMin` — `dteRange(-1, 30)` must throw `IllegalArgumentException` ("dte must be non-negative").
The existing `dte(int)` exact-value tests and validation were left untouched. Ran `gradle test --no-daemon --console=plain`; it fails at `:compileTestJava` because `ExpirationFilter.dteRange(int, int)` doesn't exist yet, confirming the tests correctly drive the required implementation.
implement: All changes are within the allowed paths (`src/main/java`, `src/test/java`, `docs/`), and I did not touch the tests written in phase 1 beyond what already existed.
## Summary
Implemented the `1.4.0` API change to `GET /v1/options/chain/{underlying}/`'s `dte` query parameter (integer → string), following the same sealed-filter convention `StrikeFilter` already uses for its `?strike=` range syntax:
- `ExpirationFilter`: added a new sealed variant `DteRange(minDays, maxDays)` with factory `ExpirationFilter.dteRange(int, int)`, validating `minDays >= 0` and `minDays <= maxDays` (mirrors `dte(int)`'s and `StrikeFilter.range`'s existing validation messages).
- `OptionsResource.applyExpirationFilter`: renders `DteRange` as `?dte=min-max`, keeping the exhaustive if-chain over the now six-variant sealed type complete (no silent no-op for the new case).
- `docs/options/chain.md`: documented the new `dteRange(...)` builder call alongside the existing `dte(...)`.
No existing tests were weakened — the phase-1 tests are unchanged and now compile and pass. `gradle test` and `gradle build` (including Spotless and JaCoCo) both succeed.
changelog: Added an `## [Unreleased]` entry noting it responds to API 1.4.0, with an `### Added` line for `ExpirationFilter.dteRange(...)` and a `### Changed` BREAKING line explaining the sealed-interface `permits` expansion and how to migrate exhaustive switches.
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: The build fails as required, with a compilation error on the not-yet-implemented
ExpirationFilter.dteRange(int, int)symbol — confirming the tests are correctly specifying new behaviour ahead of implementation.Summary
Added three unit tests to
src/test/java/com/marketdata/sdk/OptionsResourceTest.javaspecifying the new behaviour for thedtequery parameter'sinteger→stringtype change onGET /v1/options/chain/{underlying}/, mirroring the existing?strike=range convention (StrikeFilter.range):chainExpirationFilterDteRangeTranslatesToDashedDteParam—ExpirationFilter.dteRange(30, 45)must translate to?dte=30-45on the wire.expirationFilterDteRangeRejectsMinGreaterThanMax—dteRange(45, 30)must throwIllegalArgumentException("min must be <= max").expirationFilterDteRangeRejectsNegativeMin—dteRange(-1, 30)must throwIllegalArgumentException("dte must be non-negative").The existing
dte(int)exact-value tests and validation were left untouched. Rangradle test --no-daemon --console=plain; it fails at:compileTestJavabecauseExpirationFilter.dteRange(int, int)doesn't exist yet, confirming the tests correctly drive the required implementation.implement: All changes are within the allowed paths (
src/main/java,src/test/java,docs/), and I did not touch the tests written in phase 1 beyond what already existed.Summary
Implemented the
1.4.0API change toGET /v1/options/chain/{underlying}/'sdtequery parameter (integer → string), following the same sealed-filter conventionStrikeFilteralready uses for its?strike=range syntax:ExpirationFilter: added a new sealed variantDteRange(minDays, maxDays)with factoryExpirationFilter.dteRange(int, int), validatingminDays >= 0andminDays <= maxDays(mirrorsdte(int)'s andStrikeFilter.range's existing validation messages).OptionsResource.applyExpirationFilter: rendersDteRangeas?dte=min-max, keeping the exhaustive if-chain over the now six-variant sealed type complete (no silent no-op for the new case).docs/options/chain.md: documented the newdteRange(...)builder call alongside the existingdte(...).No existing tests were weakened — the phase-1 tests are unchanged and now compile and pass.
gradle testandgradle build(including Spotless and JaCoCo) both succeed.changelog: Added an
## [Unreleased]entry noting it responds to API 1.4.0, with an### Addedline forExpirationFilter.dteRange(...)and a### ChangedBREAKING line explaining the sealed-interfacepermitsexpansion and how to migrate exhaustive switches.Files
CHANGELOG.mddocs/options/chain.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.dteRange(int, int)— New static factory method returning a DteRange filter; throws IllegalArgumentException if minDays is negative or minDays > maxDays. Consumers can now call this method that did not exist before.ExpirationFilter.DteRange— New public record type (minDays, maxDays) implementing the sealed ExpirationFilter interface; serializes to the chain endpoint's ?dte=min-max wire form.ExpirationFilter.permits— The sealed interface's permits list gains ExpirationFilter.DteRange alongside the existing OnDate, Dte, Between, MonthYear, All. Any consumer exhaustive switch over ExpirationFilter without a default branch will no longer compile until a DteRange case is added — a source-compatibility break for that specific pattern, though additive in intent.Reviewer notes
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) · 61 turns · US$ 1.34 · item
14629a56-f611-403a-9c50-77f526c7ce7b