Skip to content

Commit 98d00f2

Browse files
committed
Nit: Fix dokka warnings around kdoc logOnError references in Http/ApiFetcherExtensions
1 parent f17e322 commit 98d00f2

2 files changed

Lines changed: 38 additions & 41 deletions

File tree

common/kobwebx-serialization-kotlinx/src/jsMain/kotlin/com/varabyte/kobweb/browser/ApiFetcherExtensions.kt

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import com.varabyte.kobweb.browser.http.FetchDefaults
55
import com.varabyte.kobweb.browser.http.bodyAsBytes
66
import com.varabyte.kobweb.browser.http.bodyAs
77
import com.varabyte.kobweb.browser.http.toRequestBody
8-
import com.varabyte.kobweb.browser.tryPost
98
import kotlinx.serialization.DeserializationStrategy
109
import kotlinx.serialization.SerializationStrategy
1110
import kotlinx.serialization.serializer
@@ -39,8 +38,8 @@ suspend inline fun <reified R> ApiFetcher.get(
3938
/**
4039
* Like [get], but returns null if the request fails or the response can't be deserialized.
4140
*
42-
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
43-
* be true for debug builds and false for release builds.
41+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
42+
* will be true for debug builds and false for release builds.
4443
*
4544
* Note: you should NOT prepend your path with "api/", as that will be added automatically.
4645
*/
@@ -170,8 +169,8 @@ suspend inline fun <reified R> ApiFetcher.post(
170169
* You are generally encouraged to call `tryPost(...) { convert() }` over `tryPost(...)?.convert()` as the former will
171170
* ensure that exception handling is covered in that case.
172171
*
173-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console (including the logic in
174-
* the [transform] block).
172+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console (including the
173+
* logic in the [transform] block).
175174
*
176175
* If you do not care about converting the result to some arbitrary type, use the [tryPost] version that returns
177176
* [Response?][Response] instead. For serialization-aware methods, it is expected that users will rarely, if ever, need
@@ -190,8 +189,8 @@ suspend inline fun <reified B, T> ApiFetcher.tryPost(
190189
/**
191190
* Like [post] but returns null instead of throwing if the request fails.
192191
*
193-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console. By default, this will
194-
* be true for debug builds and false for release builds.
192+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
193+
* will be true for debug builds and false for release builds.
195194
*
196195
* If you plan to do additional operations on the response and would also like to have logging / exception
197196
* protection for them, consider using the other [tryPost] call which lets you pass in a `transform` callback.
@@ -235,8 +234,8 @@ suspend inline fun <reified B> ApiFetcher.tryPostBytes(
235234
/**
236235
* Like [post], but returns null if the request fails or the response can't be deserialized.
237236
*
238-
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
239-
* be true for debug builds and false for release builds.
237+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
238+
* will be true for debug builds and false for release builds.
240239
*
241240
* Note: you should NOT prepend your path with "api/", as that will be added automatically.
242241
*/
@@ -406,8 +405,8 @@ suspend inline fun <reified R> ApiFetcher.put(
406405
* You are generally encouraged to call `tryPut(...) { convert() }` over `tryPut(...)?.convert()` as the former will
407406
* ensure that exception handling is covered in that case.
408407
*
409-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console (including the logic in
410-
* the [transform] block).
408+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console (including the
409+
* logic in the [transform] block).
411410
*
412411
* If you do not care about converting the result to some arbitrary type, use the [tryPut] version that returns
413412
* [Response?][Response] instead. For serialization-aware methods, it is expected that users will rarely, if ever, need
@@ -426,8 +425,8 @@ suspend inline fun <reified B, T> ApiFetcher.tryPut(
426425
/**
427426
* Like [put] but returns null instead of throwing if the request fails.
428427
*
429-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console. By default, this will
430-
* be true for debug builds and false for release builds.
428+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
429+
* will be true for debug builds and false for release builds.
431430
*
432431
* If you plan to do additional operations on the response and would also like to have logging / exception
433432
* protection for them, consider using the other [tryPut] call which lets you pass in a `transform` callback.
@@ -471,8 +470,8 @@ suspend inline fun <reified B> ApiFetcher.tryPutBytes(
471470
/**
472471
* Like [put], but returns null if the request fails or the response can't be deserialized.
473472
*
474-
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
475-
* be true for debug builds and false for release builds.
473+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
474+
* will be true for debug builds and false for release builds.
476475
*
477476
* Note: you should NOT prepend your path with "api/", as that will be added automatically.
478477
*/
@@ -643,8 +642,8 @@ suspend inline fun <reified R> ApiFetcher.patch(
643642
* You are generally encouraged to call `tryPatch(...) { convert() }` over `tryPatch(...)?.convert()` as the former will
644643
* ensure that exception handling is covered in that case.
645644
*
646-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console (including the logic in
647-
* the [transform] block).
645+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console (including the
646+
* logic in the [transform] block).
648647
*
649648
* If you do not care about converting the result to some arbitrary type, use the [tryPatch] version that returns
650649
* [Response?][Response] instead. For serialization-aware methods, it is expected that users will rarely, if ever, need
@@ -663,8 +662,8 @@ suspend inline fun <reified B, T> ApiFetcher.tryPatch(
663662
/**
664663
* Like [patch] but returns null instead of throwing if the request fails.
665664
*
666-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console. By default, this will
667-
* be true for debug builds and false for release builds.
665+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
666+
* will be true for debug builds and false for release builds.
668667
*
669668
* If you plan to do additional operations on the response and would also like to have logging / exception
670669
* protection for them, consider using the other [tryPatch] call which lets you pass in a `transform` callback.
@@ -708,8 +707,8 @@ suspend inline fun <reified B> ApiFetcher.tryPatchBytes(
708707
/**
709708
* Like [patch], but returns null if the request fails or the response can't be deserialized.
710709
*
711-
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
712-
* be true for debug builds and false for release builds.
710+
* Additionally, if [ApiFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
711+
* will be true for debug builds and false for release builds.
713712
*
714713
* Note: you should NOT prepend your path with "api/", as that will be added automatically.
715714
*/

common/kobwebx-serialization-kotlinx/src/jsMain/kotlin/com/varabyte/kobweb/browser/http/HttpFetcherExtensions.kt

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.varabyte.kobweb.browser.http
22

3-
import com.varabyte.kobweb.browser.http.tryPost
4-
import com.varabyte.kobweb.browser.tryPost
53
import kotlinx.serialization.DeserializationStrategy
64
import kotlinx.serialization.SerializationStrategy
75
import kotlinx.serialization.json.Json
@@ -191,8 +189,8 @@ suspend inline fun <reified R> HttpFetcher.post(
191189
* You are generally encouraged to call `tryPost(...) { convert() }` over `tryPost(...)?.convert()` as the former will
192190
* ensure that exception handling is covered in that case.
193191
*
194-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console (including the logic in
195-
* the [transform] block).
192+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console (including the
193+
* logic in the [transform] block).
196194
*
197195
* If you do not care about converting the result to some arbitrary type, use the [tryPost] version that returns
198196
* [Response?][Response] instead. For serialization-aware methods, it is expected that users will rarely, if ever, need
@@ -211,8 +209,8 @@ suspend inline fun <reified B, T> HttpFetcher.tryPost(
211209
/**
212210
* Like [post] but returns null instead of throwing if the request fails.
213211
*
214-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console. By default, this will
215-
* be true for debug builds and false for release builds.
212+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
213+
* will be true for debug builds and false for release builds.
216214
*
217215
* If you plan to do additional operations on the response and would also like to have logging / exception
218216
* protection for them, consider using the other [tryPost] call which lets you pass in a `transform` callback.
@@ -252,8 +250,8 @@ suspend inline fun <reified B> HttpFetcher.tryPostBytes(
252250
/**
253251
* Like [post], but returns null if the request fails or the response can't be deserialized.
254252
*
255-
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
256-
* be true for debug builds and false for release builds.
253+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
254+
* will be true for debug builds and false for release builds.
257255
*/
258256
@Deprecated("With these serialization-aware network methods, we are moving response deserialization handling to a separate `bodyAs` call. This lets us accomplish the same amount of functionality with fewer methods.",
259257
ReplaceWith(
@@ -411,8 +409,8 @@ suspend inline fun <reified R> HttpFetcher.put(
411409
* You are generally encouraged to call `tryPut(...) { convert() }` over `tryPut(...)?.convert()` as the former will
412410
* ensure that exception handling is covered in that case.
413411
*
414-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console (including the logic in
415-
* the [transform] block).
412+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console (including the
413+
* logic in the [transform] block).
416414
*
417415
* If you do not care about converting the result to some arbitrary type, use the [tryPut] version that returns
418416
* [Response?][Response] instead. For serialization-aware methods, it is expected that users will rarely, if ever, need
@@ -431,8 +429,8 @@ suspend inline fun <reified B, T> HttpFetcher.tryPut(
431429
/**
432430
* Like [put] but returns null instead of throwing if the request fails.
433431
*
434-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console. By default, this will
435-
* be true for debug builds and false for release builds.
432+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
433+
* will be true for debug builds and false for release builds.
436434
*
437435
* If you plan to do additional operations on the response and would also like to have logging / exception
438436
* protection for them, consider using the other [tryPut] call which lets you pass in a `transform` callback.
@@ -474,8 +472,8 @@ suspend inline fun <reified B> HttpFetcher.tryPutBytes(
474472
/**
475473
* Like [put], but returns null if the request fails or the response can't be deserialized.
476474
*
477-
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
478-
* be true for debug builds and false for release builds.
475+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
476+
* will be true for debug builds and false for release builds.
479477
*/
480478
@Deprecated("With these serialization-aware network methods, we are moving response deserialization handling to a separate `bodyAs` call. This lets us accomplish the same amount of functionality with fewer methods.",
481479
ReplaceWith(
@@ -633,8 +631,8 @@ suspend inline fun <reified R> HttpFetcher.patch(
633631
* You are generally encouraged to call `tryPatch(...) { convert() }` over `tryPatch(...)?.convert()` as the former will
634632
* ensure that exception handling is covered in that case.
635633
*
636-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console (including the logic in
637-
* the [transform] block).
634+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console (including the
635+
* logic in the [transform] block).
638636
*
639637
* If you do not care about converting the result to some arbitrary type, use the [tryPatch] version that returns
640638
* [Response?][Response] instead. For serialization-aware methods, it is expected that users will rarely, if ever, need
@@ -653,8 +651,8 @@ suspend inline fun <reified B, T> HttpFetcher.tryPatch(
653651
/**
654652
* Like [patch] but returns null instead of throwing if the request fails.
655653
*
656-
* Additionally, if [logOnError] is set to true, any failure will be logged to the console. By default, this will
657-
* be true for debug builds and false for release builds.
654+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
655+
* will be true for debug builds and false for release builds.
658656
*
659657
* If you plan to do additional operations on the response and would also like to have logging / exception
660658
* protection for them, consider using the other [tryPatch] call which lets you pass in a `transform` callback.
@@ -695,8 +693,8 @@ suspend inline fun <reified B> HttpFetcher.tryPatchBytes(
695693
/**
696694
* Like [patch], but returns null if the request fails or the response can't be deserialized.
697695
*
698-
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this will
699-
* be true for debug builds and false for release builds.
696+
* Additionally, if [HttpFetcher.logOnError] is set to true, any failure will be logged to the console. By default, this
697+
* will be true for debug builds and false for release builds.
700698
*/
701699
@Deprecated("With these serialization-aware network methods, we are moving response deserialization handling to a separate `bodyAs` call. This lets us accomplish the same amount of functionality with fewer methods.",
702700
ReplaceWith(

0 commit comments

Comments
 (0)