Skip to content

Commit facbbb0

Browse files
committed
Binary compatibility fixes
1 parent 6423bb3 commit facbbb0

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

rest/.jvm/src/main/scala/io/udash/rest/RestServlet.scala

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.udash
22
package rest
33

44
import com.avsystem.commons.*
5-
import com.avsystem.commons.annotation.explicitGenerics
5+
import com.avsystem.commons.annotation.{bincompat, explicitGenerics}
66
import com.typesafe.scalalogging.{LazyLogging, Logger as ScalaLogger}
77
import io.udash.rest.RestServlet.*
88
import io.udash.rest.raw.*
@@ -49,6 +49,19 @@ object RestServlet {
4949
maxPayloadSize = maxPayloadSize,
5050
defaultStreamingBatchSize = defaultStreamingBatchSize,
5151
)
52+
53+
@bincompat private[rest] def apply[RestApi: RawRest.AsRawRpc : RestMetadata](
54+
apiImpl: RestApi,
55+
handleTimeout: FiniteDuration ,
56+
maxPayloadSize: Long,
57+
)(implicit
58+
scheduler: Scheduler
59+
): RestServlet = apply[RestApi](
60+
apiImpl,
61+
handleTimeout = handleTimeout,
62+
maxPayloadSize = maxPayloadSize,
63+
defaultStreamingBatchSize = DefaultStreamingBatchSize,
64+
)
5265
}
5366

5467
class RestServlet(

rest/src/main/scala/io/udash/rest/raw/RestMetadata.scala

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package rest
33
package raw
44

55
import com.avsystem.commons.*
6+
import com.avsystem.commons.annotation.bincompat
67
import com.avsystem.commons.meta.*
78
import com.avsystem.commons.rpc.*
89
import io.udash.macros.RestMacros
@@ -292,6 +293,16 @@ final case class PrefixMetadata[T](
292293
@multi @reifyAnnot streamedResponseAdjusters: List[StreamedResponseAdjuster],
293294
@infer @checked result: RestMetadata.Lazy[T],
294295
) extends RestMethodMetadata[T] {
296+
297+
@bincompat private[rest] def this(
298+
name: String,
299+
methodTag: Prefix,
300+
parametersMetadata: RestParametersMetadata,
301+
requestAdjusters: List[RequestAdjuster],
302+
responseAdjusters: List[ResponseAdjuster],
303+
result: RestMetadata.Lazy[T],
304+
) = this(name, methodTag, parametersMetadata, requestAdjusters, responseAdjusters, Nil, result)
305+
295306
def methodPath: List[PlainValue] = PlainValue.decodePath(methodTag.path)
296307
}
297308

@@ -307,6 +318,30 @@ final case class HttpMethodMetadata[T](
307318
@multi @reifyAnnot streamedResponseAdjusters: List[StreamedResponseAdjuster],
308319
@infer @checked responseType: HttpResponseType[T],
309320
) extends RestMethodMetadata[T] {
321+
322+
@bincompat private[rest] def this(
323+
name: String,
324+
methodTag: HttpMethodTag,
325+
bodyTypeTag: BodyTypeTag,
326+
parametersMetadata: RestParametersMetadata,
327+
bodyParams: List[ParamMetadata[_]],
328+
formBody: Boolean,
329+
requestAdjusters: List[RequestAdjuster],
330+
responseAdjusters: List[ResponseAdjuster],
331+
responseType: HttpResponseType[T],
332+
) = this(
333+
name,
334+
methodTag,
335+
bodyTypeTag,
336+
parametersMetadata,
337+
bodyParams,
338+
formBody,
339+
requestAdjusters,
340+
responseAdjusters,
341+
Nil,
342+
responseType
343+
)
344+
310345
val method: HttpMethod = methodTag.method
311346

312347
val customBody: Boolean = bodyTypeTag match {

0 commit comments

Comments
 (0)