You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add QueryParams multimap and OperationParams input-projection SPI
Introduce a structured query-string model and the operation-input projection
seam, replacing the placeholder query type and the split('&') string surgery in
pagination.
- QueryParams (http.common): immutable, insertion-ordered, multi-valued query
model with RFC 3986 encoding (space -> %20, literal + -> %2B) and an
order-sensitive equals that agrees with encode(). It is an origination model
for building queries, not a fidelity-preserving URL editor.
- PercentEncoding (http.common): shared RFC 3986 URL-component codec used for
both query components and path segments (/ -> %2F, so a path value cannot
inject extra segments).
- OperationParams (operation): SPI that projects an operation's typed inputs
(path / query / header / body) into a Request and the context chain, via
toRequest(baseUrl) and toRequestContext(baseUrl, dispatch). Path templates
(/pets/{id}) are substituted with path-segment encoding; a missing variable
fails fast. Execution stays the pipeline's job.
- RequestRebuilder: query edits now splice the raw query string, preserving
untouched parameters byte-for-byte (a value-less ?flag stays value-less,
reserved characters are not rewritten) and encoding only the targeted
parameter; reads go through QueryParams.
- Remove the dead QueryParam placeholder stub and its test.
- Record the request-URL model decision (keep java.net.URL, layer QueryParams)
and document the new types in docs/http.md and the README package map.
Closes#28Closes#29Closes#57
|`http.response`|`Response`, `ResponseBody`, `LoggableResponseBody`, `Status` (a value-carrying class with a total `fromCode`), plus the raw-vs-parsed seam: `ResponseHandler<T>` (with dep-free `string()`/`empty()` handlers) and a lazy, parse-once `ParsedResponse<T>`. |
267
267
|`http.response.exception`| Typed `HttpException` hierarchy (`BadRequestException`, `RequestTimeoutException`, `TooManyRequestsException`, `ServiceUnavailableException`, …) with `isRetryable` derived from `RetryUtils.isRetryable` and exposed via the `Retryable` interface, plus `NetworkException` and `HttpExceptionFactory`. |
|`pagination`|`Paginator<T>` (with a `maxPages` safety cap) over cursor / page-number / link-header `PaginationStrategy` implementations, plus `Page<T>` / `SimplePage<T>`. Token-style APIs use `CursorPaginationStrategy` with the query-param name set (e.g. `"page_token"`). |
276
+
|`operation`|`OperationParams` — SPI projecting an operation's typed inputs (path / query / header / body) into a `Request` and the context chain, via `toRequest(baseUrl)` / `toRequestContext(baseUrl, dispatch)`. |
276
277
|`pipeline`| Recovery-aware primitives: `RequestPipeline`, `ResponsePipeline`, `ExecutionPipeline` over a sealed `ResponseOutcome`, with steps (`pipeline.step`, `pipeline.step.retry`) like `RetryStep`, `ResponseRecoveryStep`, `IdempotencyKeyStep`, `ClientIdentityStep`. |
Copy file name to clipboardExpand all lines: sdk-core/api/sdk-core.api
+60Lines changed: 60 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -580,6 +580,44 @@ public final class org/dexpace/sdk/core/http/common/Protocol$Companion {
580
580
public final fun get (Ljava/lang/String;)Lorg/dexpace/sdk/core/http/common/Protocol;
581
581
}
582
582
583
+
public final class org/dexpace/sdk/core/http/common/QueryParams {
584
+
public static final field Companion Lorg/dexpace/sdk/core/http/common/QueryParams$Companion;
585
+
public synthetic fun <init> (Ljava/util/Map;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
586
+
public static final fun builder ()Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
587
+
public final fun contains (Ljava/lang/String;)Z
588
+
public static final fun empty ()Lorg/dexpace/sdk/core/http/common/QueryParams;
589
+
public final fun encode ()Ljava/lang/String;
590
+
public final fun entries ()Ljava/util/Set;
591
+
public fun equals (Ljava/lang/Object;)Z
592
+
public final fun get (Ljava/lang/String;)Ljava/lang/String;
593
+
public fun hashCode ()I
594
+
public final fun isEmpty ()Z
595
+
public final fun names ()Ljava/util/Set;
596
+
public final fun newBuilder ()Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
597
+
public static final fun parse (Ljava/lang/String;)Lorg/dexpace/sdk/core/http/common/QueryParams;
598
+
public final fun size ()I
599
+
public fun toString ()Ljava/lang/String;
600
+
public final fun values (Ljava/lang/String;)Ljava/util/List;
601
+
}
602
+
603
+
public final class org/dexpace/sdk/core/http/common/QueryParams$Builder {
604
+
public fun <init> ()V
605
+
public fun <init> (Lorg/dexpace/sdk/core/http/common/QueryParams;)V
606
+
public final fun add (Ljava/lang/String;Ljava/lang/String;)Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
607
+
public final fun add (Ljava/lang/String;Ljava/util/List;)Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
608
+
public final fun addAll (Lorg/dexpace/sdk/core/http/common/QueryParams;)Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
609
+
public final fun build ()Lorg/dexpace/sdk/core/http/common/QueryParams;
610
+
public final fun remove (Ljava/lang/String;)Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
611
+
public final fun set (Ljava/lang/String;Ljava/lang/String;)Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
612
+
public final fun set (Ljava/lang/String;Ljava/util/List;)Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
613
+
}
614
+
615
+
public final class org/dexpace/sdk/core/http/common/QueryParams$Companion {
616
+
public final fun builder ()Lorg/dexpace/sdk/core/http/common/QueryParams$Builder;
617
+
public final fun empty ()Lorg/dexpace/sdk/core/http/common/QueryParams;
618
+
public final fun parse (Ljava/lang/String;)Lorg/dexpace/sdk/core/http/common/QueryParams;
619
+
}
620
+
583
621
public final class org/dexpace/sdk/core/http/common/RequestConditions {
584
622
public static final field Companion Lorg/dexpace/sdk/core/http/common/RequestConditions$Companion;
585
623
public synthetic fun <init> (Ljava/util/List;Ljava/util/List;Ljava/time/Instant;Ljava/time/Instant;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -2234,6 +2272,28 @@ public abstract interface class org/dexpace/sdk/core/io/Source : java/io/Closeab
2234
2272
public abstract fun read (Lorg/dexpace/sdk/core/io/Buffer;J)J
2235
2273
}
2236
2274
2275
+
public abstract interface class org/dexpace/sdk/core/operation/OperationParams {
2276
+
public fun body ()Lorg/dexpace/sdk/core/http/request/RequestBody;
2277
+
public abstract fun getMethod ()Lorg/dexpace/sdk/core/http/request/Method;
2278
+
public fun getOperationName ()Ljava/lang/String;
2279
+
public abstract fun getPathTemplate ()Ljava/lang/String;
2280
+
public fun headers ()Lorg/dexpace/sdk/core/http/common/Headers;
2281
+
public fun pathParams ()Ljava/util/Map;
2282
+
public fun queryParams ()Lorg/dexpace/sdk/core/http/common/QueryParams;
2283
+
public fun toRequest (Ljava/lang/String;)Lorg/dexpace/sdk/core/http/request/Request;
2284
+
public fun toRequestContext (Ljava/lang/String;Lorg/dexpace/sdk/core/http/context/DispatchContext;)Lorg/dexpace/sdk/core/http/context/RequestContext;
2285
+
}
2286
+
2287
+
public final class org/dexpace/sdk/core/operation/OperationParams$DefaultImpls {
2288
+
public static fun body (Lorg/dexpace/sdk/core/operation/OperationParams;)Lorg/dexpace/sdk/core/http/request/RequestBody;
2289
+
public static fun getOperationName (Lorg/dexpace/sdk/core/operation/OperationParams;)Ljava/lang/String;
2290
+
public static fun headers (Lorg/dexpace/sdk/core/operation/OperationParams;)Lorg/dexpace/sdk/core/http/common/Headers;
2291
+
public static fun pathParams (Lorg/dexpace/sdk/core/operation/OperationParams;)Ljava/util/Map;
2292
+
public static fun queryParams (Lorg/dexpace/sdk/core/operation/OperationParams;)Lorg/dexpace/sdk/core/http/common/QueryParams;
2293
+
public static fun toRequest (Lorg/dexpace/sdk/core/operation/OperationParams;Ljava/lang/String;)Lorg/dexpace/sdk/core/http/request/Request;
2294
+
public static fun toRequestContext (Lorg/dexpace/sdk/core/operation/OperationParams;Ljava/lang/String;Lorg/dexpace/sdk/core/http/context/DispatchContext;)Lorg/dexpace/sdk/core/http/context/RequestContext;
2295
+
}
2296
+
2237
2297
public final class org/dexpace/sdk/core/pagination/AsyncPaginator {
2238
2298
public fun <init> (Lorg/dexpace/sdk/core/client/AsyncHttpClient;Lorg/dexpace/sdk/core/http/request/Request;Lorg/dexpace/sdk/core/pagination/PaginationStrategy;)V
2239
2299
public fun <init> (Lorg/dexpace/sdk/core/client/AsyncHttpClient;Lorg/dexpace/sdk/core/http/request/Request;Lorg/dexpace/sdk/core/pagination/PaginationStrategy;J)V
0 commit comments