Skip to content

Commit 1ac8734

Browse files
authored
docs: simplify redundant KDoc across the SDK surface (#210)
PR: #210
1 parent c85d1b8 commit 1ac8734

49 files changed

Lines changed: 153 additions & 514 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk-async-reactor/src/main/kotlin/org/dexpace/sdk/async/reactor/Reactor.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,10 @@ public fun AsyncHttpClient.executeMono(
5959
): Mono<Response> = deferMono { executeAsync(request, options) }
6060

6161
/**
62-
* Pipeline-level [Mono] facade — see [executeMono].
63-
*
64-
* ## MDC propagation
65-
*
66-
* The SLF4J MDC is captured **per subscription**, not at assembly time: the [Mono.defer]
67-
* wrapper snapshots MDC the moment a subscriber subscribes, so each subscription reinstates
68-
* the *subscriber's* `trace.id` / `span.id` — both in the [AsyncHttpPipeline.sendAsync]
69-
* supplier and in the adapter's own `.doOnSubscribe` / `.doOnCancel` hooks, even when those
70-
* fire on a different scheduler. A `Mono` assembled once and re-subscribed therefore picks
71-
* up the MDC live at each subscribe, not a stale snapshot from the assembling thread.
72-
* To extend MDC propagation through user-supplied downstream operators, enable
73-
* `Hooks.enableAutomaticContextPropagation()` at the application level.
62+
* Pipeline-level [Mono] facade — see [executeMono]. Same cold-publisher and
63+
* per-subscription MDC semantics: each subscription reinstates the subscriber's
64+
* `trace.id` / `span.id` for the [AsyncHttpPipeline.sendAsync] supplier and the
65+
* `.doOnSubscribe` / `.doOnCancel` hooks.
7466
*/
7567
public fun AsyncHttpPipeline.sendMono(request: Request): Mono<Response> = deferMono { sendAsync(request) }
7668

sdk-core/src/main/kotlin/org/dexpace/sdk/core/auth/AuthChallengeParser.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import java.util.Locale
2424
* delimiters. Escape sequences (`\"`, `\\`) inside quoted strings are unescaped on
2525
* read; surrounding quotes are stripped from the stored value.
2626
*
27-
* Malformed challenges are skipped — the parser does not throw on bad input. This
28-
* matches the [edge-case guardrails][to-implement.md] for Rank 12.
27+
* Malformed challenges are skipped — the parser does not throw on bad input.
2928
*/
3029
public object AuthChallengeParser {
3130
// Initial capacity for the per-challenge auth-param map. Auth challenges typically

sdk-core/src/main/kotlin/org/dexpace/sdk/core/auth/AuthRequirement.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import org.dexpace.sdk.core.generics.Builder as GenericBuilder
1111

1212
/**
1313
* A single auth alternative an operation accepts: one [AuthScheme] plus any OAuth-specific
14-
* parameters ([oauthScopes] / [oauthParams]) the auth step should forward to the token
15-
* provider when the chosen scheme is [AuthScheme.OAUTH2].
14+
* parameters ([oauthScopes] / [oauthParams], e.g. `claims`) the auth step should forward to
15+
* the token provider when the chosen scheme is [AuthScheme.OAUTH2].
1616
*
1717
* Each requirement pairs a scheme with its *own* OAuth parameters, so an operation that
1818
* accepts OAuth with `read` scopes **or** a static API key is two requirements, only one of
@@ -27,10 +27,6 @@ import org.dexpace.sdk.core.generics.Builder as GenericBuilder
2727
* copy), so a caller that retains and later mutates the argument collection cannot mutate this
2828
* instance.
2929
* Instances are obtained via [of] or [Builder], never a public constructor.
30-
*
31-
* @param scheme the auth scheme this alternative selects.
32-
* @param oauthScopes OAuth scopes to forward to the token provider; ignored for non-OAuth schemes.
33-
* @param oauthParams extra OAuth params to forward (e.g. `claims`); ignored for non-OAuth schemes.
3430
*/
3531
public class AuthRequirement private constructor(
3632
scheme: AuthScheme,

sdk-core/src/main/kotlin/org/dexpace/sdk/core/auth/BearerToken.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import java.time.Instant
1818
* pre-emptively refresh by passing a `marginBefore` to [isExpiredAt] — useful for avoiding
1919
* mid-flight expiries during long requests.
2020
*
21-
* Value semantics via `data class` so equal tokens compare equal and can be diffed by
22-
* tests cheaply.
21+
* Value semantics via `data class` gives value-based [equals]/[hashCode], so tokens diff
22+
* cheaply in tests.
2323
*
2424
* @param token the bearer token string; must not be blank.
2525
* @param expiresAt the instant the token becomes invalid, or null for a non-expiring token.

sdk-core/src/main/kotlin/org/dexpace/sdk/core/auth/DigestChallengeHandler.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,9 @@ public class DigestChallengeHandler
9595
* absent (legacy RFC 2069 style — we'll still handle it),
9696
* - it carries a `realm` and `nonce`.
9797
*
98-
* Ordering: we scan [preferredAlgorithms] first, then within that scan the
99-
* candidates. This ensures SHA-256 wins over MD5 even when MD5 appears first
100-
* in the header.
101-
*
102-
* Per-challenge validation is delegated to [toCandidate]; this scan only applies
103-
* the algorithm-priority ordering, independent of the order challenges arrived in.
98+
* Per-challenge validation is delegated to [toCandidate]. This scan then applies
99+
* the [preferredAlgorithms] priority ordering — independent of the order challenges
100+
* arrived in — so SHA-256 wins over MD5 even when MD5 appears first in the header.
104101
*/
105102
private fun pickChallenge(
106103
challenges: List<AuthenticateChallenge>,

sdk-core/src/main/kotlin/org/dexpace/sdk/core/client/HttpClient.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ public fun interface HttpClient : AutoCloseable {
7373
): Response = execute(request)
7474

7575
/**
76-
* Releases any resources held by this transport. The default implementation is a no-op so
77-
* SAM literals and lightweight client wrappers do not need to implement [AutoCloseable.close]
78-
* explicitly. Transport implementations that own background threads, connection pools, or
79-
* executors must override this method; see the class-level "Lifecycle" KDoc for the contract.
76+
* Releases any resources held by this transport. The default is a no-op (so SAM literals and
77+
* lightweight wrappers need not implement it); transports that own threads, pools, or executors
78+
* must override it — see the class-level "Lifecycle" KDoc for the contract.
8079
*/
8180
public override fun close() {
8281
// No-op default. Transports with owned resources override this.

sdk-core/src/main/kotlin/org/dexpace/sdk/core/generics/BuilderChecks.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ package org.dexpace.sdk.core.generics
3030
* across builders with this helper keeps the missing-field diagnostics identical, which
3131
* matters most once builders are emitted by codegen.
3232
*
33-
* @param name The field name to report in the failure message.
34-
* @param value The field value to validate.
3533
* @return [value], guaranteed non-null.
3634
* @throws IllegalStateException If [value] is `null`.
3735
*/

sdk-core/src/main/kotlin/org/dexpace/sdk/core/http/common/Headers.kt

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public data class Headers private constructor(
3838
* Returns the first header value for the given name, or null if none.
3939
*
4040
* @param name the header name (case-insensitive)
41-
* @return the first header value, or null if not found
4241
*/
4342
public fun get(name: String): String? = headersMap[sanitizeName(name)]?.firstOrNull()
4443

@@ -71,24 +70,19 @@ public data class Headers private constructor(
7170
public fun contains(name: HttpHeaderName): Boolean = headersMap.containsKey(name.caseInsensitiveName)
7271

7372
/**
74-
* Returns a point-in-time snapshot of all header names at the time of the call.
73+
* Returns a snapshot of all header names.
7574
*
76-
* Returns a defensive copy (`Set<String>`) so that callers cannot observe later
77-
* mutations to this [Headers] instance through the returned set. The set is exposed
78-
* through Kotlin's read-only [Set] type.
79-
*
80-
* @return a snapshot of header names
75+
* A defensive copy (`Set<String>`) exposed through Kotlin's read-only [Set] type, so
76+
* callers cannot observe later mutations to this [Headers] instance through it.
8177
*/
8278
public fun names(): Set<String> = headersMap.keys.toSet()
8379

8480
/**
85-
* Returns a point-in-time snapshot of all header entries at the time of the call.
81+
* Returns a snapshot of all header entries.
8682
*
8783
* Each entry is copied into a fresh map so that callers cannot observe later mutations
8884
* to this [Headers] instance through the returned set. The set and its per-name value
8985
* lists are exposed through Kotlin's read-only [Set] / [List] types.
90-
*
91-
* @return a snapshot of header entries as [Map.Entry]
9286
*/
9387
public fun entries(): Set<Map.Entry<String, List<String>>> {
9488
val snapshot = LinkedHashMap<String, List<String>>(headersMap.size)
@@ -98,11 +92,7 @@ public data class Headers private constructor(
9892
return snapshot.entries
9993
}
10094

101-
/**
102-
* Returns a new [Builder] initialized with the existing headers.
103-
*
104-
* @return a new [Builder]
105-
*/
95+
/** Returns a new [Builder] initialized with the existing headers. */
10696
public fun newBuilder(): Builder = Builder(this)
10797

10898
override fun toString(): String = headersMap.toString()
@@ -120,8 +110,6 @@ public data class Headers private constructor(
120110

121111
/**
122112
* Creates a new builder initialized with the headers from [headers].
123-
*
124-
* @param headers the headers to initialize from
125113
*/
126114
public constructor(headers: Headers) : this() {
127115
headers.headersMap.forEach { (key, values) ->
@@ -132,10 +120,6 @@ public data class Headers private constructor(
132120
/**
133121
* Adds a header with the specified name and value.
134122
* Multiple headers with the same name are allowed.
135-
*
136-
* @param name the header name
137-
* @param value the header value
138-
* @return this builder
139123
*/
140124
public fun add(
141125
name: String,
@@ -144,10 +128,6 @@ public data class Headers private constructor(
144128

145129
/**
146130
* Adds all header values for the specified name.
147-
*
148-
* @param name the header name
149-
* @param values the list of header values
150-
* @return this builder
151131
*/
152132
public fun add(
153133
name: String,
@@ -175,7 +155,6 @@ public data class Headers private constructor(
175155
*
176156
* @param name the header name
177157
* @param value the header value, which may contain non-ASCII bytes
178-
* @return this builder
179158
* @throws IllegalArgumentException if [name] is blank or contains a control/non-ASCII byte,
180159
* or [value] contains a prohibited control character
181160
*/
@@ -213,10 +192,6 @@ public data class Headers private constructor(
213192
* Sets the header with the specified name to the single value provided.
214193
* If headers with this name already exist, they are removed. Passing a `null`
215194
* [value] removes the header entirely (Azure / OkHttp semantics).
216-
*
217-
* @param name the header name
218-
* @param value the header value, or `null` to remove
219-
* @return this builder
220195
*/
221196
public fun set(
222197
name: String,
@@ -233,10 +208,6 @@ public data class Headers private constructor(
233208
/**
234209
* Sets the header with the specified name to the values list provided.
235210
* If headers with this name already exist, they are removed.
236-
*
237-
* @param name the header name
238-
* @param values the header values
239-
* @return this builder
240211
*/
241212
public fun set(
242213
name: String,
@@ -278,9 +249,6 @@ public data class Headers private constructor(
278249

279250
/**
280251
* Removes any header with the specified name.
281-
*
282-
* @param name the header name
283-
* @return this builder
284252
*/
285253
public fun remove(name: String): Builder =
286254
apply {
@@ -309,11 +277,7 @@ public data class Headers private constructor(
309277
}
310278
}
311279

312-
/**
313-
* Builds an immutable [Headers] instance.
314-
*
315-
* @return the built [Headers]
316-
*/
280+
/** Builds an immutable [Headers] instance. */
317281
public fun build(): Headers {
318282
// Deep, defensive copy: snapshot each value list into its own fresh copy so
319283
// that later builder mutations cannot reach into the built instance. The

sdk-core/src/main/kotlin/org/dexpace/sdk/core/http/common/HttpRange.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,8 @@ public class HttpRange private constructor(private val raw: String) {
7878
}
7979

8080
/**
81-
* Parses a `Range` header value into an [HttpRange]. The accepted value is stored
82-
* verbatim and round-trips through [toHeaderValue] unchanged, so its exact casing is
83-
* preserved on the wire.
84-
*
85-
* The value must begin with the `bytes=` unit token (matched case-insensitively, with no
86-
* leading whitespace); only the `bytes` unit is accepted, and multi-range values are
87-
* rejected.
81+
* Parses a `Range` header value into an [HttpRange], storing it verbatim so its casing
82+
* round-trips through [toHeaderValue] (see the class KDoc for the accepted-form contract).
8883
*
8984
* @throws IllegalArgumentException if the value does not begin with the `bytes=` unit
9085
* token or contains a comma (multi-range).

sdk-core/src/main/kotlin/org/dexpace/sdk/core/http/common/MediaType.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public data class MediaType private constructor(
7171
* in a try/catch.
7272
*
7373
* The lookup is case-insensitive: `UTF-8`, `utf-8`, and `Utf-8` all resolve to the same
74-
* [Charset]. The parameter value is lower-cased before being passed to [Charset.forName],
75-
* normalising the cache key. The JDK accepts any case, but lowercasing here ensures a
76-
* consistent canonical form for comparison and logging purposes.
74+
* [Charset]. The value is lower-cased before [Charset.forName] — the JDK accepts any case,
75+
* but a canonical lower-case form normalises the cache key and keeps comparison and logging
76+
* consistent.
7777
*/
7878
val charset: Charset?
7979
get() =
@@ -222,7 +222,6 @@ public data class MediaType private constructor(
222222
* Parses a media type string into a [MediaType].
223223
*
224224
* @param mediaType the wire-form value (e.g. `application/json;charset=utf-8`).
225-
* @return the parsed [MediaType].
226225
* @throws IllegalArgumentException if the media type cannot be parsed.
227226
*/
228227
@JvmStatic

0 commit comments

Comments
 (0)